refactor(menubar): shared prompt/dismissal component [P17.02]#170
Open
cesarnml wants to merge 7 commits into
Conversation
Asserts exact FloatingPetPromptItem titles and order for Own and Minimalist capability rows from docs/contracts/window-capability-matrix.md §1. Fails to compile: FloatingPetPromptBuilder/Capabilities/Handlers do not exist yet.
Introduces FloatingPetPromptBuilder.items(capabilities:handlers:) as the single [FloatingPetPromptItem] constructor, parameterized by named matrix capabilities (docs/contracts/window-capability-matrix.md §1) rather than shape identity. FloatingPetInteractionView.presentHidePrompt and MinimalistBadgeView.presentHidePrompt both route through it, reproducing the current per-shape item lists verbatim. Introduces FloatingPetPromptDismissal, adjacent to FloatingPetPromptCoordinator, as the single global-mouse/local-mouse/ global-keyboard/resign-active dismiss-on-click-away observer stack. Replaces three hand-rolled copies: FloatingPetInteractionView's hide prompt, MinimalistBadgeView's hide prompt, and MinimalistBadgeView's panel-size pill. Drops the dead NSWindow.didResignKeyNotification observer per matrix row R1.11 (both panels are non-activating and can never become key). xcodegen regenerated to register the two new source files.
…nt-review]
FloatingPetPromptDismissal.uninstall() gated all cleanup on `owner`
being non-nil. Weak references to self are already nil by the time
self's own deinit body runs (confirmed empirically), so calling
uninstall() from a presenting view's deinit — the only call site on
that path — silently skipped removing the NotificationCenter observer
and three NSEvent monitors. Each dead monitor keeps firing a harmless
but wasted [weak self] no-op on every future mouse/keyboard event
app-wide, forever, for every prompt/pill ever presented.
Decouples monitor/observer teardown from the owner-nil check (only the
coordinator hand-off needs a live owner identity — the coordinator's
own weak activeOwner self-clears regardless) and adds a defensive
deinit { uninstall() } on FloatingPetPromptDismissal itself as a
backstop for any future caller that skips an explicit uninstall().
Also adds the Minimalist plain-origin-labeled exact-array builder test
mirroring the existing Own case, closing a coverage gap the review
flagged in Advisory Observations.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
P17.02 Shared prompt/dismissal componentagents/p17-01-capability-matrix-drafted-from-code-developer-dispositionedcleancompleted at 2026-07-12 06:16 UTCcleancompleted at 2026-07-12 06:25 UTC