Skip to content

Releases

storybook-addon-vrt@0.4.2

Choose a tag to compare

@k8o-bot k8o-bot released this 29 Oct 03:00
38c7b45

0.4.2

Patch Changes

  • Stories that set parameters.vrt.capture to 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 its afterEach hook with TypeError: 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

Choose a tag to compare

@k8o-bot k8o-bot released this 29 Oct 02:42
4feb700

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, fantasy and 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.height and device-* 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 to false as 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

Choose a tag to compare

@k8o-bot k8o-bot released this 10 Aug 01:14
9a44958

0.4.0

Minor Changes

  • Add svrt comment --id <name> (Action input comment-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

Choose a tag to compare

@k8o-bot k8o-bot released this 08 Aug 13:17
e147ddd

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-url it embeds expected/actual/diff images and links the hosted report.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) wrapping svrt run, the comment, and the report artifact upload.

storybook-addon-vrt@0.2.1

Choose a tag to compare

@k8o-bot k8o-bot released this 22 Jul 14:53
8ce2546

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

Choose a tag to compare

@k8o-bot k8o-bot released this 05 Jul 13:34
d24d4b1

Minor Changes

  • #8 5a0c2aa Thanks @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 combined file/story path, matches are highlighted, and the field is keyboard accessible (/ to focus, Esc to clear, arrow keys to navigate).

  • #28 09a8c39 Thanks @k35o! - Redesign the CLI around a single svrt run command and add incremental (changed-only) runs. Breaking — see below.

    • svrt run captures 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-step VRT=1 vitest run + svrt compare flow is no longer needed (though VRT=1 vitest run still works as an escape hatch).
    • svrt run --changed [ref] captures only the stories a change affects, delegating selection to vitest --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 plan previews the run decision (full vs incremental, resolved base, changed files, matched triggers) without launching a browser; --json for scripts.
    • New status vocabulary: deleted → removed, plus skipped (a story that ran but wasn't captured — vrt.skip, a skipped/failed test) and carried (not selected by --changed). skipped/carried never fail a run and carry a machine-readable reason. Fixes a bug where a vrt.skip story with an existing baseline failed a full run as deleted.
    • svrt compare --partial classifies unexecuted baselines as carried instead of removed.
    • GitHub Actions output: under GITHUB_ACTIONS, run/compare write a job-summary table and ::error annotations for failing stories.
    • report.json is now version: 2 with a run block (mode/ref/escalation), per-item reason, and summary.removed/skipped/carried.
    • New config keys fullRunTriggers and project; failOn now takes removed instead of deleted.
    • Exit codes: run adds 3 (a --strict guard refusal or a non-zero Vitest exit).