feature: chat moderation — delete messages, gagged read-only composer - #618
Merged
Merged
Conversation
This was referenced Sep 28, 2026
…ad-only composer Pairs with api#438. A moderator or above gets a hover kebab on each line in a group room (never a DM) with a destructive Delete Message item, confirmed in an AlertDialog. The confirm sends lobby:delete with a request id and stays open until the api acks it, errors, or 8 seconds pass with no answer; a failure toasts "Failed to delete message", with "That message was already removed." for not_found. Deletes are never queued while offline. Every open lobby listens for lobby:<type>:<id>:deleted and keeps the deleted id as a tombstone, so a history snapshot built before the delete or a replayed chat event can't bring the line back. The pure list reducers move to utilities/chatLobbyMessages.ts. A deleted line above the "New" divider moves the divider back by one (a merged match panel counts the other room's earlier lines), and an unread line deleted from a tab that is not on screen comes off its badge. chat:error and chat:ack carry an action; a missing one reads as a send. A gagged send gets its own reason, and a gagged player's composer in a group room is replaced by the gag hint up front. DropdownMenuContent forwards its attributes to the menu like ContextMenuContent does, so data-right-hub-interactive stops being dropped at the portal.
The per-room count on the chat rail pops in and out like the hub strip's badges, rolls its digits with AnimatedStat, and caps at "100+".
A tab badge now remembers which messages it counted, so deleting a line that was read on screen no longer takes an unread one off the count. The merged match panel keeps its hidden-room marks as message keys, so a deleted line takes its mark with it. A delete the api can't find a message for closes the confirm with a plain "Message already removed" toast rather than a failure. A delete that times out says the server didn't answer and the message may still be removed, and an answer that lands after the timeout is applied quietly instead of toasting again. The confirm names the author and repeats the line, since the overlay hides the chat. The rail's room badge takes the hub's floating badge geometry. Turkish Delete Message is sentence case and the German gag hint reads as a chat block. Tests cover the merged-panel room routing end to end, the view-filter branches of the "New" line, and the badge case above.
… takes off a counted line
lukepolo
force-pushed
the
feature/chat-moderation
branch
from
September 29, 2026 01:11
d1da735 to
f056cf5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moderators can delete chat messages in group rooms, and gagged players get a read-only composer.
not_foundanswer closes it as "already removed".Socket.deleteMessagesettles on its own ack or error, times out at 8 s and applies a late answer quietly;:deletedtombstones the line so a stale snapshot can't bring it back.DropdownMenuContentforwards its attrs to the menu, sodata-right-hub-interactiveis no longer dropped (PlayerContextMenutoo).Merge/deploy: pairs with 5stackgg/api#438; stacked on #610, merge that first.
Tests: the badge dropping a line read on screen, the dropped dropdown attrs, hidden-room marks, the
not_foundclose and toast, the timeout copy and late answers each fail with their fix reverted. Based on DEAFCS 0b16a0100, fbb04e1f2, 6e9f4ec76