Repository navigation
Have a landing's glide re-read where the landing puts its box, with anchoring off while it glides - #6904
Merged
Conversation
…nchoring off while it glides A landing's glide aimed at the offset the landing computed at the press. Content that moved the destination during the 140 ms glide left it off by the move: 22px in Chromium and Firefox where growth sat above the destination, and an end landing whose destination grew at its top clipped it by the growth. With scroll anchoring on, the glide told anchoring's move from a hand's by how far the box's scroll height changed, which two changes partly cancelling defeat: pressing the merge film's "merge" step and then "setup" at phone width stopped the glide where it stood and left the film 708px above the window. Now a landing passes its glide an aim that re-runs the landing's own arithmetic (`readingBandMoves`, or `innerMoves` inside `within`) at each frame and when a key lands the glide, so the destination lands where the page's layout puts it as the glide ends, with its alignment, band and clamps read afresh. A landing first takes the glides under way in the boxes that scroll its destination (`steerGlide`), so a second landing that moves nothing still owns the glide. Scroll anchoring is held off on a box while a glide holds it, by an endless `overflow-anchor` animation (`holdBox`), so `holding` no longer infers anchoring: only a clamp's move is layout's. browser/AGENTS.md's rule that Leaf turns anchoring off on no box the reader reads in now states this exception; the maintainer asked for this pairing to be decided here. HOLD_MOTION leaves endless animations unheld, since they have no end for a test to step to or finish. An earlier version followed the destination node's offset in the box's content. Codex found it wrong for clamped landings, end, centre and nearest alignment, a moved band and a rescaled box, since it was a second model of where a landing puts things; re-running the landing's arithmetic replaced it. Codex also proposed letting a region the landing didn't move join it when layout later needs it; no case built in a browser needed it, since the page's own anchoring kept the region in view, so it isn't here. Left as they are: a step or other read of `scrollGoal` between frames reads the last frame's goal; comment placement and the thread card's reply placement still glide to a measured distance; a numeric glide (`d`, `u`, `g`) lands at its offset with anchoring off as it did with it on. Tests: test_glides.py's layout cases (growth above the destination, below the window, partly cancelling, and an end landing whose destination grows) and its second-landing case fail on main in Chromium and Firefox and pass here, as does the merge film's phone test, which now presses two steps. scrolling.test.mjs covers the aim and the narrower ownership check.
leaf-agent
approved these changes
Nov 23, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
#6896 also edits scrollIntoView's within path in landing-scroll.js: it removes the block handling for a within box, and this PR's landingAim passes block to innerMoves in that same path. Whichever lands second has to rebase onto the other's within path.
max-sixty
added a commit
that referenced
this pull request
Nov 23, 2026
… as the page glides (#6908) Two glides still aimed at a distance measured once: the comment card's room-making glide (`makeRoom`) and the thread card's glide that brings the user's turn into sight above New reply (`#fitAnswer`). With scroll anchoring held off during glides since #6904, layout that changed during the glide left each short: a card opening under its passage during a landing's glide got 150px less room than it asked for when 150px grew above the passage, and the turn ended 140px under New reply when a message above it grew 150px. `makeRoom` also replaced the landing's glide with a numeric one, dropping the landing's aim. Now a glide keeps its base (where its landing puts the box, or the offset asked for) apart from one placement distance (`glideBy`), which it reads with the box at the base at each frame. A later landing clears the placement, a later placement replaces it, and `makeRoom` re-reads what the card stands clear of (`attachmentClearance`, split out of `commentAttachment` so a frame scans no margin rows) through a function that answers false once the card closes. To weigh: a placement whose goal clamps at the box's end still leaves the box to it when a keeper asks for the end, as a landing's glide already did. Max asked for this after #6904. Tests: the new cases in `test_glides.py` and `test_card_reply.py` fail on main in Chromium and Firefox and pass here; `scrolling.test.mjs` covers the base and placement arithmetic. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Nov 24, 2026
…current API Main's follower is still the resting one #6008 landed; it moved its imports to the library and landing-scroll.js gained a glide's aim (#6904). Three files conflicted, each resolved to main's text with this branch's change made again: - packages/default/widgets/lf-code.js: main's imports, with `alreadyShown` and `scrollIntoView` dropped. `setScroll` left the package API (#6951), so the follower writes the pane's scroll with the browser's own `scrollTo`, asking `scrollMoves` (lib/scroll-range.js) first, as module-scroll-and-motion.md asks of a writer that may name the position its box holds. A line out of the band at an end of the pane is such a write. - browser/runtime/landing-scroll.js: `innerMoves` loses its `block` again and a `within` box lands at once, nearest. The glide's aim (`landingAim`) and the boxes a landing steers ask `innerMoves` without it. - browser/runtime/widget-api.js: main's exports, plus `alreadyShown`, which portable-api.js no longer exports and lf-trace reads. skills/leaf/references/module-scroll-and-motion.md merged clean and named `setScroll`; it names `scrollTo` now.
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.
A landing's glide aimed at the offset the landing computed at the press, so layout that changed during the 140 ms glide left the destination off: 22px where content grew above it, an end landing clipped by its destination's growth, and, where two changes partly cancelled in the page's height, a glide that took scroll anchoring's move for a hand's and stopped. On the merge film at phone width, pressing "merge" then "setup" left the film 708px above the window. Now a landing passes its glide an aim that re-runs the landing's own arithmetic each frame, a later landing takes over the glides in the boxes it would move, and scroll anchoring is held off on a box while a glide moves it, so only a clamp's move counts as layout's.
To weigh: holding anchoring off is an exception to browser/AGENTS.md's "Leaf turns anchoring off on no box the reader reads in", which the diff rewrites; Max asked for that call to be made here. Between frames, a read of
scrollGoalsees the last frame's goal, and comment placement and the thread card's reply placement still glide to a measured distance. Codex reviewed three rounds; its first replaced a node-following version.Max asked for this after #6893. Tests: the five layout cases and the second-landing case in
test_glides.pyand the film's two-press phone test fail on main and pass here, in Chromium and Firefox.test_beacon.py::test_the_beacon_stands_once_the_comment_box_s_field_leaves_the_windowfails locally on main too.