Repository navigation
Keep landings off the anchor walk, and give that walk a home beside scrollersOf - #5895
Merged
Merged
Conversation
…crollersOf #5841 taught `focusPlace` to follow a fixed box's `position-anchor` past the point where `scrollersOf` stops, so a key pressed during the thread walk's glide stays on the card the walk reached. It left open whether `scrollersOf` itself should follow anchors, so that landings, holds and `returnTo` also see the page scroll that carries a card. It should not. With `scrollersOf` following anchors (an experiment, not kept), pressing `t` then Tab before the walk's glide ended left the margin card wholly above the window, its foot 120 to 260 px past the top, with focus on a control in it. On main the card ends on screen. The Tab arrival's nearest landing read that control at y=1905 in a 900 px window and moved the page by 1055 px, because: - A scroll moves an anchored fixed box only at the browser's next rendering update. Chromium, Firefox and WebKit all return the old position to a read in the same task. - The card's placement solves again after a scroll and changes plane. A landing on a reply cut by the window's foot moved the page 101 px as though the card rode it; the card then stood at the window's edge, 63 px below where that move aimed it. Main moves nothing there, and off-flow.js brings a surface back by landing what it stands by. Native scroll chaining ends at the fixed box too: in all three engines a wheel spent in a fixed card's inner scroller passes to the root scroller, not to the pane carrying the card's anchor, so `scrollChainOf` must not follow anchors either. The anchor walk answers which motions under way carry a node. It moves from `user-place.js` into `scroll-containers.js` as `carriersOf`, beside `scrollersOf`, whose comment now records the rejected alternative and no longer says a fixed box stands still while the page scrolls. One more caller asks that question: `holdUserPlace` yields to a scroll the browser is still running in the boxes moving the place, and now asks it of `carriersOf`. On main, for a focused control in a box Leaf anchors whose own content scrolls, a reading that arrived during a smooth page scroll scrolled that content back by the page's travel, 116 px in a probe; now the hold yields. Leaf's own cards rarely reach this, since a card that fills its room stands in the window's plane, unanchored. Tests: `pnpm run check:browser`, `pnpm run test:runtime`, the two tests that pin #5841's behavior, the card, seated-thread and arrival hold tests, and #5841's region and margin-carrier probes, identical on base and head.
leaf-agent
approved these changes
Nov 12, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
This overlaps #5863, which edits the same yield in holdUserPlace. There, the hold also yields to a scroll chosen since the reading (chosenSince), and only for boxes from scrollersOf(holderOf(place)). Whichever PR lands second should run both reads over the same boxes. If browserScrolls walks carriersOf and chosenSince walks scrollersOf, a hold on a place inside the card yields to a page scroll the browser is still running, but not to a page scroll a landing chose.
max-sixty
added a commit
that referenced
this pull request
Nov 14, 2026
… it lands (#5958) Three readings asked where Leaf's glides under way will take a node, each its own way. They now share `glideTravel` and `glideGap` in `scroll-containers.js`: the distance the glides have still to scroll every box carrying a node (`carriersOf`, so the page's glide carries a thread card), and how far outside the window the node stands now and once moved by it. Each caller keeps its own question. Two behaviors change: - **`focusPlace` counts a glide only while it carries focus toward the window.** On main, with focus on a link mid-page, `g g` then `c` once the link has left the window takes the page back down and comments on the link. Now `c` opens the panel's comment at the top, as it does once the glide has landed (Chromium and Firefox). - **off-flow.js leaves an unseen surface to a glide that will bring it into the window.** On main, `t` then `c` brings the card back mid-walk and stops the page 360–375 px short of the walk's landing; now it lands where `t` alone lands, and `t` then Tab does too in Firefox. Chromium's own focus reveal still moves the page on `t` then Tab. Where to look: focus uses "toward" and off-flow uses "into" because they fail differently (a card's box trails its placement mid-walk; a suppressed reveal is never retried), which the commit message details. `alreadyShown` keeps its rule; `holdUserPlace` is untouched (it asks whether any scroll moved the place, browser-run ones included). Max asked for this as #6.3.3, the follow-up to #5895. Codex reviewed three rounds; each found a defect in predicting where a node will stand, which led to this design. Tests: a runtime assertion, a new `g g` then `c` browser test and a stricter #5841 walk test, both failing on main's runtime; `check:browser`, `test:runtime`, 25 focused browser cases. > _This was written by Claude Code on behalf of max-sixty_
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.
#5841 let
focusPlacefollow a fixed box'sposition-anchorpast wherescrollersOfstops, and left open whetherscrollersOfitself should, so landings, holds andreturnTowould see the page scroll that carries a card. This settles it: no. The anchor walk moves besidescrollersOfascarriersOf, for questions about motions under way, andscrollersOf's comment records why landings stay off it.With
scrollersOffollowing anchors (tried, not kept),tthen Tab before the walk's glide ended left the margin card wholly above the window with focus in it; main keeps it on screen. The landing read the card where its last placement left it: in Chromium, Firefox and WebKit a scroll moves an anchored box only at the next rendering update, and the card's placement re-solves after a scroll, changing plane. Native wheel chaining also passes from a fixed card to the root, not to its anchor's pane.One behavior change:
holdUserPlacenow yields to a browser-run scroll in any box carrying the place (carriersOf). In a probe with an anchored box whose own content scrolls, main scrolled that content back 116 px against a smooth page scroll. Leaf's cards rarely reach this, since a card that fills its room is unanchored.Max asked for this as a follow-up to #5841; Codex reviewed the conclusion and found the hold case. Tests:
check:browser,test:runtime, #5841's two tests and the card, seated-thread and arrival hold tests.