Skip to content

fix: re-hide macos dock icon after parentless dialogs - #3100

Merged
afonsojramos merged 4 commits into
mainfrom
fix/macos-dock-icon-after-dialog
Jul 29, 2026
Merged

fix: re-hide macos dock icon after parentless dialogs#3100
afonsojramos merged 4 commits into
mainfrom
fix/macos-dock-icon-after-dialog

Conversation

@afonsojramos

@afonsojramos afonsojramos commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

Since v7.0.0 the macOS dock icon occasionally reappears even though Gitify runs as a dock-hidden (accessory) app, and only a restart re-hides it.

Investigation

Tested live on macOS by driving the real built app (hidden window, setVisibleOnAllWorkspaces, accessory policy) and measuring app.dock.isVisible():

  • Reproduced: app.dock.hide() can be silently dropped when it races an app activation transition. In the experiment, hide() called 500ms after the dock became visible left the icon showing; a later hide() succeeded. electron-menubar calls dock.hide() very early in startup, so a lost race there leaves the icon stuck for the whole session. A restart re-rolls the race, which matches "occasionally showing" + "restart restores it".
  • Not reproduced (on this machine/OS): the parentless dialogs (updater "restart to install", first-run prompt) did not flip the dock. Kept the dialog-path re-hides anyway as cheap defense, since dialog-driven activation is version-dependent macOS behavior.
  • DevTools (detached) also did not affect the dock.

Fix

  1. Startup re-assert — moved into electron-menubar per review feedback, since the library owns the showDockIcon: false contract: fix: re-assert hidden dock after startup hide race electron-menubar#123, released as 10.1.4. This PR bumps the dependency and drops the app-level copy.
  2. Dialog-close re-hides (app-level, defensive): re-assert hidden after the updater dialog is dismissed and after the first-run prompt closes.

Tests

  • updater.test.ts: dismissing the update dialog re-hides the dock.
  • first-run.test.ts: the dock is re-hidden after the prompt closes.
  • Library-side coverage for the startup race lives in electron-menubar#123.

Full suite passes (1198 tests), pnpm check and tsc --noEmit clean.

Closes #3069

@afonsojramos
afonsojramos requested a review from setchy as a code owner July 28, 2026 15:09
@github-actions github-actions Bot added the bug Something isn't working label Jul 28, 2026
@setchy

setchy commented Jul 28, 2026

Copy link
Copy Markdown
Member

should this logic be within electron-menubar based on this config param being set?

showDockIcon: false, // Hide the app from the macOS dock

@github-actions github-actions Bot added the dependency Dependency updates label Jul 29, 2026
@sonarqubecloud

Copy link
Copy Markdown

@afonsojramos
afonsojramos merged commit 8f4b33a into main Jul 29, 2026
18 checks passed
@afonsojramos
afonsojramos deleted the fix/macos-dock-icon-after-dialog branch July 29, 2026 11:17
@github-actions github-actions Bot added this to the Release 7.x.x milestone Jul 29, 2026
This was referenced Jul 29, 2026
@setchy setchy modified the milestones: Release 7.1.0, Release 7.1.1 Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependency Dependency updates

Development

Successfully merging this pull request may close these issues.

macOS: dock icon occasionally showing

2 participants