Dismiss hover tooltips when MCP toolbar buttons open a surface#227
Open
0xNino wants to merge 1 commit into
Open
Dismiss hover tooltips when MCP toolbar buttons open a surface#2270xNino wants to merge 1 commit into
0xNino wants to merge 1 commit into
Conversation
Clicking the MCP connections counter or server toggle could leave a hover tooltip floating over the freshly opened status window/popover: the tooltip's auto-dismiss paths (hover-exit and the click/scroll/key event monitors installed only after it becomes visible) don't fire when a new window steals focus under the cursor, and the tooltip renders at .floating level so it sits on top of the new surface. - Add HoverTooltipCoordinator.dismissAll() posting a notification that both HoverTooltipModifier and TooltipOverlayController observe; the modifier cleanup cancels pending-but-unshown tooltips as well as hiding visible ones. Call it from the two MCP toolbar buttons. - Guard show()/reposition() against empty or non-finite anchor rects so a stale .zero geometry report no longer snaps the bubble to the owner window's bottom-left corner; hide instead. - Refactor observer install/teardown so the new dismiss observer is cleaned up alongside the owner-will-close observer. Add TooltipOverlayControllerTests covering dismiss-all and the invalid-anchor show/reposition paths.
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.
Problem
Clicking the MCP connections counter (the green link/count pill) or the MCP Server toggle in the toolbar could leave a hover tooltip floating over the freshly opened status window / popover.
Why it sticks:
onHover(false)) and the click/scroll/key event monitors — but those monitors are installed only after the tooltip becomes visible (after the 300 ms hover delay). A click that lands during that delay can't dismiss it.onHover(false)never fires..floatingwindow level, so it sits on top of the newly opened surface — very visibly stuck until the next unrelated click/scroll/keypress.A second, related failure: a stale/empty anchor geometry report (e.g.
.zeroduring a layout/window transition) fedowner.convertToScreen(.zero), snapping the bubble to the owner window's bottom-left corner.Fix
HoverTooltipCoordinator.dismissAll(), which posts a notification observed by bothHoverTooltipModifierandTooltipOverlayController. The modifier-side cleanup cancels a pending-but-unshown tooltip as well as hiding a visible one. The two MCP toolbar buttons call it before opening their surface.show()/reposition()against empty or non-finite anchor rects — hide instead of mispositioning to the window origin.Tests
Adds
TooltipOverlayControllerTestscovering dismiss-all and the invalid-anchorshow/repositionpaths.Validation
make dev-lint— 0 violations (format-check + SwiftLint strict)make dev-test— full suite green (run via push preflight); new suite passes, stable across repeated runsmake dev-swift-build PRODUCT=RepoPrompt— cleancommitandpushmodes (staged-index + outgoing-range secret scans)UI-only change; does not touch MCP CLI/server, Agent Mode, or packaging.
Screenshot
This shows the issue: the MCP status surface opens while the hover tooltip remains floating over any app.