Repository navigation
feat(mac): hide Dock icon while the main window is hidden - #193
MylesShannon wants to merge 3 commits into
Conversation
Signed-off-by: Myles Shannon <github@mylesshannon.com>
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 <github@mylesshannon.com>
…ference Signed-off-by: Myles Shannon <github@mylesshannon.com>
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:
|
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.