fix(desktop): stop overwriting a custom dock icon on launch - #7125
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved a6ded7e This is a straightforward bug fix that adds a simple condition to prevent overwriting user-customized dock icons in packaged macOS apps. The change is small, well-scoped, defensive in nature, and includes updated tests. You can customize Macroscope's approvability policy. Learn more. |
|
Can I get merge please if everything is perfect |
…quit shortcut, pingdotgg#7300 preview ports, pingdotgg#7385 GitHubPullRequestCli refactor
## What's Changed * refactor(server): simplify error transformation with Effect.mapError in GitHubPullRequestCli by @aoright in pingdotgg/t3code#7385 * fix(preview): open local environment ports on localhost by @gbarros-dev in pingdotgg/t3code#7300 * fix(desktop): prevent quit shortcut spillover by @Bil0000 in pingdotgg/t3code#7397 * fix(desktop): stop overwriting a custom dock icon on launch by @Rishet11 in pingdotgg/t3code#7125 **Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260818.1126...v0.0.34-nightly.20260818.1127 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260818.1127
* test(web): remove duplicate lookup assertion (pingdotgg#7364) * fix(mobile): show structured input option descriptions (pingdotgg#7321) * fix(orchestration): do not revive idle tasks from status-free progress (pingdotgg#7172) * refactor(server): simplify error transformation with Effect.mapError in GitHubPullRequestCli (pingdotgg#7385) Signed-off-by: aoright <102943475+aoright@users.noreply.github.com> * fix(preview): open local environment ports on localhost (pingdotgg#7300) * fix(desktop): prevent quit shortcut spillover (pingdotgg#7397) * fix(desktop): stop overwriting a custom dock icon on launch (pingdotgg#7125) * feat(web): show project location in new thread picker (pingdotgg#7392) Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com> * fix(packaging): install AUR launcher icons where icon themes look (pingdotgg#7421) * fix(web): label pull request merge actions (pingdotgg#7381) * fix(server): avoid PRs inherited from default upstreams (pingdotgg#7317) * fix(desktop): stop the passkey dialog from popping as soon as sign-in opens (pingdotgg#7437) * feat(desktop): mute a browser tab (pingdotgg#7252) * fix(web): improve disconnected composer placeholder (pingdotgg#7122) Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com> * fix(desktop): throttle hidden preview rendering (pingdotgg#7445) Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com> * fix(server): stop probing Grok, Cursor, and OpenCode unless turned on (pingdotgg#7459) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * fix(desktop): boot the main window unthrottled so cold start paints at full speed (pingdotgg#7460) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * fix(threads): a merged PR settles its thread only once (pingdotgg#7454) * feat(cli): npx t3 triage hands broken installs to your own coding agent (pingdotgg#6563) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * fix(marketing): Safari gets the arm64 Mac download (pingdotgg#7473) * feat(web): add shortcuts to the surface dropdown (pingdotgg#7318) * fix(marketing): never serve the Intel build to Apple Silicon Macs (pingdotgg#7477) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * fix(web): animate command palette when closing (pingdotgg#5169) * fix(desktop): upgrade Clerk OAuth transport (pingdotgg#7479) * feat(server): run the background service on macOS via launchd (pingdotgg#6286) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * fix(web): align sidebar statuses with project names (pingdotgg#7491) Co-authored-by: GPT-5.6 <noreply@openai.com> * fix(desktop): close the window before quit cleanup (pingdotgg#6562) * fix(desktop): stop automatic passkey prompts (pingdotgg#7522) * docs(user): document phoenix triage and macOS background service The 2026-08-19 upstream sync added the triage command with no docs/user entry, and the docs index still called the background service Linux-only after launchd support landed. Found by PR #61 code review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Signed-off-by: aoright <102943475+aoright@users.noreply.github.com> Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: Nick Anisimov <n.anisimov.23@gmail.com> Co-authored-by: Maslin Edwin <maslinje@gmail.com> Co-authored-by: aoright <102943475+aoright@users.noreply.github.com> Co-authored-by: Guilherme Barros <gbarros1095@gmail.com> Co-authored-by: Bilal Bakr <62337003+Bil0000@users.noreply.github.com> Co-authored-by: Rishet11 <154429365+Rishet11@users.noreply.github.com> Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com> Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com> Co-authored-by: Augie <augie@luebbers.email> Co-authored-by: Taras <Taras.Fomin@gmail.com> Co-authored-by: Gianmarco <gianmarcosimone89@gmail.com> Co-authored-by: Theo Browne <me@t3.gg> Co-authored-by: Chris Deeming <chris@xenforo.com> Co-authored-by: Inaya Yousfi <zied.essaber@gmail.com> Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Rakshith Bhat <88523594+RakshithBhat03@users.noreply.github.com> Co-authored-by: GPT-5.6 <noreply@openai.com>
What Changed
DesktopAppIdentity.configurecalledsetDockIconon every macOS launch:It now runs only when the app is unpackaged.
Why
In a packaged build
resolveSourceTreeIconPathreturnsundefined(DesktopAssets.ts:81bails onenvironment.isPackaged), soresolveIconPath("png")falls through toresolveResourcePath("icon.png")and finds the icon bundled inContents/Resources.iconPaths.pngis therefore alwaysSomein a packaged build, andapp.dock.setIconfires on every launch.That call has nothing to add there. A packaged bundle already declares its icon through
Info.plist, so the dock shows the right artwork without it. What the call does do is overwrite the dock tile at runtime, which discards a custom icon the user attached to the app themselves via Finder's Get Info — the symptom in the issue, and it comes back after every relaunch.Unpackaged runs still need it: Electron shows a generic icon for a plain
electron .run, which is what the source-tree branch ofresolveIconPathexists to feed. That path is untouched.UI Changes
n/a — no interface change. The visible effect is on the macOS dock tile: a user's custom icon now survives a relaunch of a packaged build.
Checklist
Verification
DesktopAppIdentity.test.tsalready drivesconfigurethrough fakeElectronApp/DesktopAssets/DesktopEnvironmentlayers, so this needs no real Electron instance. Two changes there:configures app identity from the environment commit overridecase runs under the defaultisPackaged: trueenvironment and assertedsetDockIconhad been called with/icon.png. That assertion encoded the bug, so it now asserts no call was made.isPackaged: false,setDockIconis still called with the resolved png.Reverting the source change fails the first with
expected [ '/icon.png' ] to deeply equal [].On the flipped assertion. I want to flag that plainly rather than bury it, since changing an existing expectation is how a real intention gets erased. I read it as describing what the code did rather than asserting a packaged build should re-set its own icon: the same
environment.isPackagedgate is already used a few lines up in this file,DesktopAssetsdeliberately excludesicnsand all source-tree lookups from packaged builds, and no comment or changelog ties the dock call to packaged runs. If it was in fact deliberate — a branded dock tile for nightly against stable, say — then this PR is wrong and I would rather hear that than have it merged.Not verified: I cannot build and run a packaged macOS bundle here, so "the bundle icon still shows once we stop calling
setDockIcon" rests onInfo.plist/CFBundleIconFilebehaviour and the asset-resolution code above, not on something I watched happen. Worth a reviewer with a packaged build confirming the dock still looks right on a clean install.Fixes #7117
Implemented with Claude Opus 5 via Claude Code.
Note
Low Risk
Small, platform-specific startup behavior change with explicit tests; no auth, data, or security surface.
Overview
Packaged macOS builds no longer call
app.dock.setIconon startup, so a custom dock icon set via Finder survives relaunch. The dock icon is still set during unpackaged dev runs, where Electron would otherwise show a generic tile.DesktopAppIdentity.configurenow gates the DarwinsetDockIconpath with!environment.isPackaged, matching how bundled icons are already declared inInfo.plist. Tests were updated to expect no dock call when packaged (default test env) and to assert unpackaged runs still pass the resolved PNG path.Reviewed by Cursor Bugbot for commit 6b29d47. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Stop overwriting a custom dock icon for packaged desktop builds on macOS
Previously,
DesktopAppIdentity.configurecalledsetDockIconon all macOS builds, overwriting the bundle's native icon. NowsetDockIconis only called when the app is running unpackaged and a PNG icon path is available.Macroscope summarized 6b29d47.