Skip to content

Phase 33 slice B: the gallery, rebuilt to the design - #264

Merged
vicmaster merged 2 commits into
masterfrom
phase-33-slice-b
Nov 24, 2026
Merged

vicmaster merged 2 commits into
masterfrom
phase-33-slice-b

Conversation

@vicmaster

Copy link
Copy Markdown
Owner

Second slice of Phase 33. It rebuilds the project page, the viewer's gallery, to design screen 1 (docs/viewer-redesign/1-gallery-{light,dark}.png).

What changed

  • Cards match the design. Each card is a live thumbnail at the artboard's proportions with its score on the corner. Below it are the name and a meta line: type, size, edit date, and the number of designed states when there are any. The whole card is one link. Empty canvases keep their placeholder and show no score.
  • Scores are measured against the evaluator's bar. The chip is quiet at 96 and above and amber at 95 or below. The old green, amber and red colours at 80 and 60 are gone from the gallery. The header sums it up, for example "17 canvases · 1 below the bar".
  • Search and type tabs. A search field and Web, Mobile and Desktop app tabs, each with its count, filter as you type. Both are kept in the URL (?q=, ?type=), so a reload or a shared link keeps them. When nothing matches, the page says so and offers a Clear button.
  • Live means live. The page used to reload only when the number of canvases changed, so an edited design kept its old thumbnail. It now reloads when any card's content, name, type, genre or designed states change. The comparison mirrors the server-side key in the browser, and a test checks that nothing reloads when nothing changed. A Live status in the header turns to Offline when a poll fails.
  • /api/canvases rows carry each canvas's type and genre. This costs about 2ms per request on 27 canvases.
  • The sidebar counts cards. A state variant folds into its base, as on the page. Before, the sidebar said 19 where the header said 17.
  • The breadcrumb is gone, as the design shows. The workspace name is the sidebar's label.

Fixture store

test/fixtures/viewer-store.ts seeds a temporary store with what the viewer's tests and screenshots need:

  • a copy of the repo's pattern library;
  • a mobile canvas and a desktop-app canvas;
  • a canvas with two designed states;
  • an empty canvas;
  • a canvas with open and resolved comments;
  • canvases scoring exactly 96 and 95;
  • three archived canvases.

It builds the store through the store's own functions rather than shipping JSON, so it follows the canvas format as it changes. test/unit/test-viewer-fixture.ts checks what the store holds, including the two scores, so a scoring change fails there with a clear name instead of breaking a page test.

Tests

  • New: test/browser/test-viewer-gallery.ts, 34 checks. They cover cards, counts, the summary and the meta line; the chips at 100, 96 and 95; search, tabs, Clear and the URL state across a reload; and that an edit, a rename, a genre change, a type change and a new state each reload the page, while nothing reloads when nothing changed. Offline and Live are checked too.
  • New: test/unit/test-viewer-fixture.ts.
  • Rewritten: test-viewer-panels.ts, test-empty-thumbnail.ts, test-variants.ts, test-viewer-surface.ts and the header checks in test-viewer-sidebar.ts. Each finds cards by a data-canvas-id attribute and checks the same behaviour as before: the score chip, the empty placeholder, variants folded into their base (now counted in the meta line), thumbnail sizing, and the page title.
  • Results: the unit tier passes 98/98, the test type-check is clean, and all four viewer browser tests pass.

Verification

An independent verifier found no major issues. Its checks:

  • It rendered the gallery from the fixture store in both themes and found it matches the design.
  • It found the server's and the browser's reload keys identical, including for orphan variants, archived variants, odd names and a missing genre.
  • It found no injection path through names, the search text or the URL.

Its minor findings are fixed in the second commit:

  • Genre and type changes are now tested.
  • The summary stays visible on phones.
  • Tab labels no longer wrap.
  • The card focus ring shows for keyboard focus only.

The docs audit found five README sentences this slice made false; they are corrected in the same commit. The README screenshots are refreshed in slice E, as the spec plans.

Phase 33 slice B. The project page shows real thumbnails with the score on the
corner, quiet at the bar and amber below it, a summary against the bar, a
search field and type tabs kept in the URL, and a Live status. The page now
reloads on any edit, rename, genre or type change and new state, not only when
the canvas count changes. A fixture store seeds what the viewer tests need.
Test that a genre or type change reloads the gallery, keep the summary on phones, keep tab labels on one line, draw the card focus ring for the keyboard only, and correct the README's viewer claims.
@vicmaster
vicmaster merged commit f00383a into master Nov 24, 2026
3 checks passed
@vicmaster
vicmaster deleted the phase-33-slice-b branch November 24, 2026 17:15
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