Repository navigation
Treat --slomo 0 as 0 so reduced motion skips the motion waits - #91
RobbieTheWagner wants to merge 2 commits into
Conversation
Under prefers-reduced-motion propflip.css sets --slomo to 0, but the rail re-form, the hover release and the explorer read it with `|| 1`, so 0 became 1 and they still waited out the full animation. One slomo() in motion/propflip.ts now reads it for every caller, falling back to 1 only when the property is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
CI failed the new re-form tests in Firefox and WebKit. --slomo reads 0 under reduced motion in all three browsers, but headless WebKit took 560ms for two idle frames and Firefox's hold swung with load, so a wall-clock bound there measured the runner, not the fix. The timing tests now run in Chromium only, and slomo() gets unit tests that fail on the old `|| 1` read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why
We want to merge
media-redesigninto main with confidence, and review found that reduced motion still makes visitors wait out animations that no longer run. Underprefers-reduced-motion,propflip.csssets--slomo: 0. The rail re-form inLayout.astroread it withparseFloat(...) || 1, so 0 became 1 and the rail kept its pieces out of flow for the full ~760 ms. The hover release inLayout.astroand every timer inexplorer.tshad the same|| 1fallback.What changed
motion/propflip.tsexportsslomo(el = document.documentElement). It returns the parsed--slomoand falls back to 1 only when the value is missing (NaN), never when it is 0.Layout.astro, the explorer's timers (its privateslomo()is gone), and the island's settle timer inIsland.tsx.--slomoon<html>, so it ignored the reduced-motion value entirely. It now reads the computed value like the others.tests/e2e/shell.spec.tsgains two tests that drag the divider past the middle and time how long the rail stays re-forming: over 600 ms with normal motion, under 200 ms with reduced motion.tests/unit/Island.test.tsxsets--slomo: 0on the island in the one test that waits 80 ms for it to land. jsdom has no stylesheet, so the island used to read a missing value as 0 by accident. It now gets the default of 1.Verification
data-reformingset to cleared during a divider drag: 28 ms with reduced motion, 812 ms with normal motion.shell.spec.ts, chromium: 24 passed, 1 failed. The failure issearch palette › closes the now-playing card first, so ⌘K always works(expected 0, received 16). It fails the same way with the fix stashed, so it predates this change.explorer.spec.ts,player.spec.ts,player-phone.spec.ts, chromium: 38 passed.pnpm lint: clean.pnpm test:unit: 273 passed.pnpm build: 0 errors.🤖 Generated with Claude Code
Summary by CodeRabbit