feat(reactions): frequency-ranked one-tap quick-react bar (LC-477) #482
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/LC-477-frequent-reactions"
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?
LC-477 - One-tap re-react + frequently-used emoji in reaction bar
Surfaces the caller's most-used emoji in the one-tap quick-react bar so reacting reflects real habits, cross-device and frequency-ranked, not just this device's recency.
Context
LC-302 already gives a hover quick-react bar, but it seeds only from device-local MRU (localStorage) with a hardcoded default fallback. This change adds a server-side frequency source so the bar is accurate on a fresh device and ranks by how often a glyph is actually used.
Changes
db::chat::top_reaction_emojis(user_id, limit)- a single grouped query overmessage_reactions, most-frequent first (ties break toward most-recent), Unicode-only. Custom:shortcode:reactions are excluded, matching the existing LC-288/LC-302 quick-react/recents posture (enclave-scoped, not reusable across rooms).GET /api/reactions/frequent- auth'd, returns the caller's most-used glyphs as a JSON array. No room scope (it is the caller's own aggregate across every room they have reacted in).layout.html): merges server frequents then device MRU then defaults (deduped, custom shortcodes skipped, capped at the existing QCAP=5). The bar fetches frequents once on load and rebuilds idempotently keyed on a signature, so frequents apply after the async fetch (and after a react updates the MRU) without duplicating buttons or freezing the first computed set.Tests
db_reactions::test_top_reaction_emojis_ranks_by_frequency_unicode_onlyasserts frequency ordering, custom:shortcode:exclusion, per-user isolation, andlimitcapping.just check,just test, andjust test-saasall pass.Not operator-visible: no new env var, config, or integration contract change.
🤖 Generated with Claude Code