feat(reactions): full categorized, searchable emoji picker (LC-389) #400
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-389-full-emoji-picker"
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?
Implements LC-389. The reaction emoji picker offered only a hardcoded six glyphs (👍 🖤 😂 🎉 😮 😢) under the search box. This expands it to the full, browsable Unicode set.
What changed
reactions::get_pickernow renders the completeemojis-crate set grouped into the eight standard categories (Smileys & Emotion, People & Body, Animals & Nature, Food & Drink, Travel & Places, Activities, Objects, Symbols, Flags), each as a labeled section, in Unicode order. The room's enclave custom emojis follow as a Custom section. DMs / non-enclave rooms get the Unicode set with no Custom section.Why it needed almost no JS
The data was already on hand: the
emojiscrate is an existing dependency and the:-shortcode composer autocomplete already iterates the full set with.name()/.shortcodes()/.group(). Every react button keeps the exact LC-384 markup (data-lc-emoji-namefilter hook + thehx-post/hx-target/hx-swapthe recorder and close-on-react handlers key on), so the LC-274 filter, the LC-288 recent recorder, and the react/close flow all work without modification. The only new JS is the tab-scroll handler and the search's section-collapse pass.Architecture note
The grid is server-rendered per open (the buttons are message-specific via the baked
hx-post). At ~1900 cells this is a meaningful but on-demand, gzip-friendly payload, and it keeps the change entirely in the server-rendered-fragment grain with zero new client state. If picker-open latency ever shows up on low-end devices, the follow-up is a message-independent, browser-cached grid fragment with a delegated react handler (sketched in the ticket). Out of scope here: skin-tone variants, and unifying the composer picker (LC-316) onto the same machinery.Testing
just check(fmt + clippy, standalone and saas) clean.just testandjust test-saasboth green (exit 0, zero failures).routes_reactions_authzstill passes: the picker continues to shipdata-lc-emoji-filter,data-lc-emoji-name=, anddata-lc-emoji-recent.just build-cssregenerated (w-72 utility now emitted).No operator-visible change (UI only): no env var, config, or API-contract change, so no
[operator-action]marker.Scope update: this PR now also applies the full categorized set to the composer's emoji button (the unification I had flagged as a follow-up above), per request.
Second commit (
5a931fc):GET /rooms/{id}/emoji-picker) replaces its curated ~48 "popular" glyphs with the full Unicode set in the same eight categories plus the room's custom emojis.(Group, slug, label-key, tab-glyph)table + the name-plus-shortcodes keyword builder) is factored into a sharedcrate::emoji_catalog, so the reaction picker and the composer picker are one source of truth and cannot drift.picker-, now also carriesdata-lc-emoji-tabs/data-lc-emoji-cat), so the LC-274 filter, the LC-389 section-collapse, and the tab-scroll handler all apply with zero new JS. Its buttons keepdata-lc-emoji-insert(cursor splice) rather than anhx-post.EmojiPickerFragmentmoves from a flat list toVec<EmojiCategory>; the Askama template renders the tab strip + labeled sections; panel widened tow-72.The
:shortcode:autocomplete (get_autocomplete) is unchanged.just check,just test, andjust test-saasall green again (the renamedpicker_lists_unicode_and_custom_with_insert_hookstest asserts the categorized contract).Folded in the fix for LC-391 (the "Filter emoji" box appearing to do nothing), found while testing this picker.
Commit
dcbca36:hiddenattribute, but.lc-emoji-cell { display: inline-flex }and.lc-emoji-tabs { display: flex }are author rules that override the UA[hidden] { display: none }regardless of specificity - so filtered-out cells and the hidden tab strip kept showing and the filter looked dead (typing "heart" narrowed nothing). Same class of bug as the LC-385 regression. The<section data-lc-emoji-cat>elements DID hide (default block display), so a matching category showed ALL its emoji rather than just the matches..lc-emoji-cell[hidden], .lc-emoji-tabs[hidden] { display: none }inmain.css. The attribute-qualified selector (0,2,0) beats the bare class (0,1,0); no!important. Sections need no rule. Fixes both the reaction picker and the composer picker, all four themes.just check,just test,just test-saasall green.