Repository navigation
State what Leaf spends a duration on - #788
Conversation
`assets/CLAUDE.md` licensed motion -- "a state change may animate only where motion helps the reader follow a change" -- without saying what it may not do, so nothing in writing stopped a pause being added to a result the page already holds. The rule now sits under `Layout and motion`, a section that promised motion and described none. Motion runs from a state that is already true; a motion the reader waits to end stays under 300ms; and the `aria-busy` wait is described as withholding a look rather than a result, which is the form a delay has to take. `packages.md` documented none of the motion surface `widget-api.js` exports. The stylesheet's reduced-motion guard does not reach a Web Animations call a module makes for itself, so a package widget reaching for `element.animate` loses a reader who asked for stillness. Shipped packages already call `motion` with no contract describing it. `motion.js` enumerated the motions the product makes, and the list had fallen behind them. It states the property that holds of all of them instead. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
motion.js's replacement property is broader than the module. .lf-thread.grow and
.lf-thread.flash in chrome.css, lf-toc's transition: left .18s ease in the
default theme, and the margin label's transition: opacity 90ms ease, transform 90ms ease are all motion the product makes that never reaches this module — they carry their
own easings (cubic-bezier(.2,.7,.3,1), ease-out) and no held-end-frame contract, and
their reduced-motion answer is the theme's @media (prefers-reduced-motion: reduce)
block rather than the check here.
That separation is what the packages.md paragraph in this same PR turns on ("the
stylesheet's reduced-motion guard reaches CSS animation and transitions, not a Web
Animations call a module makes for itself"), so the comment now contradicts it. Read as
written it tells the next author a CSS keyframe is already routed through motion — the
same shape of wrong reading the stale enumeration produced. Scoping the sentence to what
the module plays keeps the property without reintroducing a list; suggested inline.
The replacement sentence claimed every motion the product makes comes through this module. CSS-driven motion does not, and carries its own easing and its own reduced-motion answer, which is the separation the `packages.md` paragraph in this branch turns on. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`test` carried `timeout-minutes: 20`, and a job killed by that cap concludes `cancelled` with no failing step to read. PR #788's run was cut off in its final measurement step with 1139 passed and 0 failed, while the same suite on the merge-base finished in 7m36s. The cap was firing on runner speed rather than on anything in the branch under test, and each time it fired a green suite arrived as a red gate for someone to adjudicate. `lint` and `nightly` keep theirs, so a job killed by its own timeout is still a case the nightly guard has to read. `Motion` in `assets/CLAUDE.md` said `runtime/motion.js` owns the reduced-motion answer, three lines above the note that CSS transitions answer to the same ceiling. It answers for the motion it plays; the theme's guard answers for CSS. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
assets/CLAUDE.mdsaid when motion is allowed — "a state change may animate only where motion helps the reader follow a change" — and nowhere said what it may not do. The prohibition existed only as the root invariant about gestures and as reasoning insidemotion.jsandchrome.css, so nothing written down stopped a pause being added in front of a result the page already holds. A section titledLayout and motionhad subsections for space, scrolling and stability, and none for motion.Its new
Motionsubsection says motion runs from a state that is already true, that a motion the reader is waiting to end stays under 300ms while one that moves nothing carries no such bound, and that a delay is legitimate when it withholds a look rather than a result — the form thearia-busywait already takes, holding its fade so a fast answer paints no wait at all. A minimum spinner time, a staged reveal, or a pause that makes work read as substantial is the other kind.packages.mddocumented none of the motion surfacewidget-api.jsexports to behavior modules. That matters beyond tidiness: the stylesheet's reduced-motion guard reaches CSS animation and transitions but not a Web Animations call a module makes for itself, so a widget author reaching forelement.animatesilently loses a reader who asked for stillness. Shipped packages already callmotionwith no contract describing it.motion.jsenumerated the motions it plays, and the list had fallen behind the call sites. Correcting the list would repeat the failure that produced it, so it states the property that holds of all of them instead, scoped to what the module plays rather than to the product — CSS-driven motion carries its own easing and is answered by the theme's guard, which is the same separation thepackages.mdparagraph turns on.No behavior changes.