Skip to content

Give cyclic walks one step and the panel's motion one door - #3736

Merged
max-sixty merged 6 commits into
mainfrom
js-fact-homes
Oct 23, 2026
Merged

max-sixty merged 6 commits into
mainfrom
js-fact-homes

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Two facts in the browser runtime had several homes; each now has one.

One cyclic walk. Six walks stepped round their ends with hand-written modular arithmetic instead of cycledRow, the step the page walks (t, m, n) already share: the response choices (composing/selection.js), the reaction choices (reactions.js), a hint map's Tab walk (keyboard/hints.js), a cluster's margin entries (annotation-overlay/margin-projection.js), a tab strip's arrows (lf-tabs.js) and the visual review's n/Shift+n (lf-visual-review.js). All six now call cycledRow, which widget-api.js exports for packages and module-input.md documents. The visual review's case walk also reports its position ("Case 2 of 3"), as every other walk does. The comments that left tabs to a cyclic policy of their own date from before cycledRow existed, when the only shared step clamped.

The walk position's "came round" boundary goes too. Its only painter, the classic chrome's data-lf-boundary, was removed in #3100. Since then the panel has read only the position's words, and nothing read boundary but a repaint equality check. So boundary, its timer and wrapped are deleted, cycledRow and stepFrom return the item they land on, and module-input.md, how-it-works.html and the comments no longer promise an accent. The 900 ms hold that keeps arriving news off the status line after a walk step stays.

Panel motion through one door. The floating panel called Element.animate directly in three places, each with its own reduced-motion gate, and the menu slide skipped the presentation check. The menu slide, the view fades and the box follower (box-motion.js) now play through playMotion. It is a runtime-only function that holds the gate, the held end frame and the release, and takes the easing and delay the panel needs. motion(el, keyframes, ms, pseudoElement) keeps its package signature as a thin door onto it. motionPlays() is the gate on its own, for a caller that has to choose before it animates.

The panel's seven timing constants are gone. Its durations and curves are --lf-motion-* tokens declared on .lf-floating-panel in floating-panel.css, read with motionTime/motionEasing. They live in the runtime's sheet rather than the theme because a page keeps the theme it vendored while a later runtime serves it. The view resize reads --lf-motion-disclosure, and so do the CSS fades that repeated its 120 ms by hand. A probe of the menu, a view opening and closing, a growing field and the fold recorded the same durations, curves and delays on the merge base and on this branch, in Chromium and Firefox, and the computed CSS transitions match too.

Two floating-panel tests used to finish every motion HOLD_MOTION held, including the ones the page had cancelled. Finishing a cancelled motion plays it again, and under motion() its end frame would then stay. They now finish only what still moves.

Checks: pnpm run test:runtime, pnpm run check:browser, and focused browser tests for each walk (reactions, response choices, hints, margin entries, tabs, visual review, t, m, page search) and for the panel's fold, view, menu, field-growth and theme-motion behavior. test_the_leaf_paints_inside_its_moving_focus_ring and test_reactions_keep_all_six_buttons_on_an_occupied_target[390-keyboard] fail locally on the merge base as well.

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

max-sixty and others added 6 commits October 23, 2026 00:50
Six walks wrapped by hand-written modular arithmetic instead of the
cyclic policy the page walks already share (`cycledRow`), and none told
`beginWalk` that a step came round: the response choices, the reaction
choices, a hint map's Tab walk, a cluster's margin entries, a tab strip's
arrows and the visual review's n/Shift+n. Each now steps with
`cycledRow` and passes its `wrapped` on, so the walk position reports a
step that came round (`walkPosition().boundary`) for all of them, as it
did for t, m and n. The floating panel paints no accent from that
reading today (the classic chrome that painted `data-lf-boundary` went
in #3100), so nothing changes on screen.

The visual review's case walk also reports its position ("Case 2 of 3")
as every walk does, and the tests check it.

The carve-out that left tabs and spatial grids to their own cyclic
policies dates from before `cycledRow` existed, when the only shared
policy clamped; it no longer applies. `cycledRow` is now part of the
widget API, documented beside `beginWalk` in module-input.md, so a
package walk reaches the same step.

The hint-session runtime tests run each case's pending mocked timers out
when the case ends: the boundary timer a wrap leaves would otherwise be
cleared under the next case's mocked clock, which lost that case's
announcement.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… from CSS

The panel called `Element.animate` itself in three places, each with its
own gate: the menu's slide checked reduced motion but not the
presentation boundary, and the box's follower (box-motion.js) and the
view fades checked both by hand. All three now play through `motion()`,
which takes the `easing` and `delay` the panel needs and always fills
both ways: the backward half holds a delayed fade's first frame, which
no undelayed motion reaches, so every other caller draws the same. The
gate itself is `motionPlays()`, which `motion()` asks and which the view
fade and box-motion ask where they must choose before animating. A user
turning on reduced motion mid-tween now also finishes the panel's
motion, as `motion()` does for every motion it plays.

The panel's seven timing constants are gone. Its durations and curves
are tokens its own stylesheet declares on `.lf-floating-panel`, read
with `motionTime`/`motionEasing` (now exported, taking the element to
read): the runtime's sheet rather than the theme, since a page keeps
the theme it vendored while a later runtime serves it. The view's
120ms resize is `--lf-motion-disclosure`, which the menu's CSS fade
now reads too, and the menu's CSS slide reads the panel's curve rather
than repeating it. A probe of the menu, a view opening and closing, a
growing field and the fold records the same durations, curves and
delays on the merge base and here, in Chromium and Firefox.

Two floating-panel tests finished every motion HOLD_MOTION had held,
including the ones the page cancelled when a fold reversed. Finishing a
cancelled motion plays it again, and under `motion()` its end frame now
stays, so they finish only what still moves.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`walkPosition().boundary` marked a landing that met an end: a clamped
walk reaching the same destination twice, or a cyclic one that came
round (`wrapped`). Its only painter, the classic chrome's
`data-lf-boundary`, went with #3100; since then the floating panel reads
only the position's words, and the status context compared `boundary`
only to decide whether to repaint those same words. No announcement or
user-visible test read it.

So `boundary`, its timer, `wrapped` and the walk-position header's
promise of an accent face go. `cycledRow` and `stepFrom` return the
item they land on, and every walk that passed `wrapped` along (t, m,
page search, hints, the response and reaction choices, margin entries,
tabs, the visual review's cases) drops it. The 900ms hold that keeps
arriving news off the status line after a step stays, renamed for what
it does. module-input.md, how-it-works and the lf-tabs comment no
longer say a step that came round shows it did, and the hint-session
test is back to its base form, since the timer its drain cleared is
gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`motion(el, keyframes, ms, pseudoElement)` is what a vendored package
calls, and the previous commit had turned its fourth argument into an
options object, which an earlier page's package would pass a
pseudo-element string to. It is back as pages know it, a thin door onto
`playMotion(el, keyframes, {duration, easing, delay, pseudoElement})`,
the runtime-only function that holds the gate, the fill and the release.
The floating panel and box-motion call `playMotion` for the easing and
delay they need; widget-api.js still exports only `motion`, and
module-scroll-and-motion.md is back to its earlier text.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
floating-panel.css still spelled the disclosure's 120ms by hand for the
corner mark's fade and the peek's, and the menu's 200ms slide. They read
`--lf-motion-disclosure` and a new `--lf-motion-menu-slide` on the
panel beside its other motion tokens. A probe of the computed
transitions on the corner mark, the open menu and the peek reads the
same durations and curves on the merge base and here.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	dist/kernel/kernel.json
#	dist/kernel/leaf.js
@max-sixty
max-sixty merged commit 6e7dcf2 into main Oct 23, 2026
3 checks passed
@max-sixty
max-sixty deleted the js-fact-homes branch October 23, 2026 10:57
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