Skip to content

tooltip: Fix direction-dependent switching between triggers - #3501

Open
mrkishi wants to merge 1 commit into
longbridge:mainfrom
mrkishi:push-svqlxpuyyqqk
Open

mrkishi wants to merge 1 commit into
longbridge:mainfrom
mrkishi:push-svqlxpuyyqqk

Conversation

@mrkishi

@mrkishi mrkishi commented Oct 13, 2026

Copy link
Copy Markdown

Description

Moving from an earlier tooltip trigger to a later sibling can show the new tooltip before the old trigger processes hover-leave. The stale leave then hides the new tooltip after the grace period, or cancels its pending show delay.

Track the current managed tooltip trigger by its scoped GPUI element identity and ignore hover-leave requests from other triggers. Keep the existing timing, transitions, and press-dismissal behavior. This change is internal to gpui-component and adds no public API.

How to Test

Validation:

  • Added headless pointer interaction tests for switching in both directions, moving during the initial show delay, and dismissal after re-rendering.
  • Both regression tests fail against the original implementation and pass with this fix.
  • All 8 tests selected by cargo test -p gpui-component --lib tooltip::tests --locked pass, including the existing press-dismissal tests.
  • cargo fmt --all --check, git diff --check, and cargo clippy -p gpui-component --lib --tests --locked -- --deny warnings pass.
  • All other preexisting tests also pass, unaffected.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

Disclosure

Implementation and regression tests prepared with Codex.

Moving from an earlier tooltip trigger to a later sibling can show the new tooltip before the old trigger processes hover-leave. The stale leave then hides the new tooltip after the grace period, or cancels its pending show delay.

Track the current managed tooltip trigger by its scoped GPUI element identity and ignore hover-leave requests from other triggers. Keep the existing timing, transitions, and press-dismissal behavior. This change is internal to gpui-component and adds no public API.

Validation:
- Added headless pointer interaction tests for switching in both directions, moving during the initial show delay, and dismissal after re-rendering.
- Both regression tests fail against the original implementation and pass with this fix.
- All 8 tests selected by `cargo test -p gpui-component --lib tooltip::tests --locked` pass, including the existing press-dismissal tests.
- `cargo fmt --all --check`, `git diff --check`, and `cargo clippy -p gpui-component --lib --tests --locked -- --deny warnings` pass.

Implementation and regression tests prepared with Codex.
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