Skip to content

test(visual): improve screenshot test-runner and regenerate baselines#49

Merged
FL-AntoineDurand merged 7 commits intomainfrom
refactor/oklch-color-system
Feb 3, 2026
Merged

test(visual): improve screenshot test-runner and regenerate baselines#49
FL-AntoineDurand merged 7 commits intomainfrom
refactor/oklch-color-system

Conversation

@FL-AntoineDurand
Copy link
Contributor

Summary

  • Overhauled all 11 .storybook/test-runner.js configs for robust visual regression testing:
    • Custom waitUntilReady() replaces waitForPageReady() (avoids networkidle timeout on external resources)
    • preVisit hook blocks pravatar.cc requests that caused flaky context destruction
    • Radix Dialog.Portal detection — screenshots dialog content rendered outside #storybook-root
    • Bounding box size check — falls back to full-page screenshot for clipped/tiny roots
    • Absolute paths for snapshot directories (no longer depends on CWD)
  • Fixed style issues: dark-on-dark avatar (users.tsx), palette filter (palette.stories.tsx), SVG imports (background.stories.tsx)
  • Fixed clipping: Added padding decorators to liveSpace, wrapper, resource-selection, reduced-cell stories
  • Removed unused test-runner-visual.config.ts
  • Regenerated 155 screenshot baselines across 9 packages (up from ~90)

Test plan

  • All 11 test-runner.js files verified identical
  • Lint passes (nx run ui-base:lint, ui-views:lint, jupyter:lint)
  • Typecheck passes (nx run ui-base:typecheck)
  • Pre-commit hooks pass (eslint + prettier)
  • Visual spot-check: login form, palette, liveSpace, avatars, chat anchors all render correctly
  • Verify screenshots match in CI by running npx @storybook/test-runner per package

🤖 Generated with Claude Code

FL-AntoineDurand and others added 7 commits February 1, 2026 22:22
… system

Replaces organically-accumulated CSS color tokens with a mathematically-derived
palette using OKLCH perceptual color space. Introduces 3-layer architecture:
primitives (76 tokens), semantic tokens (24), and domain tokens (~45) scoped
to their owning packages. Removes Tailwind, adds stylelint enforcement.

Also fixes pre-existing no-unused-expressions lint errors in staged files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… packages

Adds jest-image-snapshot test-runner config to all 11 Storybook packages.
Generates 90 reference screenshots across ui-base (40), ui-views (26),
chats (5), jupyter (9), socials (4), whiteboard (3), user-containers (2),
and tabs (1). Updates @swc/core to fix es2023 target compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Overhaul all 11 test-runner.js configs to fix flaky screenshots:
- Replace waitForPageReady (networkidle) with custom wait (DOM+fonts+settle)
- Block pravatar.cc requests in preVisit to prevent context destruction
- Add Radix Dialog.Portal detection for portal-rendered components
- Add bounding box check to fall back to full-page for clipped roots
- Use absolute paths for snapshot directories
- Fix dark-on-dark avatar (use surface token), palette filter, SVG imports
- Add padding decorators for clipped components (liveSpace, wrapper, etc.)
- Remove unused test-runner-visual.config.ts
- Regenerate 155 screenshot baselines across 9 packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…nflict

The lockfile was regenerated during an earlier commit which lost npm's
peer dependency resolution metadata, causing stylelint-config-standard-scss
to fail resolving against stylelint@17 in CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
npm ci now fails on GitHub Actions due to stricter peer dependency
resolution for stylelint-config-standard-scss@14 (requires stylelint ^16)
vs stylelint@17. This was previously resolved silently but recent npm
behavior changes made it a hard error. legacy-peer-deps restores the
previous behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… job

build-storybook needs @holistix-forge/ui-base/style and other library
exports to be built first. The validate job builds them but runs on a
separate runner.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When screenshot tests detect differences:
- Collects list of failed packages and changed screenshot files
- Uploads __diff_output__ artifacts (was only on failure, now on diff)
- Posts/updates a PR comment listing affected packages and files
- Links to the artifact download for reviewing diffs
- Includes instructions for updating baselines

The job still passes (non-blocking) but gives visibility into visual changes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

📸 Visual Regression Detected

The following packages have screenshot differences:

  • ui-base
  • ui-views
  • airtable
  • chats
  • excalidraw
  • jupyter
  • notion
  • socials
  • tabs
  • user-containers
  • whiteboard
Changed screenshots

Download visual-diffs artifact to review the differences.

If these changes are intentional, update the baselines locally:

npx nx run <package>:test-storybook -- -u

@FL-AntoineDurand FL-AntoineDurand merged commit b192662 into main Feb 3, 2026
6 checks passed
@FL-AntoineDurand FL-AntoineDurand deleted the refactor/oklch-color-system branch February 3, 2026 09:29
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