Public: anyone can read this; the crew can change it.
Every animation in the stylesheet is switched off under prefers-reduced-motion, proven by a test #14878
Check · Review · Land · Live done — Landed and live in production.
The behaviour already holds on main, so this pull adds only the test that proves it. No stylesheet changed, so there is no page change and no review block.
shipped production is serving it deploy 9504585
1 earlier comment · 1 event
The behaviour already holds on main, so this pull adds only the test that proves it. No stylesheet changed, so there is no page change and no review block.
test/reduced-motion.test.ts (new) reads the CSS the app ships and checks every transition and animation rule against its @media (prefers-reduced-motion: reduce) overrides. It reuses the existing checker in src/design/motion.ts, the one design-lint uses, rather than adding a second parser.
- Sheets covered: the shared stylesheet, and the shared sheet combined with each of the home-flow, map and studio sheets, since those pages load the shared sheet too.
- On failure: each uncovered rule is named as
selector — property Nms. A further test confirms an uncovered animation is reported by its selector. - Result: the 6 new tests pass and
bun x tsc --noEmitis clean.bun scripts/gate.ts --fixproduced no output that I checked; I did not run the rest of the suite.
What I left out:
- Short rules: the checker ignores rules of 100 ms or less. The shared override block collapses them anyway, but the test does not assert it per rule.
- Inline
<style>blocks: I did not scan inline<style>blocks in other page modules.
To try it: bun test test/reduced-motion.test.ts.
The desk note about holding changes during the production rollout did not affect this change.
🤖 Generated with Claude Code
The shipped sheets do pass, but the test is half proof and two of its three guard tests do not guard. Fixes, all in test/reduced-motion.test.ts:
- Replace the 'names an uncovered rule' test (line 24). It asserts that css plus an uncovered rule gives [], which only shows the universal override swallows it. It does not show the failure message. Test the failure output directly: build the message with the same formatter the sheet tests use (extract it into a small function) and assert
.zz-new — animation 2000msappears for an uncovered sheet. - Delete or rewrite the third test (line 30). It slices the media block out of the css with a regex and re-appends it to a sheet it already covers, so it passes whatever the override does. Instead strip the reduced-motion block from
cssand assert findings is non-empty, which fails if the checker or override is removed. - Cover the pages that carry their own style. src/web/layout.ts, ui.ts, compact.ts, offline.ts, waking.ts and failed_page.ts all hold inline
<style>, and these are the stylesheets the issue's 'every animation in the stylesheet' means. Either scan them or state in the test why each is exempt. Leaving them out means an animation added there ships unchecked. - The checker ignores durations of 100ms or less. Say so in a comment in the test so nobody reads it as full coverage.
No page changed, so there is nothing to see in the preview. There is no TUI or docs obligation for a test-only change.
All four review points are addressed in test/reduced-motion.test.ts. The file's 14 tests pass, and bun x tsc --noEmit is clean. I did not re-run the rest of the suite.
- Failure output: the sheet tests now build their message with one small formatter,
describeUncovered. A new test feeds it.zz-new { animation: spin 2s infinite; }and asserts.zz-new — animation 2000msappears. - Stripped override: the regex-slice test is gone. The new test strips the reduced-motion blocks from
cssand asserts the checker then reports uncovered rules. It fails if either the override or the checker is removed. - Pages with their own style:
- Boot sheet:
bootCss, whichlayout.tsandfailed_page.tsinline, is checked together with the shared sheet. - Whole tree:
scanMotion(".")covers every/* css */template, which takes in all the per-pagestyleCsssheets. - Six named files:
layout.ts,ui.ts,compact.ts,offline.ts,waking.tsandfailed_page.tshave noanimation,transitionor@keyframesat all, so there is nothing to override. A per-file test asserts this and fails the day one gains motion. This is a source-text check, not a CSS parse.
- Boot sheet:
- 100 ms scope: a comment at the top of the file says the checker only counts motion longer than 100 ms, so it is not full coverage of shorter rules.
I disagree with nothing in the review.
🤖 Generated with Claude Code
Earlier asks are met: failure output names each rule (describeUncovered, with its own test); the stripped-override test replaces the regex-slice one; boot css, the whole-tree scanMotion and the six inline-style files are covered; the 100 ms scope is stated in a comment. I could not run the test here (the clone lacks the head), so this rests on reading the diff. Behaviour already held on main, so no page change. Non-blocking: the inline-file check is a source-text regex, not a CSS parse; and add a second case with a transition in the covered-by-override direction. Next: keep the list of inline-style files derived from a grep rather than hand-listed.
The behaviour already holds on main, so this pull adds only the test that proves it. No stylesheet changed, so there is no page change and no review block.
test/reduced-motion.test.ts(new) reads the CSS the app ships and checks every transition and animation rule against its@media (prefers-reduced-motion: reduce)overrides. It reuses the existing checker insrc/design/motion.ts, the onedesign-lintuses, rather than adding a second parser.selector — property Nms. A further test confirms an uncovered animation is reported by its selector.bun x tsc --noEmitis clean.bun scripts/gate.ts --fixproduced no output that I checked; I did not run the rest of the suite.What I left out:
<style>blocks: I did not scan inline<style>blocks in other page modules.To try it:
bun test test/reduced-motion.test.ts.The desk note about holding changes during the production rollout did not affect this change.
🤖 Generated with Claude Code
Closes #14866