feat(ui): quick-reaction hover bar on messages (LC-302) #329
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-302-quick-reaction-bar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Hovering a message shows a small row of one-tap reaction buttons (your most-used emojis) so you can react without opening the picker.
Changes
server/templates/room/message.html:data-lc-quick-react="{id}"on the non-system message row + arole="group"[data-lc-quick-bar]span prepended to the hover toolbar (hidden until filled, with a divider).server/templates/layout.html: extend the LC-288 recent-emoji IIFE withfillQuick(row)+ a delegatedmouseoveron[data-lc-quick-react]. Lazily fills the bar (idempotent) from the device-local MRU (read()) or a default set of five (👍 ❤ 😂 🎉 😮), building the SAMEhx-postbuttons the picker emits (/messages/{id}/reactions/{glyph}->#reactions-{id}), so the existing recorder records quick-react clicks too.htmx.processwires them up.server/locales/{en,es}/room.ftl:room-quick-react-aria.server/tests/fixtures/lc77_*: regenerated for the additive message-row markup (verified diff is exactly the new attribute + empty quick-bar span).No server, route, or DB change: reuses the existing toggle endpoint. The MRU lives only in
localStorage, so the per-viewer set is built client-side (same reason as the LC-288 recent row).Testing
just check,just fmt,just test,just test-saasall pass.Not operator-visible (no env/config/contract change).
Hovering a message now shows a small row of one-tap reaction buttons in the hover toolbar, so you can react without opening the picker. The bar is filled client-side from the LC-288 device-local recent-emoji MRU (or a default set of five common emojis when you have no history), extending the existing recent-emoji IIFE in layout.html. Each button is the same hx-post the picker emits (POST /messages/{id}/reactions/{glyph} -> #reactions-{id}), so the existing recorder also records quick-react clicks and the MRU self-tunes. The bar fills lazily on first row hover (idempotent), keeping large rooms from processing every message on load. No server, route, or DB change: it reuses the existing toggle endpoint. System messages get no bar; follow-up messages do. The group carries a localized accessible name (en/es). The LC-77 render fixtures were regenerated for the additive message-row markup (new data-lc-quick-react attribute + empty quick-bar span). #LC-302 #LC-303 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>