Skip to content

State what Leaf spends a duration on - #788

Merged
max-sixty merged 3 commits into
mainfrom
ux-delay-guidance
Sep 18, 2026
Merged

max-sixty merged 3 commits into
mainfrom
ux-delay-guidance

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

assets/CLAUDE.md said 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 inside motion.js and chrome.css, so nothing written down stopped a pause being added in front of a result the page already holds. A section titled Layout and motion had subsections for space, scrolling and stability, and none for motion.

Its new Motion subsection 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 the aria-busy wait 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.md documented none of the motion surface widget-api.js exports 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 for element.animate silently loses a reader who asked for stillness. Shipped packages already call motion with no contract describing it.

motion.js enumerated 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 the packages.md paragraph turns on.

No behavior changes.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits September 17, 2026 23:56
`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 leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread skills/leaf/assets/runtime/motion.js Resolved
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]>
@max-sixty
max-sixty merged commit 704044b into main Sep 18, 2026
5 of 6 checks passed
@max-sixty
max-sixty deleted the ux-delay-guidance branch September 18, 2026 07:57
max-sixty added a commit that referenced this pull request Sep 18, 2026
`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]>
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