Skip to content

v6: Add Lost Pixel for Storybook visual regression#4256

Closed
trevor-scheer wants to merge 1 commit into
graphiql-6from
trevor/lost-pixel-vr
Closed

v6: Add Lost Pixel for Storybook visual regression#4256
trevor-scheer wants to merge 1 commit into
graphiql-6from
trevor/lost-pixel-vr

Conversation

@trevor-scheer

Copy link
Copy Markdown
Contributor

Summary

A visual-regression gate for the v6 component restyles. Every Storybook story produces a PNG, baselines live in the repo, and CI fails on unintended pixel diffs.

  • lost-pixel as a dev dep in @graphiql/react.
  • Baselines under .lostpixel/baseline/. One so far: the spinner.
  • New .github/workflows/visual-regression.yml runs the diff on each PR to graphiql-6.

Threshold is 0.1% — at 1% a full-component color swap on the spinner only shifted 0.33% of pixels, under threshold.

Committed PNG baselines will accumulate as the matrix grows; we'll decide before GA whether to keep this, swap to Chromatic, or drop it.

Run locally

yarn workspace @graphiql/react test:vr          # diff vs. baseline
yarn workspace @graphiql/react test:vr:update   # refresh baseline

Refs: #4219

@changeset-bot

changeset-bot Bot commented May 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 11852f9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

The latest changes of this PR are not available as canary, since there are no linked changesets for this PR.

@trevor-scheer
trevor-scheer force-pushed the trevor/lost-pixel-vr branch from ceebc4c to d4bf0f5 Compare May 13, 2026 14:48
Lost Pixel screenshots every Storybook story, compares against
committed baselines, and fails CI on unintended pixel diffs.
Lives in `@graphiql/react` since that's our only package with
UI stories.

Threshold is 0.1% rather than the more common 1% — components
like the spinner are small enough that 1% misses obvious changes.

Local: `yarn workspace @graphiql/react test:vr` to check,
`test:vr:update` to refresh after intentional changes.
@trevor-scheer
trevor-scheer force-pushed the trevor/lost-pixel-vr branch from d4bf0f5 to 11852f9 Compare May 13, 2026 14:57
@trevor-scheer
trevor-scheer deleted the trevor/lost-pixel-vr branch May 15, 2026 04:02
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