authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-02 13:48:42-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-02 13:49:04-08:00
loga3aa4bd189721a87271e9d7a1bed0cb605bc5eee
tree972d4624fc4c7ab88b79b00a91fffddddecbf12d
parent5a0006f7efabb03888573a2029f1d0a30b614422

Fix destructive menu icon showing app logo on non-macOS

getDestructiveMenuIcon fell back to resolveIconPath("png") on Windows/Linux which resolved to the T3 Code app icon, not a trash icon. Restrict the icon to macOS where createFromNamedImage("trash") provides the correct system icon. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

1 files changed, 6 insertions(+), 13 deletions(-)

apps/desktop/src/main.ts+6-13
......@@ -40,27 +40,20 @@ let desktopProtocolRegistered = false;
4040let destructiveMenuIconCache: Electron.NativeImage | null | undefined;
4141
4242function getDestructiveMenuIcon(): Electron.NativeImage | undefined {
43 if (process.platform !== "darwin") return undefined;
4344 if (destructiveMenuIconCache !== undefined) {
4445 return destructiveMenuIconCache ?? undefined;
4546 }
4647 try {
47 const icon =
48 process.platform === "darwin"
49 ? nativeImage.createFromNamedImage("trash").resize({
50 width: 14,
51 height: 14,
52 })
53 : nativeImage.createFromPath(resolveIconPath("png") ?? "").resize({
54 width: 14,
55 height: 14,
56 });
48 const icon = nativeImage.createFromNamedImage("trash").resize({
49 width: 14,
50 height: 14,
51 });
5752 if (icon.isEmpty()) {
5853 destructiveMenuIconCache = null;
5954 return undefined;
6055 }
61 if (process.platform === "darwin") {
62 icon.setTemplateImage(true);
63 }
56 icon.setTemplateImage(true);
6457 destructiveMenuIconCache = icon;
6558 return icon;
6659 } catch {