Repository navigation
feat(mac): hide Dock icon while the main window is hidden - #193
Conversation
Signed-off-by: Myles Shannon <[email protected]>
Noah-Tervalon-Nvidia
left a comment
There was a problem hiding this comment.
Overall looks great. Is there a reason you didn't add this support for linux?
| } | ||
|
|
||
| export const refreshDockVisibility = createDockVisibilityController( | ||
| () => getOverviewWindow()?.isVisible() ?? false |
There was a problem hiding this comment.
when you minimize a window isVisible becomes false, so then the dock icon goes away which makes it hard to open the app again if you meant to just pop it into your icon bar. We should watch for the window being minimized and not get rid of the bar icon when it is minimized rather than closed.
There was a problem hiding this comment.
I’ve updated this so minimizing keeps the Dock icon, while closing or hiding the window removes it when the setting is enabled. It also applies on a hidden login launch. I kept this macOS-only because it uses Electron’s app.dock API. Added regression tests and resolved the merge conflict. Local checks pass, but I haven’t repeated the native Mac test yet.
|
Thanks for this — it fills a gap I ran into with the Startup switches from #97. On macOS, a login launch with Start minimized to tray on creates no window, but the Dock icon still shows, so PAIR doesn't feel like a menu bar app at sign-in. With this setting on, that launch should start with no Dock icon, which is what I was after. One question: does the Dock icon get hidden at startup when no window has been created yet (the hidden login launch path in Happy to test on a Mac if that helps. |
Signed-off-by: Myles Shannon <[email protected]>
…ference Signed-off-by: Myles Shannon <[email protected]>
Thanks for catching this. I’ve updated it to apply the Dock setting on a hidden login launch, even when no window has been created. Automated tests pass, but I haven’t tested that login flow on my Mac yet. I’d appreciate you trying it. |
|
Tested on macOS 27.2 (arm64) at 90aaf19. I took the hidden-launch path unpackaged, via With the preference on, a hidden launch comes up with no Dock icon and no window ever created: activation policy is Accessory (
Row 2 reproduces the gap I originally described, which is what makes row 1 meaningful. Row 4 confirms Two caveats on what this does and doesn't cover:
|
|
Thanks for the testing @timfallmk, once we get this in a state that's ready or a signed test I'll get a build going and test it out on my machines to verify. |
Signed-off-by: Myles Shannon <[email protected]>
|
I reproduced the brief Dock icon flash and pushed a fix in f290012. The macOS app now starts without a Dock icon and shows it when the window opens or the setting is off. Tested an actual logout/login on my Mac with the local build and the flash is gone. Minimize, close, and reopen still behave correctly, and all checks pass. |
|
building a signed version for us to test and verify. Myles I'll send it over to you as well so you can test today and we can get verification on 2 devices. Then we can merge this in. |
Noah-Tervalon-Nvidia
left a comment
There was a problem hiding this comment.
Did some validation on my machine. Myles also did some with the signed build earlier today. LGTM. Thanks for these updates and for the testing!
Changelog title
Hide the macOS Dock icon while PAIR runs in the background
Changelog body
Bumps
Description
Add Settings → Service → Appearance → Hide Dock icon when the window is hidden on macOS. It defaults off, persists locally, and takes effect immediately. Opening Overview restores the Dock icon; opening only the menu bar popup leaves it hidden.
Minimizing the main window keeps the Dock icon visible. A login launch with Start minimized to tray enabled applies the Dock preference after tray initialization, even when no Overview window exists.
Scope
Uses the existing Kaizen UI Switch without custom styling, typed preload/IPC, and local UI configuration. Handles Electron's cooldown after showing the Dock and native application Hide behavior. Windows and Linux behavior is unchanged. Independent of the menu icon and helper-signing changes.
This setting uses Electron's macOS-only
app.dockAPI. Linux taskbar behavior is a separate platform concern and has not been implemented or tested here. The setting remains separate from the startup preferences merged in #97 and the menu bar icon merged in #194.Validation
make -o desktop/package-lock.json checkandnpm --prefix desktop run dead-code:checkpass, including lint, TypeScript, contracts, build-script and SPDX checks. The Makefile lockfile prerequisite was skipped becausenpm cihad already completed.git diff --checkpasses.Risk
macOS Dock visibility changes application activation behavior. Deferred hiding rechecks current window/preference state and is canceled on reopening. The preference defaults off for existing configurations. No routing, Go service, or privileged-helper behavior changes.
Checklist
git commit -s), certifying the Developer Certificate of Origin.none. Version files and changelog are left to automation.