Skip to content

feature: chat moderation — delete messages, gagged read-only composer - #618

Merged
lukepolo merged 4 commits into
mainfrom
feature/chat-moderation
Sep 29, 2026
Merged

lukepolo merged 4 commits into
mainfrom
feature/chat-moderation

Conversation

@lukepolo

@lukepolo lukepolo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Moderators can delete chat messages in group rooms, and gagged players get a read-only composer.

  • A kebab menu (moderator and up, group rooms only) opens a confirm that names the author and quotes the line; a not_found answer closes it as "already removed".
  • Socket.deleteMessage settles on its own ack or error, times out at 8 s and applies a late answer quietly; :deleted tombstones the line so a stale snapshot can't bring it back.
  • Unread badges, the "New" divider and the merged panel's hidden-room marks follow a delete; a badge only drops lines it actually counted.
  • Gagged players see "You're gagged and can't send chat messages." instead of the composer in group rooms; DMs are unaffected.
  • DropdownMenuContent forwards its attrs to the menu, so data-right-hub-interactive is no longer dropped (PlayerContextMenu too).
  • The rail's room badge matches the hub's red pill; 8 new keys in all 16 locales.

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_found close and toast, the timeout copy and late answers each fail with their fix reverted. Based on DEAFCS 0b16a0100, fbb04e1f2, 6e9f4ec76

…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.
@lukepolo
lukepolo force-pushed the feature/chat-moderation branch from d1da735 to f056cf5 Compare September 29, 2026 01:11
@lukepolo
lukepolo merged commit 7cbb157 into main Sep 29, 2026
2 checks passed
@lukepolo
lukepolo deleted the feature/chat-moderation branch September 29, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant