Repository navigation
Releases
storybook-addon-vrt@0.4.2
0.4.2
Patch Changes
- Stories that set
parameters.vrt.captureto a selector now capture the matched element instead of failing. The capture hook read the element screenshot as{ base64 }, but Vitest returns the base64 string itself when a screenshot is not saved (save: false), so every such story failed in itsafterEachhook withTypeError: Cannot read properties of undefined (reading 'length'). The hook now uses the returned string, which Vitest 4 and 5 both return.
storybook-addon-vrt@0.4.1
0.4.1
Patch Changes
-
Capturing a story taller than the viewport no longer changes how later stories render generic font families. Chromium captured such a story with
captureBeyondViewport, which reset the generic families Playwright configures (monospace,serif,sans-serif,cursive,fantasyand the default font) to Chromium's own defaults until the page closed. Vitest runs many story files on one page, so a story using those families rendered differently depending on which files happened to share its page. The capture hook now grows the Playwright page to fit the capture target before each screenshot, keeping its orientation, and restores it afterwards (Chromium only). While a screenshot is taken,screen.width/screen.heightanddevice-*media queries report the grown page; the story's own viewport does not change. Screenshots keep their size and content unless a story responds to the screen size; tall stories, and stories that used to run after one on the same page, now render generic families like any other story, so their baselines may need one re-approval. Vitest's own failure screenshots (browser.screenshotFailures, on by default in headless runs and taken on every failed attempt, including retried ones) still capture tall stories beyond the viewport; set it tofalseas in the Setup example. -
Save the exact screenshot whose stability was verified. The capture hook used to confirm that two consecutive screenshots hash identically and then take one more screenshot to write to disk — that extra, unverified frame could land mid-animation and produce a flaky capture. The verified bytes are now written directly (via Vitest's fs command, falling back to a fresh screenshot when unavailable). Also documents that JS-driven animations (Framer Motion etc.) are not stopped by the injected CSS and should be disabled via
contextOptions: { reducedMotion: 'reduce' }.
storybook-addon-vrt@0.4.0
0.4.0
Minor Changes
- Add
svrt comment --id <name>(Action inputcomment-id): namespaces the sticky comment's marker and heading so multiple VRT projects — e.g. several Storybooks in a monorepo — can each keep their own comment on the same pull request without overwriting each other.
storybook-addon-vrt@0.3.0
0.3.0
Minor Changes
- Add
svrt comment: post the VRT result as a GitHub pull request comment — one marker-tagged comment per PR, updated in place. With--report-urlit embeds expected/actual/diff images and links the hostedreport.html; without it it degrades to a text summary pointing at the CI artifact. Ships with a composite GitHub Action (k35o/storybook-addon-vrt@v0) wrappingsvrt run, the comment, and the report artifact upload.
storybook-addon-vrt@0.2.1
0.2.1
Patch Changes
- Switch release automation from changesets/action to pnpm-release-action (pnpm built-in release management). No runtime changes.
storybook-addon-vrt@0.2.0
Minor Changes
-
#8
5a0c2aaThanks @k35o! - Add a search box to the HTML report sidebar that filters the file-grouped screenshot list by file path and story name. Whitespace-separated terms match as a conjunction against the combinedfile/storypath, matches are highlighted, and the field is keyboard accessible (/to focus,Escto clear, arrow keys to navigate). -
#28
09a8c39Thanks @k35o! - Redesign the CLI around a singlesvrt runcommand and add incremental (changed-only) runs. Breaking — see below.svrt runcaptures with Vitest and compares in one step: it spawns Vitest itself (setting the capture env var for you), prepares a clean slate before Vitest starts, then compares. The two-stepVRT=1 vitest run+svrt compareflow is no longer needed (thoughVRT=1 vitest runstill works as an escape hatch).svrt run --changed [ref]captures only the stories a change affects, delegating selection tovitest --changed. A git preflight guards Vitest's silent-green failure on shallow clones: it falls back to a full run (loud) on any git error, or exits 3 with--strict.fullRunTriggers(default['**/.storybook/**']) forces a full run for changes the module graph can't see (Storybook config, global CSS, lockfiles).svrt planpreviews the run decision (full vs incremental, resolved base, changed files, matched triggers) without launching a browser;--jsonfor scripts.- New status vocabulary:
deleted→removed, plusskipped(a story that ran but wasn't captured —vrt.skip, a skipped/failed test) andcarried(not selected by--changed).skipped/carriednever fail a run and carry a machine-readablereason. Fixes a bug where avrt.skipstory with an existing baseline failed a full run asdeleted. svrt compare --partialclassifies unexecuted baselines ascarriedinstead ofremoved.- GitHub Actions output: under
GITHUB_ACTIONS,run/comparewrite a job-summary table and::errorannotations for failing stories. - report.json is now
version: 2with arunblock (mode/ref/escalation), per-itemreason, andsummary.removed/skipped/carried. - New config keys
fullRunTriggersandproject;failOnnow takesremovedinstead ofdeleted. - Exit codes:
runadds3(a--strictguard refusal or a non-zero Vitest exit).