Text chat 27: Expression picker: emoji, stickers, saved media (#277) #415
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-27-ui-expression-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?
Stacked on: origin/textchat-25-ui-composer (already merged into
textchatat220acce; the branch merge only brought its later merge commit, resolved totextchat's side, so the base tree equalsorigin/textchat).What this builds
Text chat 27, the expression picker (spec §3.4, §9.5), in
crates/fluxer-ui/src/screens/main/expressions/:mod.rs: the popout (ExpressionPickerPopout.{tsx,module.css}): 592 x 690 by default, min 360 x 360, resizable from its top and left edges (it is anchored at its bottom right,top-endabove the button withoffsetCrossAxis: 16), width snapped byclampResizablePaneDimension(64 + n x 48), kept inside the window with 16 px padding. Tabs GIFs / Media / Stickers / Emojis (GIFs only when the instance has a GIF provider; emoji only for a reaction target), default tab Emojis and remembered between openings.State::toggleis the composer buttons' toggle (handleExpressionPickerTabToggle),Message::Shortcutis Ctrl+E / Ctrl+S,Message::Open { target, anchor }is for Text chat 29's "Add Reaction". Picks emitPickEmoji { target, emoji, keep_open },PickSticker,PickMeme; Shift (tracked fromModifiersChanged) keeps it open. Premium banner ("Unlock N custom emojis from M communities with Plutonium.") when the instance offers premium, nothing is searched and emoji are hidden.emoji_grid.rs: search ("Find the emoji of your dreams", the hovered emoji's names as placeholder), the virtualised grid (EmojiPickerConstants.ts,PickerRowLayout.ts: 48 px cells,columns = max(5, floor(w/48)), 32+8 px headers, 12 px section gap; only the rows in view are built), the 2.875 rem category rail with guild icons and the category icons, the 3 rem inspector, the empty state.stickers.rs: 120 px tracks with 8 px gaps (4 per row at the default size), sections fromselectors::sticker_picker, search on name / description / tags, rail, inspector, empty states.memes.rs: saved media header (search, All / Images / Videos / Audio / GIFs pills,filterMemesByContentType) and masonry (computeMasonryColumns: 200 px lanes, 8 px gaps, shortest lane).skin_tone.rs: the 24 px clap button and the six-tone column (current first),SetSkinTone.assets/icons/README.mdsays): leaf, bowl-food, game-controller, bicycle, magnet, heart, flag (fill), smiley-sad (duotone), image, music-note.Wiring outside the Files list, kept minimal:
composer/mod.rs(Text chat 25's): the GIFs / Media / Stickers / Emojis buttons report their bounds (Message::OpenExpressions), are drawn selected while their tab shows (State::expression_button), andState::expect_store_changelets an emoji picked into the composer reach the text box.main/media.rs:wantedaddsexpressions::wanted(only the cells in view).app.rs:Local::expressions; Ctrl+E / Ctrl+S andModifiersChanged; Escape closes the picker; the rail's scroll (take_scroll) and the search field's focus (take_focus) become iced tasks; switching channels closes it.Tests
crates/fluxer-ui/tests/expression_picker.rs:tabs_and_default_tab,grid_columns_from_width,rail_jumps_to_section,search_filters,pick_emits_with_target_and_keep_open,locked_banner_counts,resize_snaps_48,only_visible_cells_request_images(first written and seen failing, then passing). Unit tests for the masonry and the skin tone order.emoji_picker,emoji_picker_search,sticker_picker(goldens rendered on lavapipe in thefluxer-native-shots:u2204image, asdocs/screenshots/README.mddescribes; they also pass on this machine's GPU). No Electron side-by-side was captured: dimensions come fromExpressionPickerPopout.module.css,EmojiPicker.module.css,EmojiPickerConstants.ts,StickerPickerConstants.ts,PickerSearchInput.module.css,MemesPicker.module.css.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally.Deviations (follow-up #414)
fluxer-corelocal setting).gifs.rs; Ctrl+G is its).Claude Opus 5.5(the session's attribution line) rather thanCLAUDE.md'sClaude Fable 5.2; it is already pushed and force-push is not allowed.Closes #277
🤖 Generated with Claude Code
Independent review: Text chat 27 (expression picker)
Scope:
git diff c0eada8..origin/textchat-27-ui-expression-picker(ec1efe7). I read it without relying on the implementer's notes.Checks
tests/expression_picker.rs(tabs_and_default_tab,grid_columns_from_width,rail_jumps_to_section,search_filters,pick_emits_with_target_and_keep_open,locked_banner_counts,resize_snaps_48,only_visible_cells_request_images). They use the spec §3.4 values: 592 × 690, min 360, a 48 px snap (64 + n·48), 48 px cells, at least 5 columns with 9 by default, 4 sticker tracks of 120 px at the default width, the "Find the emoji of your dreams" placeholder, tab order GIFs/Media/Stickers/Emojis with Emojis as the default, a reaction target showing the emoji tab only, and Shift keeping the picker open. The screenshotsemoji_picker,emoji_picker_searchandsticker_pickerexist and pass.screens::main::expressionshasState,Tab,Message::{Open{target,anchor}, Shortcut, …},update -> Vec<UserAction>,wanted,over, and the emoji_grid/stickers/memes/skin_tone modules. It emitsPickEmoji{target,emoji,keep_open},PickSticker,PickMemeandSetSkinToneagainst Task 14's core API. Task 28 can addgifs.rsand Ctrl+G, becauseTab::GifsandMessage::Shortcutare already in place. Task 29 hasMessage::OpenwithPickTarget::Reaction.media::wantedand theImageLoader. No new fixtures. Every index into the model is derived from that same model, the masonry guards against zero or unknown sizes, and the resize handles NaN and infinite values. I found no secrets, file paths or signed URLs.SetSkinTone.)FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a fresh review worktree: green ("all steps passed"; 8/8 picker tests and the 3 new goldens pass).Findings (none blocking)
emoji_grid::wantedasks only for the button's clap (clap(tone)). Whenskin_tones_open, the five other tones (skin_tone::options_view) are never requested, so they fall back to system glyphs. Addoptions(tone)towantedwhile the choices are open.text_inputcaptures Escape to unfocus itself. The first Escape therefore only blurs the field, andWindowEvent::Escape(which needsfree) closes the picker on the second press. The original closes on the first.Pick(section, item)and the hover are(section, item)indices resolved against a model recomputed at click time. If the store changes between the frame and the click (a Shift-pick adds "Frequently used" or reorders it, or aGUILD_EMOJIS_UPDATEarrives), the hover and the next pick can land on another cell. Addressing the cell by itsEmojiRef(or by key) would make it exact.emoji_picker()runs several times per frame. It runs inpopout, again insearch_barwhile a cell is hovered, inwanted(on every media pass) and on every Pick or Jump. That is about 3700 candidates each time. The tests pass, but a small cache keyed by (query, channel, store revision) inStatewould remove it. Not blocking.ResizeMoveclamps against an unbounded window, sostate.sizecan grow past the window while only the view clamps it. The next drag then starts from the oversized size and seems stuck until the pointer covers the excess. Also, the origin is taken at the first move rather than at the press. Releasing outside the window leaves the overlay in resize mode until the next release.Claude Opus 5.5, but CLAUDE.md asks forClaude Fable 5.2. Force-push is denied, so it is noted only.The virtualisation in
emoji_grid::view(spacers above and below the visibleLayout::visiblerange, rows built only in view) and the resize overlay are correct for what they claim, and the tests cover both.Verdict: approve (no blocking findings, local CI green).
Independent review: Text chat 27 (expression picker)
I reviewed
67da1c7..origin/textchat-27-ui-expression-picker(ec1efe7plus the merge5874c94).Tests (plan step): all 8 named tests are in
crates/fluxer-ui/tests/expression_picker.rsand check the spec §3.4 values: 592 × 690, min 360, a 48 px snap, ≥5 columns (9 by default), 4 stickers per row on 120 px tracks, the placeholder "Find the emoji of your dreams", the tab order GIFs/Media/Stickers/Emojis, Shift keeps the picker open, and only the visible cells request images. The screenshotsemoji_picker,emoji_picker_searchandsticker_pickerhave goldens and pass.Interfaces:
expressions::{State, Tab, Message::Open { target, anchor }, Message::Shortcut, update, wanted, over}exist for Text chat 28 and 29 to use. The picker is opened from the composer buttons and by Ctrl+E/Ctrl+S, and picks areUserAction::{PickEmoji, PickSticker, PickMeme, SetSkinTone}.Invariants: the diff touches only
fluxer-uiand docs. fluxer-core and fluxer-emoji are unchanged, there are no new dependencies and no new fixtures. The picker adds no I/O: images go only throughmedia::wanted→ ImageLoader. Picks by index are bounds-checked (get), and masonry and column math guard zero or unknown sizes. There are no secrets, URLs or paths in the diff.Findings
wanted; Escape takes two presses; picks are addressed by(section, item)index, so an emoji update between the frame and the click could pick a neighbouring cell;emoji_picker()is recomputed several times per frame;ResizeMoveclamps to an unbounded window, and only the view clamps.ec1efe7says Claude Opus 5.5, not the Claude Fable 5.2 that CLAUDE.md asks for. Fixing it would need a force-push, so I left it.Local gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a fresh review worktree: all steps passed (exit 0). livekit-interop was skipped as configured.Verdict: APPROVED (no blocking findings, ci green locally).