Repository navigation
Hear every script's scroll write, and take setScroll out of the package API - #6942
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
leaf-agent
previously approved these changes
Nov 24, 2026
leaf-agent
approved these changes
Nov 24, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 24, 2026
One step of the package-interface redesign, after #6942: Leaf hears a native `scrollIntoView` too. `arrivals.js` wraps it, and Chromium's `scrollIntoViewIfNeeded`, and records each box the call moved at once, as it records a `scrollTo`. A smooth reveal is still heard by its events. Before, a reveal's boxes read as the browser's own motion from their `scroll` events to `scrollend`. To weigh: - **A fix to #6942.** Chromium's scroll calls return a promise, which the wrap on main drops; a heard call now returns what the browser's returns. - **Cost**: a reveal that moves its pane goes from 4 to 11 µs four boxes deep and 4 to 33 µs thirty-four deep in Chromium; 4 to 12 and 2 to 14 in Firefox. - **Limits**: a target slotted into a closed shadow tree, and a focus's or a fragment's reveal, are heard by events only. - The package API keeps its 164 names. 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 --base` in both engines. > _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.
One step of the package-interface redesign: Leaf hears a scroll write made with the browser's own call, so
setScrollleaves the package API (177 names to 176) and packages writebox.scrollTo(…).arrivals.jswrapsscrollTo,scroll,scrollByand thescrollTopandscrollLeftsetters, on elements and the window, and records a move assetScrolldoes. Another vendor's component is heard too; before, its write read as the browser's own motion untilscrollend.To weigh:
scrollMovesmoves to the library, where three packages ask it, restatingsetScroll's skip at each caller.leaf-dev benchreads a keystroke, wheel step, walk and Tab within noise.behavior.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, 304 browser tests by node id, 18 holds-still cases,leaf-dev probe --basein both engines.