Skip to content

fix(scroll-area): let inspector picking see through the scrollbar layer - #54

Merged
guyverino merged 1 commit into
masterfrom
fix/inspector-transparent-overlay
Aug 27, 2026
Merged

fix(scroll-area): let inspector picking see through the scrollbar layer#54
guyverino merged 1 commit into
masterfrom
fix/inspector-transparent-overlay

Conversation

@guyverino

Copy link
Copy Markdown
Collaborator

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:trigger at their own rectangles.

Why neither 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:403), not from .id().
  • A hitbox is not optional either — picking deliberately gives one to every element so that any of them can be selected (div.rs, should_insert_hitbox).

So gpui gains the missing third option beside occlude and block_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.ps1PASS
  • cargo test -p moon-gpui — 179 + 1 passed (required: this touches the runtime)
  • The new test was confirmed to fail with the flag's term removed, before being kept.
  • Visual snapshot gate not run — it opens a gallery window.

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.
@guyverino
guyverino merged commit 85680ab into master Aug 27, 2026
2 checks passed
@guyverino
guyverino deleted the fix/inspector-transparent-overlay branch August 27, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant