Skip to content

Gallery (sc-9560): search, zoom and New badges, every one an option with a quiet default - #298

Open
ndbroadbent wants to merge 4 commits into
mainfrom
gallery-search-zoom-new
Open

ndbroadbent wants to merge 4 commits into
mainfrom
gallery-search-zoom-new

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

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 (default 40): a search box over the grid once the gallery has that many screens; true always, false never, 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 (default true): 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 (default false): true = 30 days, or a number of days. The renderers write a hidden badge and data-vg-since (the screen's newest manifest since); 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 text keys: search, empty, new. Screens gain since in the model. With the defaults, every existing fixture's gallery.html is unchanged (only model.json gains the new fields).

Contract: SPEC.md (options, Text, validation order … text, search, zoom, newBadges, model, markup, new Search / Zoom / New badges sections), a new extras fixture, nine option-error cases, and search: true on 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 extras page: 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.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…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.
@visualci-com

visualci-com Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/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

Snapshot What changed Close-up: before → after
screenshots/changelog/1440-dark (changed)
before · after

Content below here moved
screenshots/changelog/1440-light (changed)
before · after

Content below here moved
screenshots/changelog/390-dark (changed)
before · after

Content below here moved
screenshots/changelog/390-light (changed)
before · after

Content below here moved
and 2 more in the build

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

Snapshot What changed Close-up: before → after
journeys/delete-a-project/danger-zone (added)
image
–
journeys/delete-a-project/danger-zone-dark (added)
image
–
journeys/delete-a-project/deleted (added)
image
–
journeys/delete-a-project/dialog (added)
image
–
and 49 more in the build

Removed: journeys/delete-a-project/01-site, journeys/delete-a-project/02-danger-zone, journeys/delete-a-project/03-danger-zone-dark, journeys/delete-a-project/04-dialog, journeys/delete-a-project/05-dialog-dark, journeys/delete-a-project/06-deleted, journeys/delete-a-project/07-project-404, journeys/delete-a-project/08-pickable-again, journeys/mcp-client-connects-with-oauth/01-sign-in, journeys/mcp-client-connects-with-oauth/02-consent, journeys/open-app-stays-in-the-app/01-site, journeys/open-app-stays-in-the-app/02-site-signed-in, journeys/open-app-stays-in-the-app/03-app, journeys/organization-settings/01-site, journeys/organization-settings/02-admin, journeys/organization-settings/03-admin-invited, journeys/organization-settings/04-admin-dark, journeys/organization-settings/05-site, journeys/organization-settings/06-member, journeys/organization-settings/07-member-dark, and 33 more

Updated as builds change. Agents can review with VisualCI's MCP tools.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant