[NO-ISSUE] test(storybook): cover light theme, tablet and mobile in the visual matrix#756
Open
robsongajunior wants to merge 4 commits into
Open
[NO-ISSUE] test(storybook): cover light theme, tablet and mobile in the visual matrix#756robsongajunior wants to merge 4 commits into
robsongajunior wants to merge 4 commits into
Conversation
…mobile visual modes
robsongajunior
marked this pull request as draft
July 17, 2026 15:12
robsongajunior
marked this pull request as ready for review
July 17, 2026 17:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The visual regression layer screenshotted every story exactly once — dark theme at 1280×720 — so light mode, tablet, and mobile were never tested, even though light tokens have full parity and the responsive spacing/typography tokens reshape nearly every story below
md.Every story is now snapshotted in a 6-mode matrix:
dark|light × desktop(1280×720)|tablet(768×1024)|mobile(375×667), aligned to the theme's token breakpoints. The Storybook toolbar gets the same DS viewports..storybook/visual-modes.js(new): single source of truth — viewports, theme classes, mode matrix, snapshot naming,resolveModes(per-story narrowing +VISUAL_MODESenv filter). Feeds both the test-runner andpreview.js(toolbar viewports + theme decorator classes).test-runner.js: per-story mode loop (resize → theme class flip → double-rAF settle → fonts/images settled → screenshot). Failures are collected per mode so one run writes every failing diff. The freeze style now also mirrorspreview.css's canvas-transition selectors (they outrank*in specificity — a theme flip would otherwise animate 0.4s mid-screenshot). New: explicit image-settle await (load/error +decode()) —networkidlealone let the remote avatar photo flake both ways.--<mode>suffixes. Verified locally: full matrix = 1,890 snapshots, stable across back-to-back runs (0 diffs, ~2 min).parameters.visual: falseunchanged; newvisual: { modes: [...] }narrows the matrix (used only by the 3 foundation token galleries, whose mobile reflow approaches Chromium's 16384px capture ceiling — both themes still covered at desktop).visualjob is sharded ×4 (mirrors the Vitest job) viaVISUAL_SHARD; per-shard diff artifacts. Baseline-regen workflow: timeout 60m + optionalmodesinput for partial regeneration.testTimeout: 30000in the jest layer (default 5s was sized for one screenshot).ResponsiveCollapsednow uses the DSmobileviewport (the oldmobile1preset no longer exists) — its mobile snapshot finally captures the collapsed ellipsis state.docs/OVERVIEW_TESTS.mdLayer-2 sections updated (matrix, naming, determinism table, sharding, correct workflow filename).Notes
visualjob is expected red on this PR until the Linux baselines land: next step is dispatchingapp-storybook-generate-baseline.ymlon this branch (update_baselines=true), then committing the ~1,573 new PNGs here (existing 317 must show zero modifications — that's the compat invariant).packages/**changes (testtype, no bump).storybook:test:visual:update:baselinescript now dispatches against the current branch instead of the deletedtest/webkit.