Skip to content

Check daily that a key pressed during a glide acts where the glide lands - #5987

Merged
max-sixty merged 3 commits into
mainfrom
motion-ahead
Nov 15, 2026
Merged

max-sixty merged 3 commits into
mainfrom
motion-ahead

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

A nightly journey holds Leaf's glides to the rule Max chose in #5971: a key pressed while a glide runs acts as it would once the glide had landed. From a link mid-page, each of t, m, g g and d sets off and each of c, Tab, Shift+Tab, t, m and d follows, in Chromium and Firefox, once before the glide's first frame (frames held) and once after it lands; focus, whether it's seen, and the scroll must agree. Comparing the two arms needs no expected outcome per pair, so only a mid-glide reading of where the user is shows up. On the runtime before #5971 it fails 6 pairs per engine that pass now.

Where to look: it finds 6 pairs that still break the rule, marked xfail as defects with their causes. Tab or Shift+Tab during t, m or d leaves the page elsewhere, because the reveal of the control Tab reaches reads the page mid-glide; and c during m brings the ask forward from where the glide has it. t then Shift+Tab varies with frame timing, so that one is non-strict. Each case is ~3 s, inside the browser tier's budget, but the 48 cost about 2.5 CPU-minutes, so they run daily by Max's choice.

Tests: the full matrix 10 times locally and once on CI (stable: 37 pass, 9 xfail, and t then Shift+Tab varying), Chromium at --cpu-throttle 10, and the pre-#5971 runtime as the bug-back control.

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

A nightly journey holds Leaf's glides to the rule the user chose in #5971: a
key pressed while one runs acts as it would once the glide had landed. From a
link in the middle of a page, each of `t`, `m`, `g g` and `d` sets off, and
each of `c`, Tab, Shift+Tab, `t`, `m` and `d` follows, in Chromium and
Firefox: once before the glide's first frame (frames held, as the Home case in
test_obligation_walk.py holds them), once after it lands. Focus, whether the
user sees it, and the page's scroll must agree.

The pairs need no expected outcome of their own, so a change to what a key
does changes both arms together; only a reading of where the user is taken
mid-glide shows. On the runtime before #5971 the check fails `g g` and `d`
followed by `c`, `d` or Tab in both engines, the readers #5971 fixed.

It also finds pairs that still break the rule, marked xfail as defects:

- Tab or Shift+Tab during a walk or a step (`t`, `m`, `d`) focuses the same
  control but leaves the page elsewhere. The reveal of the control Tab
  reaches reads the page mid-glide: the browser's own reveal at the keydown
  cancels `m`'s glide, and Leaf's nearest landing for Shift+Tab during `d`
  finds the control in view where the page stands and stops the glide there.
  `t` then Shift+Tab varies with the frames the page gets, so it is marked
  non-strict.
- `c` during `m` brings the ask forward because `bringForward`
  (composing/surface.js) reads whether it is seen now; reading it where the
  glide leaves it instead keeps the glide, but the comment box then chooses
  its side while the glide runs and ends off screen at a 1200x900 window, so
  that fix waits for the box's placement to read the glide's landing too.

Each case fits the browser tier's budget, but the 48 cost about two and a half
CPU-minutes, so they run daily rather than on each push to main, by the user's
choice.
leaf-agent
leaf-agent previously approved these changes Nov 14, 2026
@max-sixty
max-sixty merged commit cc66b04 into main Nov 15, 2026
5 checks passed
@max-sixty
max-sixty deleted the motion-ahead branch November 15, 2026 01:16
max-sixty added a commit that referenced this pull request Nov 15, 2026
Max asked for one rule for keys pressed during a glide instead of a
decision per case. It is the one #5971 recorded: a key acts as it would
once the glide had landed; a wheel or touch takes the page where it
stands. The nightly check from #5987 holds every glide-and-key pair to
it, and now passes 55 of 56 cases, PageDown included.

Leaf's readings of where the user is already predict the landing. What
failed was work that reads the page as it stands, now handled one of two
ways:

- **Land first**: the browser's answer to Tab and paging keys
(`landForKey`, called by the keyboard controller after its let-go), and
the comment box's Floating UI placement for a page target or selection
(`landGlides`). The glide's last ≤140 ms of motion jumps.
- **Aim from the goal**: Leaf's nearest reveals measure each region
where its glide will leave the destination (`readingBandMoves`). This
replaces #5971's rule that such a reveal stops the glide, which left `/`
during `d` in a diff stopped mid-way.

Where to look: landing on every key was tried and rejected, since a
CSS-anchored thread card takes a scroll a frame late and a card a `t`
walk had focused read as off screen. That lag is also why Chromium `t`
then Tab still fails.

Tests: a runtime test and a browser phase that both fail on main, 253
focused browser tests, `test:runtime`, the matrix twice; Codex reviewed
twice and its four findings are fixed.
`test_a_focused_thread_covers_the_pages_choice_hints` fails locally on
main too.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 15, 2026
The glide matrix from #5987 pressed each key only before the glide's
first frame. Pressed mid-glide with real timing, `t` again during a `t`
walk left the page short of the thread (Firefox 12 of 12 runs, Chromium
8 of 10): every arrival stopped Leaf's glides and landed nearest from
where the page stood, where the thread was already in view.

- An arrival now stops only a scroll the browser drives
(`stopBrowserScroll`); a glide of Leaf's goes on, and the landing aims
from its goal, as #6009 made the reading band do. Back and Forward still
stop glides.
- `g` lands the glides instead of stopping them, as `c` and Tab do.
- An instant landing takes the box from a glide, landing it now where
the glide already headed for the destination; a sideways reveal on the
way leaves a vertical glide going (landing-scroll.js).
- The matrix presses each key at once and under way, two frames after
the glide first moves; `held_frames` freezes the page's frame clock and
yields `step()`, so that point doesn't drift with load. `g` joins the
keys. 127 of 128 pass in both engines; on the base, `t t` and `m t`
under way and every glide then `g` fail.

Where to look: the one known case, Chromium `t` then Tab at once, is an
engine gap now recorded in notes/browser-support.md: an anchored box
takes a script's scroll at the next frame, and Chromium reveals a
control in one by scrolling the page.

Also fixes `test_a_focused_thread_covers_the_pages_choice_hints` on
macOS 26's fonts.

Max asked to work through #6009's open items. Tests: the matrix,
real-timing `t t` (38 of 38 runs end as typed slowly), runtime tests for
both landing fixes (fail on main), 61 focused browser tests,
`test:runtime`, `check:browser`. Codex reviewed it.

> _This was written by Claude Code on behalf of max-sixty_
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