fix(scroll-area): let inspector picking see through the scrollbar layer - #54
Merged
Merged
Conversation
The scrollbar overlay stretches a transparent element across the whole viewport, purely so its two tracks have something to be absolute inside. Painted after the content, that element is the topmost hitbox at every point of the surface — and inspector picking takes the topmost hitbox that carries an inspector id. So the inspector answered "scrollbar" for every row of every list. Measured on a terminal that documents its own interface through the inspector: six scrollable surfaces — the Connections core table, the Screener and Orders tables, the Profit Monitor rows, the strategy tree and the detect feed — were all recorded at the size of their panel instead of their bar, and not one control inside any of them was ever named. Neither half of the obvious fix works. Dropping the layer's id changes only the name it reports: an InspectorElementId comes from the element's source location (element.rs), not from `.id()`. And a hitbox is not optional either, because picking deliberately gives one to every element so that any of them can be selected (div.rs). So gpui gains the missing third option beside `occlude` and `block_mouse_except_scroll`: an element may declare that picking looks straight through it. It changes nothing outside picking — a decorative layer has no listener, no hover style and no cursor, so it took no hitbox in an ordinary frame either way, and the mouse has always passed through it.
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.
The scrollbar overlay stretches a transparent element across the whole viewport, purely so its two tracks have something to be absolute inside. Painted after the content, that element is the topmost hitbox at every point of the surface — and inspector picking takes the topmost hitbox that carries an inspector id. So the inspector answered "scrollbar" for every row of every list.
Measured, on a terminal that documents its own interface through the inspector: six scrollable surfaces — the Connections core table, the Screener and Orders tables, the Profit Monitor rows, the strategy tree and the detect feed — were all recorded at the size of their panel instead of their bar, and not one control inside any of them was ever named. With this change the same pass names
act-u1,win-u1,del-u1,rec-u1,feed-u1:triggerat their own rectangles.Why neither obvious fix works
.id()changes only the name it reports: anInspectorElementIdcomes from the element's source location (element.rs:403), not from.id().div.rs,should_insert_hitbox).So gpui gains the missing third option beside
occludeandblock_mouse_except_scroll:InteractiveElement::inspector_transparent— an element may declare that picking looks straight through it.Nothing changes outside picking. A decorative layer has no listener, no hover style and no cursor, so it took no hitbox in an ordinary frame either way, and the mouse has always passed through it.
Checks
tools\run-component-guardrails.ps1— PASScargo test -p moon-gpui— 179 + 1 passed (required: this touches the runtime)