Text chat 28: GIF picker (#278) #441
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-28-ui-gif-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: textchat-27-ui-expression-picker
What
The GIFs tab of the expression picker (
crates/fluxer-ui/src/screens/main/expressions/gifs.rs), spec §3.4 GIF part / §9.5:columns(w) = floor((w+8)/208)clamped 2..=8, 8 px gaps, each tile into the shortest lane; category tiles at 200 × 96.max(columns × 3, 12)tiles) once the store's 800 ms skeleton timer fired.ToggleFavoriteGif.tinywebpproxy variant (falling back to another still-picture format), requested only for tiles in view and added to the animated list, so they play while visible.PickGif { shift }; Shift keeps the picker open. Showing the tab emitsOpenGifView(Default)(which fetches featured once per session). Ctrl+G toggles the tab.Tests
crates/fluxer-ui/tests/gif_picker.rs:columns_formula,masonry_places_shortest_column,views_and_back,pick_emits_with_shift,star_toggles_favorite,skeleton_after_800ms, pluspreviews_are_the_tiny_webp_of_visible_tiles. They were written first and failed to compile against the base before the module existed.gif_picker_categoriesandgif_picker_results(stand-in gradients for the previews).FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally. One earlier run hit the known teardown SIGSEGV of thefluxerlib tests (#304); a rerun passed.Deviations / outside the Files list
app.rs(Ctrl+G),screens/main/mod.rs(the composer's GIF button emitsOpenGifView(Default)),screens/main/media.rs(one line adding the GIF previews to the animated list),theme/icons.rsand two Phosphor SVGs (trend-up-regular,arrow-left-regular), the crate README anddocs/screenshots/README.md(the suite test requires the latter).proxy_srcis a picture, becauseGifRefkeeps no media variants.Closes #278
🤖 Generated with Claude Code
The GIFs tab of the expression picker: the default view (Favorites, Trending GIFs, featured category tiles), trending, favourites and category views with a back button, search ("Search {provider}") with suggestions, a masonry of 200 px lanes (columns floor((w+8)/208) in 2..=8, 8 px gaps, shortest lane first), the skeleton grid once the store's 800 ms timer fires, the hover star toggling a favourite, the tiny animated WebP previews of the tiles in view playing, and Ctrl+G. Refs #278 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Independent review: Text chat 28, GIF picker
Scope:
git diff 31e58b34..origin/textchat-28-ui-gif-picker(280ab0b).Plan tests: all six named tests are in
crates/fluxer-ui/tests/gif_picker.rs(columns_formula,masonry_places_shortest_column,views_and_back,pick_emits_with_shift,star_toggles_favorite,skeleton_after_800ms), plus a previews test. They check the spec §3.4 values:floor((w+8)/208)clamped to 2..=8, 8 px gaps, shortest lane first, a skeleton timer of exactly 800 ms, Shift keeps the picker open and inserts, and "Search Klipy". Both goldens (gif_picker_categories,gif_picker_results) are present and listed indocs/screenshots/README.md.Interfaces: the default view (Favorites, Trending, categories), the trending, favourites and category views, search with suggestions, the masonry, the skeleton, the star, the
tinywebppreviews that play only while visible, and Ctrl+G are all present. The picker uses the store's existingUserAction::{OpenGifView, GifSearch, PickGif, ToggleFavoriteGif}and thegif_pickerselector unchanged. Picking a favourite by its URL matchespick_gifin fluxer-core, which looks favourites up by URL.Invariants: no fluxer-core, proto or fixture changes. fluxer-ui gets no new I/O path: images go through
media.images(the sanctioned ImageLoader). No secrets, signed URLs or file paths. Server data cannot cause a panic: NaN and zero widths, zero sizes and unparsable URLs are all handled.Findings
gifs::bodyreturnsNoResultswhen the query is not empty, the store is not loading and the results are empty. During the 350–1000 ms search debounce, a typed query therefore briefly shows "No search results" before the request goes out. The implementer reported this. Fixing it needs a pending flag from the store, so it belongs in a follow-up issue.masonrysizes each tile from the server'swidth/heightwith no bound. A GIF with an extreme aspect ratio (for example 1×100000) gives one very tall tile. It does not panic, but the lane is unusable. A clamp, as the original's grid applies, would fix it.Local gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a clean review worktree: all steps passed (exit 0, including the screenshot tests).Verdict: approve. No blocking findings and CI is green locally.