Skip to content

fix(reactions): show reactors list and render emoji glyph#102

Merged
krazyjakee merged 2 commits into
masterfrom
claude/unruffled-pasteur-c780d9
Jun 10, 2026
Merged

fix(reactions): show reactors list and render emoji glyph#102
krazyjakee merged 2 commits into
masterfrom
claude/unruffled-pasteur-c780d9

Conversation

@krazyjakee

Copy link
Copy Markdown
Contributor

Summary

Two bugs in the message reaction UI, found from a screenshot where a 👍 reaction showed 1 on the badge but the reactor dialog said "No one yet." and the header read Reacted with :thumbsup:.

  • Empty reactor list (primary fix). The server's GET .../reactions/{emoji} returns { "data": [user_id strings] } — bare ID strings, not user objects. The client ran the response through deserializeArray(AccordUser.fromJson) (which only maps Map elements) and then whereType<AccordUser>(), so every string was discarded → always empty. reactionUsers now parses the IDs and resolves each to an AccordUser via client.users.fetch, with an id-only stub fallback so a failed fetch doesn't drop a reactor (keeping the list consistent with the badge count).
  • Emoji token + header. For unicode emoji the client sent the shortcode name (thumbsup) as the REST token. The server keys reactions by emoji_name with no shortcode↔glyph conversion, so a client storing thumbsup would create a separate aggregate from a client storing the glyph 👍. Add/remove/list now send the resolved glyph, and the dialog header renders the glyph instead of the literal :shortcode: (custom emoji still show :name:).

Why

Verified against the accordserver source: add/remove/list bind the URL-decoded emoji path param directly to the emoji_name column, and the list handler returns user-id strings. Sending the glyph is the canonical form (server tests use URL-encoded glyphs) and ensures reactions aggregate across clients.

Reviewer notes

  • Custom emoji (emojiId != null) are unchanged: token stays name:id and the header stays :name:.
  • Caveat: a reaction previously seeded with the shortcode thumbsup won't match a glyph (👍) list query, so legacy seeded rows may still show "No one yet." Reactions added through the app store the glyph and round-trip correctly.

Test plan

  • Add a unicode reaction in-app, open the reactor dialog, confirm your user appears.
  • Confirm the dialog header shows the emoji glyph, not :thumbsup:.
  • React with the same emoji from another client and confirm the count aggregates into one badge.
  • Custom (image) emoji reactions still add/list and show :name: in the header.

🤖 Generated with Claude Code

krazyjakee and others added 2 commits June 10, 2026 10:56
The reactor dialog always showed "No one yet." even when a reaction had a
non-zero count. The list-users endpoint returns bare user-id strings, but the
client filtered the response with whereType<AccordUser>(), discarding every
string. Resolve each id to an AccordUser (with an id-only fallback) so reactors
render and the list matches the badge count.

Also send the unicode emoji glyph rather than the shortcode name as the REST
token for add/remove/list, matching how the server keys reactions by emoji_name
(so the same emoji aggregates across clients), and render the glyph in the
dialog header instead of the literal ":shortcode:".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@krazyjakee krazyjakee merged commit 323d1e6 into master Jun 10, 2026
5 checks passed
@krazyjakee krazyjakee deleted the claude/unruffled-pasteur-c780d9 branch June 28, 2026 23:01
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