Skip to content

Fix menu-bar manager conflict, first-launch Settings, and hotkeys while Settings open - #28

Open
jldeen wants to merge 2 commits into
microsoft:mainfrom
jldeen:jldeen-fuzzy-chainsaw
Open

Fix menu-bar manager conflict, first-launch Settings, and hotkeys while Settings open#28
jldeen wants to merge 2 commits into
microsoft:mainfrom
jldeen:jldeen-fuzzy-chainsaw

Conversation

@jldeen

@jldeen jldeen commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Fixes three related menu-bar / Settings issues that together made ZoomIt hard to reach and configure, especially alongside third-party menu-bar managers.

1. Menu-bar icon fights menu-bar managers (Bartender) — fixes #27

AppDelegate.makeStatusItem set an autosaveName, which makes AppKit persist and re-assert an absolute menu-bar X position on every relaunch/relayout. Managers like Bartender and Ice bucket items by position, so the icon kept snapping back out of the user's chosen section and wouldn't stay put. Removed the autosaveName so the system places the item and managers can organize it freely. Verified across multiple clean launch/quit cycles that no NSStatusItem Preferred Position key is written afterward.

2. Fresh install doesn't open Settings — fixes #21

On a brand-new install the app launched menu-bar-only with no visible entry point (compounded by #27 when the icon was hidden). Now a fresh install opens Settings once so the user has a clear starting point. Upgrading users are detected as returning via an existing-preference migration sentinel, so they don't get an unexpected pop-up, and the completion flag is persisted so later launches don't depend on the sentinel.

3. Zoom toggle hotkey fails while Settings is open — fixes #22

The global hotkeys were suspended for the entire time the Settings dialog was open, so pressing the Zoom toggle (or any shortcut) while Settings was open beeped and did nothing. Scoped the suspension to active shortcut recording only, with a balanced resume that fires no matter how recording ends (successful capture, Esc, toggling the button, or window close). Shortcuts now keep working while Settings is merely open.

How this was verified

  • swift build — clean.
  • swift run ZoomItMacSelfTestPASS, including a new testFirstLaunchFlag covering the fresh-launch state, flag persistence across store instances, and the upgrade migration sentinel.
  • Runtime (dev app bundle):
    • Fresh install opens Settings on first launch; second launch does not reopen it.
    • Upgrade migration (existing prefs, no flag) does not pop Settings.
    • 5 clean single-instance launch/quit cycles: no NSStatusItem Preferred Position key written.
    • Bartender confirmed able to keep the icon in "Shown Items".
    • Zoom toggle hotkey fails while Settings dialog is open #22: with Settings open, sending the Zoom toggle activated zoom (window count 1 → 2 → 1 after Esc) with no beep/suppression.

Files changed

  • Sources/ZoomItMacCore/App/AppDelegate.swift — remove autosaveName; first-launch Settings.
  • Sources/ZoomItMacCore/Settings/SettingsStore.swift — first-launch flag + upgrade migration.
  • Sources/ZoomItMacCore/Settings/SettingsWindowController.swift — scope hotkey suspend/resume to recording.
  • Sources/ZoomItMacCore/SelfTest/SelfTestRunner.swift — self-test for the first-launch flag + migration.

Closes #21
Closes #22
Closes #27

…le-Settings-open

Three related menu-bar/Settings fixes:

- Remove the status item autosaveName so AppKit no longer persists and
  re-asserts an absolute menu-bar position, which fought third-party
  menu-bar managers like Bartender (icon would not stay in a chosen
  section). Fixes microsoft#27.

- Open Settings on a fresh install so users have a clear entry point
  instead of a silent menu-bar-only launch. Upgrading users are detected
  as returning via an existing-preference migration sentinel and do not
  get an unexpected pop-up. Fixes microsoft#21.

- Scope the global-hotkey suspension to active shortcut recording only,
  instead of the entire time the Settings dialog is open, so shortcuts
  like the Zoom toggle keep working while Settings is open. Fixes microsoft#22.

Adds a self-test covering the first-launch flag, its persistence, and the
upgrade migration sentinel.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 9f9580d4-0a5a-45c6-8d9b-0ad776f7d8f9
@jldeen

jldeen commented Jul 16, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="GitHub"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants