tooltip: Raise TooltipOverlay priority to float above dialog and popup layers (#2746)
Fixes an issue where tooltips triggered on elements inside a modal `Dialog` or dropdown `Popup` are rendered underneath the dialog backdrop and window. `TooltipOverlay` previously rendered with a hardcoded `with_priority(2)`. Because `Dialog` uses `with_priority(10 + self.layer)` and `Popup` uses `with_priority(POPUP_PRIORITY)` (`100`), any tooltip triggered inside a dialog or popup had a lower deferred rendering priority than the dialog itself, causing the tooltip to be occluded. - Define and export `pub const TOOLTIP_PRIORITY: usize = 200;` in `gpui_base::tooltip`. - Define and export `pub const DIALOG_PRIORITY: usize = 10;` in `gpui_base::dialog` to replace the magic number `10`. - Update `TooltipOverlay::render` to use `TOOLTIP_PRIORITY`. - Add unit test verifying `TOOLTIP_PRIORITY > POPUP_PRIORITY > DIALOG_PRIORITY`. `cargo test -p gpui-base` `cargo test -p gpui-component` Closes #[issue number] ## Description Describe in English for the changes made in this pull request and the problem it solves. Please keep **1 PR to solve 1 problem**, and keep **Small improvements should be small modifications** to make PR easier to review and to merge. ## Screenshot **Before** <img width="216" height="105" alt="image" src="https://github.com/user-attachments/assets/e05dab81-09d6-4e77-9238-3b0f0771262b" /> **After** <img width="199" height="105" alt="image" src="https://github.com/user-attachments/assets/3751fd4c-f627-4e78-b59a-37c41f909715" /> ## Break Changes None ## How to Test Run the test suites across `gpui-base` and `gpui-component`, including the newly added layer priority regression test: ```bash # Run gpui-base tests (verifies tooltip_priority_exceeds_dialog_and_popup_layers) cargo test -p gpui-base ```` ## Checklist - [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) 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)
C
Charles Wu committed
c7f5877cf682634e0ad28532521bfe450f6619e1
Parent: 2a1335d
Committed by GitHub <noreply@github.com>
on 8/17/2026, 8:30:25 AM