Repository navigation
fix(macos): restore the Dock presence only when it is gone (#1305) - #1309
Merged
Merged
Conversation
assertRegularDockPresence called app.dock.show() on every main-window show and on every HUD create/load, on the claim that it was idempotent. Electron's dock.show() calls TransformProcessType each time, and transforming an app that is already a foreground app can leave the Dock showing it twice: the pinned tile without a running dot, plus a "recent apps" tile that is the running one. Clicking the pinned tile then reads as opening a second instance. The decision now lives in the Electron-free dock-presence.ts and acts only when app.dock.isVisible() says the app is not a regular Dock app (or the read fails), which is the case the HUD fix was written for. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013CkS8j5hok95yvLSB16R3f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #1305: on macOS, nodeterm can show twice in the Dock. The pinned tile has no running dot, and a second tile in the "recent apps" section is the instance that is actually running. Clicking the pinned tile looks like it opens a new instance.
What changed
assertRegularDockPresence(added in v0.2.25 so thefocusable:falseNotch HUD panel cannot cost the app its Dock tile) calledsetActivationPolicy('regular')andapp.dock.show()unconditionally. It ran on every main-windowshow, on HUD creation and on HUD load, and its comment called this idempotent. It is not: Electron'sdock.show()callsTransformProcessTypeevery time, and transforming an app that is already a foreground app is a known way to get a duplicate Dock tile.The decision moved to the Electron-free
src/main/dock-presence.ts. It now acts only whenapp.dock.isVisible()(the current activation policy isRegular) says the tile is really gone, or when that read fails. The case the HUD fix exists for is unchanged.How it was checked
persistent-appsandrecent-apps, both pointing at the same/Applications/nodeterm.appandcom.nodeterm.app, with bookmarks that resolve and are not stale. So the Dock fails to match the running app to its pinned tile; it is not a second instance and not a path mismatch.dock-presence.test.ts): already visible means no calls; dropped means restore; a failed read means restore; no dock API; non-macOS is a no-op.window-raise.guard.test.ts: thedock.show()allowlist entry moved fromnotch-hud.tstodock-presence.tswith the same reason.npm run typecheck, plus the notch-hud and raise-guard suites.Not verified
🤖 Generated with Claude Code
https://claude.ai/code/session_013CkS8j5hok95yvLSB16R3f