Repository navigation
Land a walk pressed while a glide runs where the glide is headed - #6030
Merged
Merged
Conversation
The glide matrix from #5987 pressed each key only before the glide's first frame, where every pair passed. Pressed with real timing instead, `t` again 20-100 ms into a `t` walk's glide left the page where the second press found it, short of the thread: 12 of 12 such runs in Firefox and 8 of 10 in Chromium. Every arrival stopped Leaf's glides before it landed (anchor-travel.js, `arrive`), then landed nearest from where the page stood, and mid-way the thread was already in view, so it moved nothing. `g` did the same: arming the Go-to map stopped the page's glide where it stood. An arrival now stops only a scroll the browser drives, such as a wheel's or PageDown's, whose end no script can know (scrolling.js, `stopBrowserScroll`). A glide of Leaf's goes on, and the landing measures from where it is headed and takes it over, as #6009 made the reading band's moves do (landing-scroll.js, `readingBandMoves`). A return still stops the glides itself (history.js), since it goes back to a place. `g` lands the glides, as `c` and Tab do (`landGlides`), so its map labels the page the walk leaves. Two more landings let go of where a glide was headed (landing-scroll.js). An instant landing whose destination the glide already headed for left the glide to finish, so a replaced view, which lands instantly so as never to paint at the old view's offset, painted at the glide's for up to 140 ms; it now lands the glide at once. And the walk that brings a destination in sideways before its reading region lands stopped the glide with its instant horizontal write, so the region's landing measured from where the page stood rather than where it was headed. An instant landing now stops a glide only where it moves the box down or up. tests/runtime/landing-scroll.test.mjs holds both, and both fail on main. The matrix now presses each key at two points in the glide: at once, and under way, two frames after the glide first moved the page. `held_frames` (render_harness.py) freezes the page's frame clock while held and steps one frame at a time, so "under way" lands at the same fraction of the glide on a loaded host. `g` joins the keys. 127 of the 128 cases pass in both engines; on the merge base, `t t`, `m t` under way and every glide followed by `g` fail. The Chromium `t` then Tab case stays known: an anchored box takes a script's scroll at the next frame in both engines (a probe read it 200 px behind in the same task), and only Chromium reveals a focused control in such a box by scrolling the page. notes/browser-support.md records that gap in its entry on anchored fixed boxes, whose recheck now covers this case. test_a_focused_thread_covers_the_pages_choice_hints failed on this Mac: under macOS 26's Charter the card covers the chip's lower half and its centre fell 2.5 px above the card's top edge. It now reads the paint at the centre of the overlap, which still fails if the chip paints over the card.
leaf-agent
previously approved these changes
Nov 15, 2026
Codex's second review found that the previous commit let an instant landing stop a glide only where its write moved the box vertically, so a landing on a destination centred where the page stood, with the glide about to carry it 1000px up, wrote nothing and left the glide to carry it away. An instant landing now stops the glide unless it only moves the box across, the sideways reveal the walk before a reading region makes. The runtime test gains that case, which fails on the previous commit.
leaf-agent
approved these changes
Nov 15, 2026
This was referenced Nov 15, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 15, 2026
… it carries (#6074) Clicking a commented passage during a `t` walk's glide opens that passage's thread but no longer keeps the page on it. The walk's glide keeps going and carries the clicked words out of the window. That breaks `test_a_thread_trip_takes_over_an_outgoing_trip_before_its_first_frame[passage]` on every run since #6030. **Cause.** A click on a mark opens its thread with `travel: false` ([surface.js](https://github.com/max-sixty/leaf/blob/ac5dba8ffcf40f60babc30895ec495d4f6925935/browser/runtime/composing/surface.js#L1306)). The only landing that arrival makes is the thread card's. The card is a fixed box anchored beside its passage, so `scrollersOf` yields no scroller for it, and `scrollIntoView` on it moves nothing. Before #6030, `arrive` called `stopScroll`, which stopped every Leaf glide, and that is what used to end the walk. #6030 replaced it with `stopBrowserScroll` so that `t` pressed mid-glide lands where the glide is headed. After that, nothing on the click route stopped the glide. An instrumented run showed the card's landing reading `alreadyShown` as false (the glide would carry the card away) and then making no move. **Fix.** The click handler now stops the glides in the boxes that carry the clicked words (`carriersOf`) before opening the thread. The press picked those words where they stood, the same reason `z` stops a glide. The change is limited to the pointer route. Keys keep #6030's rule that a landing aims from the glide's goal. **Verification.** - The failing test fails on main (`assert 0 <= -2158.921875`) and passes with the change (3 of 3). Its `[walk]` variant still passes. - #6030's mid-glide matrix (`tests/journeys/navigation/test_reading_place.py::test_a_key_pressed_during_a_glide_acts_where_the_glide_lands`, Chromium): 63 passed, 1 xfail (the `t`-then-Tab engine gap #6030 recorded). - `pnpm run test:runtime` and `pnpm run check:browser` pass. - The click, press, mark and trip tests in `test_comment_marks.py` and `test_threads.py` pass, apart from `test_color_cues_fade_to_the_live_surface[firefox_browser]`. That test also fails on main with a Firefox color-serialization difference, so this change doesn't cause it. Closes #6072 — automated triage Co-authored-by: leaf-agent <[email protected]>
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.
The glide matrix from #5987 pressed each key only before the glide's first frame. Pressed mid-glide with real timing,
tagain during atwalk 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.stopBrowserScroll); a glide of Leaf's goes on, and the landing aims from its goal, as Act on every key pressed during a glide where the glide lands #6009 made the reading band do. Back and Forward still stop glides.glands the glides instead of stopping them, ascand Tab do.held_framesfreezes the page's frame clock and yieldsstep(), so that point doesn't drift with load.gjoins the keys. 127 of 128 pass in both engines; on the base,t tandm tunder way and every glide thengfail.Where to look: the one known case, Chromium
tthen 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_hintson 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.