Skip to content

feature: chat message reactions - #624

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

lukepolo merged 4 commits into
mainfrom
feature/chat-reactions

Conversation

@lukepolo

@lukepolo lukepolo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Players can react to any chat message with one of six reactions, and click a reaction again to take it back.

  • Six reactions (👍 ❤️ 😂 🔥 😮 😢) matching the api's allowlist; pills under the message show counts and a "who reacted" tooltip built from names already in the room.
  • "Add Reaction" in the message menu opens a picker; anyone who can post can react, and a gagged player can only take back what they hold.
  • Socket.react shares the request plumbing, won't resend a toggle that's still in flight, and applies the room's :reaction broadcast; live reactions survive a stale snapshot.
  • The right hub stays open from the pick through the picker, and focus returns to the trigger unless the picker was dismissed by clicking elsewhere.
  • 12 new keys in all 16 locales.

Merge/deploy: pairs with 5stackgg/api#445; stacked on #622, merge that first.

Tests: the hub collapsing between pick and picker, a double click toggling twice (picker and socket), focus stolen after a click outside, the timeout copy, a gagged row rewrapping, a held pill's hover and the picker's missing label each fail with their fix reverted. Based on DEAFCS 662b049bd, 76e53ec92, 32d7ae9e9, 4d923158d

@lukepolo
lukepolo force-pushed the feature/chat-self-edit branch from 85b4715 to ea4fce8 Compare September 29, 2026 01:17
Base automatically changed from feature/chat-self-edit to main September 29, 2026 01:18
Anyone who can post in a room can react to any line in it, website or
game, with one of six reactions: 👍 ❤️ 😂 🔥 😮 😢. Reactions show as
pills under the message with a count, in the api's fixed order, and the
ones you hold are picked out in amber. Clicking a pill toggles it, and
hovering it names who reacted from what this browser already knows
(the room's participants and whoever has spoken), counting the rest.

The message menu gains Add Reaction above Edit, which opens a picker of
all six hung off the trigger. The menu, the picker and the confirm all
hold the right hub open. A gagged player in a group room can only take
back what they hold: the picker disables the rest and says why.

The socket sends lobby:react through the chat request plumbing and
listens for the room's `reaction` event, whose whole-state payload
replaces the message's reactions and never creates or revives one. A
history snapshot keeps reactions that changed live after the room was
joined, since the api sends no version to compare. Refusals toast
through chatErrors, with copy for rate_limited and gagged.
Picking Add Reaction now holds the right hub from the pick itself: the
menu's exit animation outlasts the hub's hover-close delay, so a
hover-peeking hub used to collapse before the picker opened. Closing the
picker by clicking elsewhere no longer pulls focus back to the trigger,
since reka emits its close focus event twice. The picker is labelled for
screen readers.

A double click no longer adds a reaction and takes it straight back: the
picker ignores a pick once it is closing, and a toggle already on its way
for the same message and reaction isn't sent again. A reaction the
server never answered says it may still go through. A gagged player's
row keeps the trigger's room when their last reaction goes, so it
doesn't rewrap, and a held pill that can't be toggled no longer looks
clickable.
The picker's dialog is named "React" for screen readers; the test
fails with the aria-label reverted to the inner grid.
@lukepolo
lukepolo force-pushed the feature/chat-reactions branch from d8b5002 to 6978a59 Compare September 29, 2026 01:22
@lukepolo
lukepolo merged commit ad69508 into main Sep 29, 2026
2 checks passed
@lukepolo
lukepolo deleted the feature/chat-reactions branch September 29, 2026 01:22
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