fix(mac): keep right-click status-item menu open and stable#803
Open
hyknerf wants to merge 2 commits into
Open
fix(mac): keep right-click status-item menu open and stable#803hyknerf wants to merge 2 commits into
hyknerf wants to merge 2 commits into
Conversation
Present the context menu on rightMouseUp (not down) so the matching mouse-up no longer dismisses it, and open via statusItem.menu + performClick so AppKit tracks the menu under the status item instead of manual popUp (which scrolled the Today row away on mouse move). Clears statusItem.menu in menuDidClose so left-click still opens the popover. Debounce + legacy rightMouseUp path retained for macOS <= 26. Closes getagentseal#802
Extract StatusItemContextMenuPolicy (event mask, debounce, presentation mode) and unit-test it so rightMouseUp + statusItemMenu cannot regress to the flash/scroll-jump paths without a failing test.
Author
|
Added unit tests for the extractable policy behind this fix:
AppKit open/track/dismiss still needs a manual smoke (no good headless seam for |
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
rightMouseDown; matchingrightMouseUpdismissed the menu. Monitor is nowrightMouseUp.NSMenu.popUp(at:in:)tracked poorly while the cursor sat on the status item. Open viastatusItem.menu+performClickinstead; clear the menu inmenuDidCloseso left-click still opens the popover.Context
#472 restored right-click on macOS 27 with a global monitor +
popUp, but presentation on mouse-down caused the flash. #509 triedheight + 6anchoring to avoid scroll;NSStatusBarButtonis flipped and manualpopUpstill engaged scroll mode on mouse move.#472 avoided
statusItem.menu+performClickbecause the right-mouse action never runs on 27. We still open from the global monitor (or legacy action on ≤26); oncestatusItem.menuis set,performClickonly means "open the attached menu" and works on 27.Test plan
./mac/Scripts/package-app.sh devsucceeds (Xcode 26.6 / Swift 6.3)0x10(rightMouseUp) and referencesperformClick^/ scroll away Today row; Settings / Quit workNotes
mac/Sources/CodeBurnMenubar/CodeBurnApp.swiftnpm testN/A for this diff