Repository navigation
fix: leave the keyboard with the app while StableBar shows its menus - #943
Conversation
App menus, their tray and their submenus took the keyboard when clicked, so the app in front had no key window when StableBar pressed the chosen item. VS Code drops a menu command then, so File > Open Folder and New Text File did nothing. They now leave the keyboard with the app, as native menus do, unless the bar has it already, as under --focus. Escape still closes them: StableBar watches for it while the app gets it. Fixes #941 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
No issues found across 5 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].
Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more
Re-trigger cubic
|
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.
Nice, the new test fails without the fix and passes with it, and the whole suite is green locally (CI hasn't run yet). One blocking thing with the Option alternates, the rest is small
issue (blocking): Option alternates don't follow Option anymore. AppMenuList only listens to .flagsChanged with a local monitor, and StableBar doesn't get modifier events once the menu isn't key. So pressing Option with the Apple menu open does nothing, and if you open it with Option held then let go, Restart (the one without confirmation) stays in the menu and can be clicked. A global .flagsChanged monitor next to the local one should fix it, we have Accessibility anyway at that point
thought: a menu opened under --focus still has the keyboard when the item gets pressed, so VS Code should still drop the command there, fine for a follow-up issue imo
A menu that leaves the keyboard with the app gets no modifier events, so holding Option showed no alternates, and one opened with Option held kept them after Option was let go, such as Restart without its confirmation. A global monitor now hears Option too. Also test that a submenu leaves the keyboard like its menu, and say in the guide what differs from a native menu. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Thanks, good catch on Option. Fixed in 526a174 with a global |
Before and after
202 unchanged screens
Visual review: 202 screens, none changed. |
M4n0x
left a comment
There was a problem hiding this comment.
Option follows again, tried it in a VM with the Apple menu, alternates show while held and go back on release. File > New Text File from the bar works in VS Code now (does nothing on main), Escape closes the menu. LGTM, --focus case as a follow-up
## [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
Choosing an item in App menus did nothing in VS Code, such as File > Open Folder or File > New Text File, and New Tab in Ardia closed right after it opened. StableBar's menus took the keyboard when clicked, so the app in front had no key window when StableBar pressed the item, and VS Code drops a menu command then.
Fixes #941
Changes
PopupPanel.leavesKeyboardkeeps a panel from becoming key. It's set on popups whose block is an app menu, which covers an app's menus, the » menu and the menus of menu bar items shown in the bar, and on the App menus tray and on submenus opened from a menu that has it. It stays off when the window the menu opens from has the keyboard, as under--focus, so menus opened from the keyboard can still be moved through. A menu opened from the menu bar items list still takes the keyboard, as before, because the list has it.WidgetPopuporders such a panel in without making it key, and a click inside it no longer makes it key.No configuration property changes, and nothing looks different.
Testing
anAppsMenusNeverTakeTheKeyboardFromTheApp(AppMenuKeyboardTests.swift) checks that the tray, a menu opened from it, that menu's submenu and a menu opened from the bar can't become key, while a widget's own popup still can. Without the first version of the fix, it failed for the tray and both menus; without the line that passes the setting to submenus, the submenu check fails.swift build --build-testspasses. The full suite (swift test, 1,462 tests) passes exceptworkspaceLabelsFollowTheBarFromLightToDarkand the three cases oftooltipsThatTakeThePointerLeaveClicksOnTheirWidgetToIt. Both tests also fail on an unchanged 8590fcd on the same Mac. With fix: choose a submenu item opened from the App menus tray #944 merged too, on 1fe18ea, the full suite (1,476 tests) fails only those.scripts/check.sh --quickand commitlint pass.menubar#runActionInRenderer: no active window found. With a development build that has this fix (it also had Clicking a submenu item from the App menus tray closes the menus without choosing it #942's fix and fix: show Countdown and Join in Settings after picking it #940's commits), the same click, File > Open Folder, and New Text File through the tray all ran, and VS Code logged each command. Ardia's New Tab stayed open, and Escape closed an open menu.--focus(they still take the keyboard, as before), VoiceOver, and the Apple menu and menu bar item menus in a running app.Merging
Two
fixcommits, so a patch release. A squash merge keeps one changelog line. It merges cleanly with #944, the fix for #942, which changes another part ofWidgetPopup.swift.🤖 Generated with Claude Code
Claude Sonnet 5.5 and Claude Opus 5.5 via Claude Code