Skip to content

fix: keep pressed tooltips hidden and make sidebar rows contiguous - #119

Merged
kirillDevPro merged 2 commits into
masterfrom
fix/tooltip-press-sidebar-hit
Oct 14, 2026
Merged

kirillDevPro merged 2 commits into
masterfrom
fix/tooltip-press-sidebar-hit

Conversation

@kirillDevPro

Copy link
Copy Markdown
Collaborator

What & why

  • Tooltip after a press. A press on a tooltip's trigger left a pending (WaitingForShow) tooltip alive, so a right-click that opens a context menu was followed half a second later by the cell's tooltip drawn over the menu. A press over the trigger now moves the tooltip to SuppressedUntilMouseLeaves, cancelling a pending show and hiding a visible non-hoverable one; leaving the trigger re-arms it. Hoverable tooltips and presses elsewhere are unchanged.
  • Sidebar hit rows. SidebarMenu spaced items with gap_2 while each item's click covered only its inner 28 px plate, leaving dead strips between items. The spacing now lives inside each item as padding, so hit rows are contiguous; the visible plate, pitch and look are unchanged (collapsed layout too).

How to verify

  • Right-click a cell that has a tooltip: the menu opens and no tooltip appears over it.
  • Click between two sidebar items: one of them is selected.

Tests: new regressions in elements/div/tests.rs and sidebar/menu/tests.rs; moon-gpui and moon-ui-components suites green locally. Both behaviours checked in a downstream app build.

@kirillDevPro
kirillDevPro merged commit 0c4a7c4 into master Oct 14, 2026
2 of 4 checks passed
@kirillDevPro
kirillDevPro deleted the fix/tooltip-press-sidebar-hit branch October 14, 2026 11:35
kirillDevPro added a commit that referenced this pull request Oct 16, 2026
What was stale: MOON_PATCH_QUEUE lists the Moon GPUI patches a Zed
re-sync must keep, but the tooltip entry described only the 800 ms
show delay, the five-second expiry and hoverable persistence. #119
(0c4a7c4) added a Moon-only behaviour that a re-sync would silently drop.

What the code does now: a mouse press on a regular tooltip's trigger
replaces its state with SuppressedUntilMouseLeaves (hiding it or
cancelling a pending show); TooltipTrigger::check_can_show gates showing
while check_is_hovered alone clears the suppression once the pointer
leaves, even with the button held. Upstream only cleared the tooltip on
press and let the next pointer move after release schedule it again.

Verified against crates/moon-gpui/src/elements/div.rs
(register_tooltip_mouse_handlers, handle_tooltip_mouse_move) and the
pre-change code in 0c4a7c4^. cargo xtask component-mirror and
component-audit --check-baseline both PASS.

Reviewer: Codex. It disputed the first wording of the upstream sentence
(release does not itself reschedule; the next pointer move does); the
sentence was corrected to match.
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