Repository navigation
fix: choose a submenu item opened from the App menus tray - #944
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 2 files
You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
The tray ignored clicks only in its direct child windows. A submenu of a menu opened from the tray sits two windows above it, so a mouse-down there closed the tray, and with it the menu and the submenu, before the item was chosen. Clicks there now count as inside the tray, while Escape there still closes it. Fixes #942 Co-Authored-By: Claude Opus 5.5 <[email protected]>
acc54f7 to
e569b6c
Compare
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
M4n0x
left a comment
There was a problem hiding this comment.
Fix looks right to me, walking the whole parent chain is the way to go and Escape still closes the tray like on main. The test needs another approach though, see inline, it's what broke the other popup tests in your full runs (+ worth updating that part of the description once it's changed)
NSApp.sendEvent runs every local monitor in the test process, so the test closed popups that tests running alongside it had open. The monitor's logic is now WidgetPopup.consumes, which the monitor and the test both call. The test also drops a check on the menu that could never fail, and stops at its first failure instead of sending a key press to a closed popup. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Before and after
202 unchanged screens
Visual review: 202 screens, none changed. |
M4n0x
left a comment
There was a problem hiding this comment.
Nice, reads better with consumes too. Tried it in a VM with VS Code, View > Appearance > Status Bar from the tray toggles it now (on main the tray just closes), and Escape in the submenu still closes everything
## [0.20.0](v0.19.0...v0.20.0) (2026-11-29) ### Features * animate widgets that a profile shows or hides ([#948](#948)) by @M4n0x ([eec8544](eec8544)), closes [#947](#947) [#947](#947) * log quit causes and show unexpected quits in Status ([#953](#953)) by @M4n0x ([ea5a64e](ea5a64e)), closes [#952](#952) ### Bug Fixes * choose a submenu item opened from the App menus tray ([#944](#944)) by @MaHofseth ([add49b0](add49b0)), closes [#942](#942) * draw borders in whole pixels so they keep every edge on 1x screens ([#934](#934)) by @M4n0x ([8590fcd](8590fcd)), closes [#933](#933) [#933](#933) * keep a package version installed when its folder is hidden ([#962](#962)) by @M4n0x ([2d97d15](2d97d15)), closes [#961](#961) * keep the Sound details open and smooth when picking a device ([#931](#931)) by @M4n0x ([df96453](df96453)), closes [#928](#928) [#928](#928) * keep windows clear of the bar after a double-click fills them ([#936](#936)) by @M4n0x ([c1478d1](c1478d1)), closes [#935](#935) [#935](#935) * leave the keyboard with the app while StableBar shows its menus ([#943](#943)) by @MaHofseth ([abc1c4f](abc1c4f)), closes [#941](#941) * play an app's first sound at its mixer volume ([#899](#899)) by @M4n0x ([2c38350](2c38350)), closes [#897](#897) [#897](#897) * show a turned-off widget's last output when it comes back ([#950](#950)) by @M4n0x ([6776fcb](6776fcb)), closes [#949](#949) [#949](#949) * show Countdown and Join in Settings after picking it ([#940](#940)) by @MaHofseth ([6ecaa72](6ecaa72)) * stop offering a package update that is already installed ([#956](#956)) by @M4n0x ([4592ebc](4592ebc))
|
🎉 This PR is included in version 0.20.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Problem
With Expand on hover on and too little room for the menus to expand, App menus open from a tray under the bar. Pressing the mouse in a submenu opened from there closed the tray, and with it the menu and the submenu, before the mouse came up, so the item wasn't chosen.
Fixes #942
Changes
NSWindow.isDescendant(of:). Key presses from those windows still reach it, so Escape in such a submenu closes the tray, as onmain; the popup's own child windows keep the rule they had.WidgetPopup.consumes(_:anchor:), so the test can give an event to one popup.No configuration property changes, and nothing looks different.
Testing
aClickInASubmenuLeavesTheTrayItsMenuOpenedFromOpen(AppMenuTrayClickTests.swift) opens a real tray, a menu popup anchored in it and a submenu window attached to the menu, then gives the tray's handler a mouse-down in the submenu. The tray must stay open. Then either Escape in the submenu or a mouse-down in an unrelated window must close it. Without the descendant check, both cases fail.NSApp.sendEvent, which runs every local monitor in the test process, so it closed popups that other tests had open. As the review found, that broke other popup tests in the full runs. This description earlier suggested clicks in other apps, which was wrong.swift build --build-tests,scripts/check.sh --quickand commitlint pass.tooltipsThatTakeThePointerLeaveClicksOnTheirWidgetToIt, which also fail on an unchanged 8590fcd on the same Mac.swift test, 1,462 tests) fails only those andworkspaceLabelsFollowTheBarFromLightToDark, which also fails on unchanged 8590fcd there. With fix: leave the keyboard with the app while StableBar shows its menus #943 merged too, on 1fe18ea, the full suite (1,476 tests) fails only the same two.no active windowline. Because the build had both fixes, this doesn't isolate this one. Escape in a submenu wasn't checked by hand.Merging
One
fixand onetestcommit, so a patch release. A squash merge works best. It merges cleanly with #943, the fix for #941, which changes another part ofWidgetPopup.swift.🤖 Generated with Claude Code
Claude Sonnet 5.5 and Claude Opus 5.5 via Claude Code