Forum: show the starter reactions on post cards (#620) #658

Closed
charles wants to merge 0 commits from fix-620-forum-list-reactions into textchat
Owner

Closes #620

What

A forum (and media) post card now shows the reactions of the post's starter message on the card, so they can be seen without opening the post:

  • the starter's reactions other than the forum's default reaction (that one keeps its existing footer button, as the original), as the message's own reaction pills (reactions::pill_button, the message pill without its tooltip, on a Surface::Card background), on one line above the footer, with "+N" for those that do not fit (post_card::fitting_reactions, from the card's width); list and gallery layouts;
  • a click on a pill toggles the user's own reaction on the starter (ForumAction::ToggleReaction { post, emoji }), shown at once and undone if the request fails, exactly like the default-reaction button; disabled on locked or archived posts;
  • hidden when "Show emoji reactions on messages" is off; emoji images are requested through forum::wanted like the pills under messages (still frames).

The original

ForumPostCard.tsx shows only the forum's default reaction (DefaultReactionButton: the emoji, its count, a toggle). It does not show the starter's other reactions, so this is an addition beyond parity, as the issue anticipated: Charles to decide. Parity table row added as such.

Cause / data path

Nothing was missing in the data: the starter of each post already arrives with its reactions in POST /channels/{forum}/post-data (active posts on screen, batched 100 per call) and in the thread search's first_messages (archived pages and searches). The real API builds both with the same message response builder as normal message lists (ThreadMessageResponses.getFirstMessages), and the original reads reactions from them for its default button. Forums::first_messages already applied MESSAGE_REACTION_ADD/_ADD_MANY/_REMOVE/_REMOVE_ALL/_REMOVE_EMOJI for the starter (message id = thread id). No new request per post. The card model simply did not expose anything beyond the default reaction.

Verification

  • core (chat_forums.rs): card_shows_starter_reactions_from_post_data_and_search (post data and search first_messages, default excluded, archived shown but not clickable), card_reactions_without_default_reaction_show_every_reaction, card_reactions_follow_reaction_events_on_the_starter (all five reaction events; a reply's reactions ignored), card_reaction_pill_toggles_the_users_reaction_on_the_starter (request on the starter, echo not double-counted, failure reverts, locked disabled).
  • devserver (channel_types.rs): post_starters_carry_their_reactions: a reaction PUT on a starter is returned by post-data and by the thread search.
  • UI headless (forum_card_reactions.rs): pills on one line above the footer and 👍 only once; a click on a pill publishes ReactWith and updates the card; "+N" chip on one line in list and gallery cards; locked post's pills don't toggle; hidden with reactions off. forum.rs: card_reaction_pills_fit_one_line.
  • goldens (rendered on lavapipe in fluxer-native-shots:u2204): forum_list_reactions, forum_gallery_reactions. Existing forum and message-reaction goldens unchanged.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: all steps passed.

Note: the footer's default-reaction button remains the original's smaller pill; the new pills are the message-sized ones, so the two differ slightly in size.

🤖 Generated with Claude Code

Closes #620 ## What A forum (and media) post card now shows the reactions of the post's starter message on the card, so they can be seen without opening the post: - the starter's reactions **other than the forum's default reaction** (that one keeps its existing footer button, as the original), as the message's own reaction pills (`reactions::pill_button`, the message pill without its tooltip, on a `Surface::Card` background), on **one line** above the footer, with **"+N"** for those that do not fit (`post_card::fitting_reactions`, from the card's width); list and gallery layouts; - a click on a pill toggles the user's own reaction on the starter (`ForumAction::ToggleReaction { post, emoji }`), shown at once and undone if the request fails, exactly like the default-reaction button; disabled on locked or archived posts; - hidden when "Show emoji reactions on messages" is off; emoji images are requested through `forum::wanted` like the pills under messages (still frames). ## The original `ForumPostCard.tsx` shows only the forum's **default reaction** (`DefaultReactionButton`: the emoji, its count, a toggle). It does not show the starter's other reactions, so this is an **addition beyond parity**, as the issue anticipated: Charles to decide. Parity table row added as such. ## Cause / data path Nothing was missing in the data: the starter of each post already arrives with its reactions in `POST /channels/{forum}/post-data` (active posts on screen, batched 100 per call) and in the thread search's `first_messages` (archived pages and searches). The real API builds both with the same message response builder as normal message lists (`ThreadMessageResponses.getFirstMessages`), and the original reads `reactions` from them for its default button. `Forums::first_messages` already applied `MESSAGE_REACTION_ADD/_ADD_MANY/_REMOVE/_REMOVE_ALL/_REMOVE_EMOJI` for the starter (message id = thread id). No new request per post. The card model simply did not expose anything beyond the default reaction. ## Verification - core (`chat_forums.rs`): `card_shows_starter_reactions_from_post_data_and_search` (post data and search first_messages, default excluded, archived shown but not clickable), `card_reactions_without_default_reaction_show_every_reaction`, `card_reactions_follow_reaction_events_on_the_starter` (all five reaction events; a reply's reactions ignored), `card_reaction_pill_toggles_the_users_reaction_on_the_starter` (request on the starter, echo not double-counted, failure reverts, locked disabled). - devserver (`channel_types.rs`): `post_starters_carry_their_reactions`: a reaction PUT on a starter is returned by post-data and by the thread search. - UI headless (`forum_card_reactions.rs`): pills on one line above the footer and 👍 only once; a click on a pill publishes `ReactWith` and updates the card; "+N" chip on one line in list and gallery cards; locked post's pills don't toggle; hidden with reactions off. `forum.rs`: `card_reaction_pills_fit_one_line`. - goldens (rendered on lavapipe in `fluxer-native-shots:u2204`): `forum_list_reactions`, `forum_gallery_reactions`. Existing forum and message-reaction goldens unchanged. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: all steps passed. Note: the footer's default-reaction button remains the original's smaller pill; the new pills are the message-sized ones, so the two differ slightly in size. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A forum or media card now shows the reactions of its post's starter message
other than the forum's default reaction (which keeps its footer button), as
the message's reaction pills (reactions::pill_button, without the tooltip) on
one line above the footer, "+N" for those that do not fit, in both layouts.
A click toggles the user's reaction on the starter through the new
ForumAction::ToggleReaction, optimistic and undone on failure, not on locked
or archived posts. Hidden with "Show emoji reactions on messages" off.

The data was already there: post data and the thread search's first_messages
carry the starter with its reactions, and the MESSAGE_REACTION_* events of
the starter already update Forums::first_messages. No new request.

The original's ForumPostCard shows only the forum's default reaction; this is
an addition beyond parity, as the issue asked.

Refs #620

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged into textchat by hand (the merge API returns 405); the commits are in the branch.

Merged into `textchat` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-15 18:00:22 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.