Skip to content

0.109.2 - Storybook test runner: wait for the reduced-motion change event before rendering a story - #125

Merged
jalexw merged 1 commit into
mainfrom
claude/wonderful-tesla-phyya9
Sep 26, 2026
Merged

jalexw merged 1 commit into
mainfrom
claude/wonderful-tesla-phyya9

Conversation

@jalexw

@jalexw jalexw commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Playwright's media emulation flips matchMedia(...).matches at once, but the
query's change event only arrives a few frames later. Framer Motion caches
the preference from that event, so a story that mounted in between saw reduced
motion in CSS and in its play() guard while still animating in JavaScript.
This made Layout/Dashboard Layout › RespectsPrefersReducedMotion flaky
(the wordmark was part-way through its fade when the assertion ran).

preVisit now waits for the change event whenever the emulation actually
changes, before the story renders.

Co-Authored-By: Claude Opus 5.5 [email protected]
Claude-Session: https://claude.ai/code/session_01DYdpBAxKCUbEwPapiBDEmi

…vent before rendering a story

Playwright's media emulation flips `matchMedia(...).matches` at once, but the
query's `change` event only arrives a few frames later. Framer Motion caches
the preference from that event, so a story that mounted in between saw reduced
motion in CSS and in its play() guard while still animating in JavaScript.
This made `Layout/Dashboard Layout › RespectsPrefersReducedMotion` flaky
(the wordmark was part-way through its fade when the assertion ran).

`preVisit` now waits for the `change` event whenever the emulation actually
changes, before the story renders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DYdpBAxKCUbEwPapiBDEmi
@vercel

vercel Bot commented Sep 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ui Ready Ready Preview Sep 26, 2026 3:07pm UTC

Request Review

@jalexw
jalexw merged commit 771bbd9 into main Sep 26, 2026
12 checks passed
@jalexw
jalexw deleted the claude/wonderful-tesla-phyya9 branch September 26, 2026 15:12

This branch was successfully deployed

1 active deployment
Preview — c40ca259 Deployed Sep 26, 2026 by vercel[bot]
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.

2 participants