Repository navigation
Hear a native scrollIntoView as the script's write it is - #6951
Merged
Merged
Conversation
# Conflicts: # browser/AGENTS.md # browser/runtime/kernel-registry.json # packages/default/widgets/lf-tabs.js # packages/playwright/widgets/timeline.js
…te, a browser-driven scroll stays the browser's, lint reads every form of the call
…ead the target itself, wrap scrollIntoViewIfNeeded
leaf-agent
approved these changes
Nov 24, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 24, 2026
…t by its source text (#6987) `test_sample_browser_boundary_contains_focus_scroll_and_parent_access` has failed on main since #6951 (`fb8b0cc1e7`): it passes at that commit's parent and fails from it on. #6951 made `Element.prototype.scrollIntoView` Leaf's wrap around the browser's method in every Leaf document, a live sample's included, and the test asserted that the method's source text reads `[native code]`. What that assertion stood for still holds: a reveal a sample's script makes itself does what the browser's does. The test now makes that call and checks what it moves, which is the sample's own page and, through the sample's frame, the page around it. Leaf's own `scrollIntoView` leaves the page around the sample still, as the test already checked. `focus` keeps its source-text check, since nothing wraps it. No runtime code changes. To weigh: the new check relies on the browser scrolling the host page for a reveal made inside a sandboxed frame, as Chromium and Firefox both do today. `module-scroll-and-motion.md` already says that Leaf's `scrollIntoView`, unlike the native one, stays inside a live sample. The session running the package-interface redesign asked for this, after an agent found six browser tests failing on main. This is the only one of the six that a pull request of the redesign caused; the others trace to #6796, #6947 and #6009 and are left alone. Max hasn't read the diff. Tests: the test by node id in Chromium, also under `--cpu-throttle 8`, and its body in Firefox with the fixture swapped by hand. It fails when the wrap drops the browser's call, and when the script's call is swapped for Leaf's contained one. > _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.
One step of the package-interface redesign, after #6942: Leaf hears a native
scrollIntoViewtoo.arrivals.jswraps it, and Chromium'sscrollIntoViewIfNeeded, and records each box the call moved at once, as it records ascrollTo. A smooth reveal is still heard by its events. Before, a reveal's boxes read as the browser's own motion from theirscrollevents toscrollend.To weigh:
Max approved the redesign and asked for small steps; he hasn't read this diff. A fresh agent reviewed it.
Tests: pre-commit,
pnpm run check, 146 browser tests by node id, 18 holds-still cases,leaf-dev probe --basein both engines.