Add shortcut display to the menu - #42
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new status-bar menu entry to surface a “Keyboard Shortcuts” dialog, so developers/users can view current shortcut bindings without referencing the README. It also strengthens self-tests around status-menu correctness and wiring.
Changes:
- Add “Keyboard Shortcuts” to the status menu and wire it to a new
AppController.showShortcutsaction. - Implement a shortcuts summary dialog that reads current global hotkeys from the settings store and presents in-mode key hints.
- Extend self-tests to validate the new menu ordering and ensure all menu actions are wired to
AppController.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Sources/ZoomItMacCore/SelfTest/SelfTestRunner.swift | Adds a regression test to ensure status-menu actions are wired and updates expected menu order to include “Keyboard Shortcuts”. |
| Sources/ZoomItMacCore/App/AppDelegate.swift | Inserts the new “Keyboard Shortcuts” entry into the status-menu entry list. |
| Sources/ZoomItMacCore/App/AppController.swift | Adds the menu action and implements the shortcuts dialog UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@microsoft-github-policy-service agree |
Fixed a potential issue which can trigger ambiguous-layout warnings and may cause the accessory text to size/position incorrectly Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (3)
Sources/ZoomItMacCore/App/AppController.swift:104
- DemoType uses
0as a disabled sentinel (SettingsWindowController.demoTypeHotKeyDisplayString()returns “None” when the code is 0). This dialog should match that behavior for both the Start and Reset variants.
let demo = describe(code: settings.demoTypeHotKeyCode, modifiers: settings.demoTypeHotKeyModifiers)
let demoReset = describe(
code: settings.demoTypeHotKeyCode,
modifiers: settings.demoTypeHotKeyModifiers ^ NSEvent.ModifierFlags.shift.rawValue
)
Sources/ZoomItMacCore/App/AppController.swift:84
describe(code:modifiers:)treats keyCode0as “None”, but elsewhere in the codebase keyCode0is a valid key (“A”) for most hotkeys (seeSettingsWindowController.keyNames[0]). Only some hotkeys (e.g. Snip OCR / DemoType) use0as a disabled sentinel. As written, this dialog will incorrectly display “None” if the user binds any non-optional hotkey to the A key.
func describe(code: Int, modifiers: UInt) -> String {
guard code != 0 else { return "None" }
return SettingsWindowController.describe(
keyCode: code,
modifiers: NSEvent.ModifierFlags(rawValue: modifiers)
Sources/ZoomItMacCore/App/AppController.swift:94
- Snip OCR uses
0as a disabled sentinel (SettingsWindowController.snipOcrHotKeyDisplayString()returns “None” when the code is 0). After fixingdescribe(...)to treat 0 as a real key code, this line should preserve the “None” behavior for the disabled Snip OCR shortcut.
This issue also appears on line 100 of the same file.
let snipOcr = describe(code: settings.snipOcrHotKeyCode, modifiers: settings.snipOcrHotKeyModifiers)
|
good idea! |


Added a menu item to quickly display all the shortcuts supported by this app. I had to revert to the repo readme.md file every time I wanted to try something out, so this may be helpful.