Dismiss tooltips when owner windows change lifecycle#564
Open
0xNino wants to merge 1 commit into
Open
Conversation
Author
|
CI appears to have hit two unrelated CodeMap test flakes:
All other checks pass. This PR changes only Could a maintainer rerun the failed shard 4 job? |
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.
Summary
hide()pathCloses #563.
Root cause
The shared tooltip overlay is a standalone borderless
NSWindowat.floatinglevel. It previously observed onlyNSWindow.willCloseNotification.SwiftUI popovers may be ordered out or resign key-window status without closing their backing window. The tooltip could therefore outlive the MCP Server popover, remain at its previous screen coordinates, and float above unrelated windows.
Scope
This is intentionally a one-file lifecycle fix in
TooltipOverlayController.It supersedes the broader approach from #227, which added a global dismiss coordinator, MCP-specific calls, invalid-anchor handling, and a new test suite. This change does not alter MCP behavior, add a parallel tooltip authority, or reintroduce child-window hierarchy behavior.
Validation
make guardrails— passedTooltipOverlayController.swift— passed; 0/1 files require formattingTooltipOverlayController.swift— passed; 0 violationsmake dev-swift-build PRODUCT=RepoPrompt— passedmake dev-build— passed; patched debug app built, signed, and packagedcommitandpushpreflights — passed, including staged/outgoing secret scans and guardrailsThe computed-outgoing-range
pr-readylane reached the repository-wide SwiftFormat baseline mismatch and stopped on thousands of findings in untouched files. The changed file passes both scoped SwiftFormat and strict SwiftLint.No new XCTest is included because reposting AppKit notifications would test the observer implementation rather than the SwiftUI popover/order-out lifecycle that produces the visual defect. The real UI lifecycle was exercised directly.
Screenshot
The current before screenshot will be attached to #563. No after screenshot is included because the corrected behavior is the absence of the detached tooltip.