Repository navigation
Carry an ask's digits with their choices through a scroll, and read pages per frame with probe --frames - #6902
Merged
Merged
Conversation
…ages per frame with probe --frames With focus on an ask, the digit on a choice that a scroll brought into the window showed only once the scroll ended: in Firefox, with a trackpad-like wheel, the first choice's digit stayed missing for about 70 frames (1.1 s) on the way back up `css-theme-structure`'s 2,303 px group. Command hints wore a face only for a control the window showed, decided per paint, and nothing painted while the scroll moved. It is the symptom #6892 fixed for the resting comment box, found by checking each owner that updates only at a scroll's end. The others record what the reader doesn't see (version.js, scrolling.js), re-export for checks (check-api.js), re-read a short-lived hint map (keyboard/hints.js), or already place their rows mid-scroll (margin-layout.js). - `command-hints.js`: a face whose control the window doesn't show, and every face while the page moves, is worn unmeasured, so the browser carries the digit in with its control and clips and stacks it as it does the control. The first scroll event of a sequence paints once to wear the faces the page at rest withheld, and the scroll's end applies the rules for a page at rest again. A first design repainted whenever a per-frame reading of the window changed; it missed page content standing over a face, lagged a frame at entry, and cost about 3 ms a crossing, so a review replaced it with this one. - `leaf_dev/frames.js` reads a page after every frame it draws, dropping a frame an input reached before the read. `tests/page_scripts/motion_frames.js` now records through it, and `leaf-dev probe --frames EXPR` reads EXPR through it from before the first --do step until the page settles. A read inside a journey's own frame callback runs before the runtime's rendering pass and sees the frame before, which misled a review round of #6892; Leaf worktrees hold about 600 hand-written per-frame journey files. Behavior changes: - A choice's digit comes and goes with the scroll rather than at its end. - A chip standing in for a face the page at rest withheld gives way to the face while any box on the page scrolls, so where page content covers the face, neither shows until the scroll ends or the face clears it, and a face cut at the window's edge shows cut while another box, such as a code block, glides. Tests: `test_a_digit_shows_on_its_choice_as_a_scroll_brings_the_choice_into_view` (Chromium and Firefox) fails without the command-hints change. `tests/journeys/test_floating_box_motion.py` passes on the shared frame reader. Firefox, momentum up past a choice entering at the window's top: digit worn on 316 of 316 frames with the choice in the window's upper part (base 176 of 310, all after the scroll ended), and on 319 of 319 with a 200 px sticky masthead over it (base 179 of 314). Cost (Chromium, the same page, 160-frame smooth scroll past four choices and back): main-thread task time 92.1 ms against 91.8 ms on main, script 12.3 against 13.4 ms.
leaf-agent
previously approved these changes
Nov 23, 2026
Agents in Leaf worktrees wrote about 600 per-frame journey files by hand, many reading inside their own frame callback, a frame before what the page drew. The skill's list of probe's options now names --frames beside --log, --base and --browser.
leaf-agent
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With focus on an ask, a choice's digit now comes into view with the choice during a scroll, a trackpad's momentum included. Before, it appeared only once the scroll ended: in Firefox the first choice's digit stayed missing for about 1.1 s on the way back up a tall group. It is the symptom #6892 fixed for the resting comment box, found by checking each owner that updates only at a scroll's end; the other five record what the reader doesn't see, re-read a short-lived hint map, or already follow the scroll.
command-hints.jswears a face unmeasured where the window doesn't show its control, and every face while any box on the page scrolls, so the browser carries the digit with its control and clips and stacks it as it does the control. The first scroll event paints once; the scroll's end applies the rules for a page at rest again.leaf_dev/frames.jsreads a page after every frame it draws.motion_frames.jsnow records through it, andleaf-dev probe --frames EXPRexposes it, named in/developing-leafbeside probe's other options: a journey that samples in its own frame callback reads before Leaf's rendering pass and sees the frame before, which misled a review round of Keep the comment box beside a tall focused element through a scroll's momentum #6892.Behavior change to weigh. A chip that stands in for a face the page at rest withholds gives way to the face while any box on the page scrolls. Where page content covers the face, neither shows until the scroll ends or the face clears the cover; a face cut at the window's edge shows cut while another box, such as a code block, glides. Narrowing "moving" to the boxes around each control would need a new reading from
arrivals.jsfor that rare case.Evidence. Firefox, momentum up past a choice entering at the window's top: the digit shows on 316 of 316 frames (main: 176 of 310, all after the scroll ended), and on 319 of 319 under a 200 px sticky masthead. Chromium main-thread time over a 160-frame scroll is unchanged (92.1 against 91.8 ms).
test_a_digit_shows_on_its_choice_as_a_scroll_brings_the_choice_into_view(Chromium and Firefox) fails on main;test_floating_box_motion.pypasses on the shared reader. Max asked for this follow-up after #6892, and a fresh-context agent reviewed both the first design and its replacement.