Repository navigation
Scroll: a wheel passes only to a region around the one under it, as Chromium chains a scroll - #1137
Conversation
…hromium chains a scroll #1123 started a wheel run on the innermost viewport under the pointer with room in its direction, searching every viewport under the point. A viewport that only lies beneath one (the timeline under the open / command list, which is drawn over it but is not inside it) took the wheel once the list reached its end, so the timeline scrolled behind an open menu. Chromium chains a scroll from the scroller under the pointer up its own ancestors; official's list (composer-suggestions) has none, and three notches at either end of it move nothing. Now the run starts on the innermost viewport under the pointer or the nearest of its scroll ancestors with room. The Shell console, a failed command's text and the View code script box are inside the region they hand on to, so they hand on as before.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
The chain up the ancestors started on the last viewport in tree order that contains the point. That is not what is painted on top there: a menu with no scroll view of its own over the timeline (every in-window menu on Windows, `popover::MENU`) let the timeline behind it scroll, and the peeked sidebar, raised over the timeline but before it in the tree, lost the wheel to it. The start is now `Runtime::chain_start`, shared with `gesture_chain`: the topmost hit (`hits`, in paint order), or a scroll view inside it; with no hit, the scroll view there. on_wheel routing and the scroll target now begin at the same element.
|
Answering
|
|
Old head, superseded by #1137 |
… paints there `chain_start` picked the topmost interactive hit in paint order, but the scroll view only as the last in tree order, and `hits` holds only what takes input. Over a raised list's section header or the gap between its rows, the run started on a hit beneath it and the timeline scrolled. Now the paint pass also lists, in the same order, every visible scroll view and every painted surface without a handler (`wheel_hits`), and a run starts at the topmost entry containing the point; a row inside a list paints after the list, so it still wins, and a box that paints nothing (a full-window layer) is never one. `find_map` skips an entry whose node is already gone. The start is found once per delta and handed on to the scroll (`WheelStart`).
|
Windows whole suite ( |
|
Answering the re-read at
|
…is drawn over others `wheel_hits` was filled by `register_node_hits`, which a release build's paint skips for every subtree it reuses, and `keep` restored `hits` and the other hit lists but not it: after a hover repaint, a wheel over a reused message's console box or a reused popover started on whatever lay beneath. It is now kept as `hits` is: a range in each `PaintRec`, swapped and twinned in the swap, opened, closed, copied and shifted with a reused subtree, and compared in a debug build's check. And of what takes no input, it now holds only the roots of what is drawn over others (an anchored overlay, a `raise()`d panel, a sticky element), not every filled box: a box without a handler elsewhere lets the wheel through, as one with `pointer-events: none` does.
|
Answering the third read at
|
|
Windows whole suite ( |
The bar's track draws over the viewport's right edge as its sibling (both in the `area` column), and since #1137 a wheel starts on the topmost hit and chains up its ancestors. So a wheel over the bar's strip started on the track, whose only ancestors were the area column and the window, and found no scroller: every scroll view lost wheel scrolling over its rightmost points, and a wide table lost its sideways wheel. `El::wheel_scrolls(key)` names the viewport an element's wheel belongs to, and the kit's bars name the viewport they follow. `scroll_in_chain` takes that hand-off before walking on, so it holds on both axes: a wheel over the bar scrolls the viewport it follows, then chains on up from it when that one is at its end, as a wheel over the viewport itself does. Chromium's scrollbar belongs to its scroller the same way; a press or drag on the bar is unchanged. The key is resolved in the element's own place, looked up inside the element itself and then its ancestors, innermost first, so panes and tables that key their viewports alike each take their own wheel (`markdown/table.rs` keys every wide table's viewport `scroll`). The first scope holding a match decides: one on its way out or inert hands the wheel nowhere rather than to another pane's. `in_scope`'s key-name scoping can't tell repeated keys apart, so the boundary is the tree's own subtree, while the match inside it is `named`, as `Tx::scroll_into_view` names one. `on_wheel` handlers under the pointer still hear the wheel first; one on the named viewport does not, since the pointer is over the bar and not the viewport. Fixes #1200.
) The bar's track draws over the viewport's right edge as its sibling (both in the `area` column), and since #1137 a wheel starts on the topmost hit and chains up its ancestors. So a wheel over the bar's strip started on the track, whose only ancestors were the area column and the window, and found no scroller: every scroll view lost wheel scrolling over its rightmost points, and a wide table lost its sideways wheel. `El::wheel_scrolls(key)` names the viewport an element's wheel belongs to, and the kit's bars name the viewport they follow. `scroll_in_chain` takes that hand-off before walking on, so it holds on both axes: a wheel over the bar scrolls the viewport it follows, then chains on up from it when that one is at its end, as a wheel over the viewport itself does. Chromium's scrollbar belongs to its scroller the same way; a press or drag on the bar is unchanged. The key is resolved in the element's own place, looked up inside the element itself and then its ancestors, innermost first, so panes and tables that key their viewports alike each take their own wheel (`markdown/table.rs` keys every wide table's viewport `scroll`). The first scope holding a match decides: one on its way out or inert hands the wheel nowhere rather than to another pane's. `in_scope`'s key-name scoping can't tell repeated keys apart, so the boundary is the tree's own subtree, while the match inside it is `named`, as `Tx::scroll_into_view` names one. `on_wheel` handlers under the pointer still hear the wheel first; one on the named viewport does not, since the pointer is over the bar and not the viewport. Fixes #1200.
What a user sees on
dev(since #1123): with an overlay open over the timeline, a wheel over the overlay scrolls the timeline behind it. This happens with the/command list, the@mention list, an in-window menu (every menu on Windows is drawn in the window) and the peeked sidebar. Three notches move the session 200 to 300 pt while the overlay stays open. Before #1123 nothing moved over the lists, and in official nothing moves.Cause: #1123 starts a wheel run on the innermost viewport under the point with room in its direction, searching every viewport there in tree order. A viewport that only lies beneath an overlay qualifies once the overlay's own list is at its end, fits, or there is none.
Fix: a run starts on what is on top under the pointer, then walks up its ancestors to the first vertical viewport with room, as Chromium chains a scroll.
wheel_hits,input/hit.rs): what takes input, every visible scroll view, and the roots of what is drawn over others: an anchored overlay (above), araise()d panel, a sticky element.Runtime::chain_starttakes the topmost entry that contains the point.pointer-events: nonedoes.hitsis (paint/keep.rs): a range in eachPaintRec, swapped and twinned in the swap, opened and closed, copied and shifted with a reused subtree, and compared in a debug build's check.gesture_chain(on_wheelrouting) andwheel_target(the scroll) share the start. It's found once per delta and handed on (WheelStart).Overlays over the timeline. Headless, Rune's own frames: three notches up at the overlay's top, a rest, eight down, a rest, one down. Official from a capture ticket (
official-overlays.ts): three notches at each end.This PR's rows are from a release-quick build with
RUNE_PAINT_KEEP_LOG=1. The pointer crosses the transcript first (for the peeked sidebar, its own rows), so the paint step reuses what didn't change: 294 to 506 nodes copied in one paint. The peeked sidebar is raised, so reuse is off there, as in the app.dev(3d037b49)/command list (40 commands: scrolls)@; a viewport that fits)/list closed by Escape mid-burstmodal(true)popover::MENU, no scroller: as the app menuThe app's popovers come from one surface (
session_view::popover). It takes a hit (on_press), and so does its scrim, so a wheel over a popover's body or padding starts on the popover. The app doesn't use the kit'sPopover.What #1123 fixed, still fixed (headless; this PR's column on the release-quick build, after the pointer crossed the transcript: 297 to 316 nodes reused in one paint). In each case the region that takes the hand-on contains the inner one.
devElsewhere, against Rune before #1123 (
route-regress.ts, headless: every scroll area of 23 surfaces, the same wheel at each). Plain transcript text, tool rows, a read, a patch, a wide diagram, a long summary, code blocks and tables wider than the timeline, Review's tree and diffs, a Markdown file, Settings and the open pickers are the same. The one difference is intended: the Settings/Page story's side list at its end hands the lone notch to the story's frame around it, where before nothing moved.Next, in a PR on top of this one:
fling,fling_xy, touch and the Windows page-scroll size get the same start and chain;pointer-events: none. The evidence (a grid of points over headers, fades, toasts, docks and side panels, ondev, on a fill rule and on official) goes there.