authorgravatar for 154429365+Rishet11@users.noreply.github.comRishet11 <154429365+Rishet11@users.noreply.github.com> 2026-08-18 23:13:18+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-18 13:43:18-04:00
log3b5d476eb6af9d14efe037e9d163848d6fd048d7
treeff2ec115f62ff74ca211e4a0ebaae750941f10a6
parentf3cb7f509595d304c6e2ccc7afe05c95ec45a7d8
signature Signed by PGP key B5690EEEBB952194

fix(desktop): stop overwriting a custom dock icon on launch (#7125)


2 files changed, 31 insertions(+), 2 deletions(-)

apps/desktop/src/app/DesktopAppIdentity.test.ts+27-1
...@@ -199,7 +199,9 @@ describe("DesktopAppIdentity", () => {...@@ -199,7 +199,9 @@ describe("DesktopAppIdentity", () => {
199 assert.equal(calls.setAboutPanelOptions[0]?.applicationName, "T3 Code (Alpha)");199 assert.equal(calls.setAboutPanelOptions[0]?.applicationName, "T3 Code (Alpha)");
200 assert.equal(calls.setAboutPanelOptions[0]?.applicationVersion, "1.2.3");200 assert.equal(calls.setAboutPanelOptions[0]?.applicationVersion, "1.2.3");
201 assert.equal(calls.setAboutPanelOptions[0]?.version, "0123456789ab");201 assert.equal(calls.setAboutPanelOptions[0]?.version, "0123456789ab");
202 assert.deepEqual(calls.setDockIcon, ["/icon.png"]);202 // Packaged: the bundle's own icon stands, so a custom one the user
203 // attached survives.
204 assert.deepEqual(calls.setDockIcon, []);
203 }),205 }),
204 {206 {
205 calls,207 calls,
...@@ -212,4 +214,28 @@ describe("DesktopAppIdentity", () => {...@@ -212,4 +214,28 @@ describe("DesktopAppIdentity", () => {
212 },214 },
213 );215 );
214 });216 });
217
218 it.effect("sets the dock icon only when running unpackaged", () => {
219 const calls: ElectronAppCalls = {
220 setAboutPanelOptions: [],
221 setDockIcon: [],
222 setName: [],
223 };
224
225 return withIdentity(
226 Effect.gen(function* () {
227 const identity = yield* DesktopAppIdentity.DesktopAppIdentity;
228 yield* identity.configure;
229
230 // Electron shows a generic icon for an unpackaged run, which is the
231 // reason this call exists at all.
232 assert.deepEqual(calls.setDockIcon, ["/icon.png"]);
233 }),
234 {
235 calls,
236 environment: { isPackaged: false },
237 pngIconPath: Option.some("/icon.png"),
238 },
239 );
240 });
215});241});
apps/desktop/src/app/DesktopAppIdentity.ts+4-1
...@@ -134,7 +134,10 @@ export const make = Effect.gen(function* () {...@@ -134,7 +134,10 @@ export const make = Effect.gen(function* () {
134 yield* electronApp.setDesktopName(environment.linuxDesktopEntryName);134 yield* electronApp.setDesktopName(environment.linuxDesktopEntryName);
135 }135 }
136136
137 if (environment.platform === "darwin") {137 // Unpackaged runs only. A packaged bundle already carries its icon in
138 // Info.plist, so setting the dock tile again changes nothing except to
139 // overwrite a custom icon the user attached to the app themselves.
140 if (environment.platform === "darwin" && !environment.isPackaged) {
138 const iconPaths = yield* assets.iconPaths;141 const iconPaths = yield* assets.iconPaths;
139 yield* Option.match(iconPaths.png, {142 yield* Option.match(iconPaths.png, {
140 onNone: () => Effect.void,143 onNone: () => Effect.void,