Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
fix(desktop): stop overwriting a custom dock icon on launch (#7125)
Rishet113b5d476eb6af
diff --git a/apps/desktop/src/app/DesktopAppIdentity.test.ts b/apps/desktop/src/app/DesktopAppIdentity.test.tsindex da767a037..5c39ff304 100644--- a/apps/desktop/src/app/DesktopAppIdentity.test.ts+++ b/apps/desktop/src/app/DesktopAppIdentity.test.ts@@ -199,7 +199,9 @@ describe("DesktopAppIdentity", () => {assert.equal(calls.setAboutPanelOptions[0]?.applicationName, "T3 Code (Alpha)");assert.equal(calls.setAboutPanelOptions[0]?.applicationVersion, "1.2.3");assert.equal(calls.setAboutPanelOptions[0]?.version, "0123456789ab");- assert.deepEqual(calls.setDockIcon, ["/icon.png"]);+ // Packaged: the bundle's own icon stands, so a custom one the user+ // attached survives.+ assert.deepEqual(calls.setDockIcon, []);}),{calls,@@ -212,4 +214,28 @@ describe("DesktopAppIdentity", () => {},);});++ it.effect("sets the dock icon only when running unpackaged", () => {+ const calls: ElectronAppCalls = {+ setAboutPanelOptions: [],+ setDockIcon: [],+ setName: [],+ };++ return withIdentity(+ Effect.gen(function* () {+ const identity = yield* DesktopAppIdentity.DesktopAppIdentity;+ yield* identity.configure;++ // Electron shows a generic icon for an unpackaged run, which is the+ // reason this call exists at all.+ assert.deepEqual(calls.setDockIcon, ["/icon.png"]);+ }),+ {+ calls,+ environment: { isPackaged: false },+ pngIconPath: Option.some("/icon.png"),+ },+ );+ });});diff --git a/apps/desktop/src/app/DesktopAppIdentity.ts b/apps/desktop/src/app/DesktopAppIdentity.tsindex 0be55d633..c5adb8574 100644--- a/apps/desktop/src/app/DesktopAppIdentity.ts+++ b/apps/desktop/src/app/DesktopAppIdentity.ts@@ -134,7 +134,10 @@ export const make = Effect.gen(function* () {yield* electronApp.setDesktopName(environment.linuxDesktopEntryName);}- if (environment.platform === "darwin") {+ // Unpackaged runs only. A packaged bundle already carries its icon in+ // Info.plist, so setting the dock tile again changes nothing except to+ // overwrite a custom icon the user attached to the app themselves.+ if (environment.platform === "darwin" && !environment.isPackaged) {const iconPaths = yield* assets.iconPaths;yield* Option.match(iconPaths.png, {onNone: () => Effect.void,