Repository navigation
Gallery (sc-9560): search, zoom and New badges, every one an option with a quiet default - #298
ndbroadbent wants to merge 4 commits into
Conversation
…the contract search (default 40: the grid's box shows once it has that many screens), zoom (default on, gestures and keys only) and newBadges (default off; decided in the reader's browser from the screen's newest since). Three new text keys: search, empty, new. Screens gain since in the model.
…nd Hugo, and the docs Every renderer matches the contract's extras fixture and the new option errors. The options guide gains Search, Zoom and New badges sections and the three text keys; the language guides list the options.
VisualCIdocspring/visualci · build #1407 · 6 changed, 572 unchanged · waiting for review This PR vs base: 6 changed since #1394, across 1 build · 6 not approved yet
docspring/visualci · journeys · build #1403 · 53 added, 53 removed · waiting for review This PR vs base: 53 added, 53 removed since #1391, across 1 build · 106 not approved yet
Removed: Updated as builds change. Agents can review with VisualCI's MCP tools. |
sc-9560. Three gallery options, each behind an option with a quiet default, as Nathan asked ("everything configurable in options ... i'd disable the New badge on our own galleries"):
search(default40): a search box over the grid once the gallery has that many screens;truealways,falsenever, the strip never. It filters cards by title and caption across tabs (case and accents ignored), hides tabs with no match, shows an empty state, and previous/next step only through matches.zoom(defaulttrue): in the full-size view, ctrl/cmd-wheel and trackpad pinch, two-finger pinch on touch, double-click, and+-0. No buttons. The image grows in the layout so the view's own scrolling pans it (a mouse drags it); the point under the pointer stays put; a new screen starts unzoomed.data-vg-zoom="off"when false.newBadges(defaultfalse):true= 30 days, or a number of days. The renderers write a hidden badge anddata-vg-since(the screen's newest manifestsince);hydrate()shows it in the reader's browser, so a page built long ago never calls old screens new, and the goldens stay byte-exact.Three new
textkeys:search,empty,new. Screens gainsincein the model. With the defaults, every existing fixture'sgallery.htmlis unchanged (onlymodel.jsongains the new fields).Contract: SPEC.md (options, Text, validation order
… text, search, zoom, newBadges, model, markup, new Search / Zoom / New badges sections), a newextrasfixture, nine option-error cases, andsearch: trueon strip-themes (proving the strip never gets one). Ported to Ruby (new_badges), Python, Rust (search/search_from,zoom,new_badges/new_badges_days) and the Hugo module. Docs: options guide sections and the language guides.Checked: JS 186 tests, Ruby 87 runs, Python OK, Rust (tests, clippy, fmt), Hugo 112 checks on 0.171 and 0.146. A real Chromium run of the
extraspage: badge shown only inside its window, search hides the tab with no match and switches to the one with it, the empty state shows, ctrl-wheel zoom keeps the point under the pointer (scrollLeft matched the expected value), double-click resets.Not done: the story's "optional link to the change in VisualCI" for a New badge — the manifest has no build or snapshot link to point at; that needs a manifest field first.
The version bump to 0.5.0 lands in this PR after #291 and its ports PR (0.4.1) are on main, then the tags. visualci.com pins visualci-gallery 0.2.1, so the site's /screenshots/ page doesn't change here.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.