From bdb3e6486706092ef3c133a13cca9933ebc30a9a Mon Sep 17 00:00:00 2001 From: KetchupZ <42167339+ketchupz1999@users.noreply.github.com> Date: Mon, 26 Oct 2026 12:09:10 +0000 Subject: [PATCH] fix(desktop): restore Linux window icons (#13120) --- ui/desktop/package.json | 1 + ui/desktop/src/main.ts | 6 +++++- ui/desktop/src/utils/windowIcon.test.ts | 16 ++++++++++++++++ ui/desktop/src/utils/windowIcon.ts | 9 +++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 ui/desktop/src/utils/windowIcon.test.ts create mode 100644 ui/desktop/src/utils/windowIcon.ts diff --git a/ui/desktop/package.json b/ui/desktop/package.json index 97bd926a6..e8af01307 100644 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -1,6 +1,7 @@ { "name": "goose-app", "productName": "Goose", + "desktopName": "Goose.desktop", "version": "1.56.0", "description": "Goose App", "engines": { diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts index 38e4a7dac..d07d51146 100644 --- a/ui/desktop/src/main.ts +++ b/ui/desktop/src/main.ts @@ -65,6 +65,9 @@ import { isAuthorizedFileAccessRequest, readSelectedRecipe, } from './desktopFileAccess'; +import { getWindowIconFilename } from './utils/windowIcon'; + +const windowIconPath = path.join(__dirname, '../images', getWindowIconFilename(process.platform)); function shouldSetupUpdater(): boolean { // Setup updater if either the flag is enabled OR dev updates are enabled @@ -1253,7 +1256,7 @@ const createChat = async ( minWidth: 480, minHeight: 400, resizable: true, - icon: path.join(__dirname, '../images/icon.icns'), + icon: windowIconPath, webPreferences: { spellcheck: settings.spellcheckEnabled ?? true, preload: path.join(__dirname, 'preload.js'), @@ -2985,6 +2988,7 @@ async function appMain() { height: gooseApp.height ?? 600, resizable: gooseApp.resizable ?? true, useContentSize: true, + icon: windowIconPath, webPreferences: { preload: path.join(__dirname, 'preload.js'), nodeIntegration: false, diff --git a/ui/desktop/src/utils/windowIcon.test.ts b/ui/desktop/src/utils/windowIcon.test.ts new file mode 100644 index 000000000..1d0474d08 --- /dev/null +++ b/ui/desktop/src/utils/windowIcon.test.ts @@ -0,0 +1,16 @@ +import { describe, expect, it } from 'vitest'; +import { getWindowIconFilename } from './windowIcon'; + +describe('getWindowIconFilename', () => { + it.each([ + ['darwin', 'icon.icns'], + ['win32', 'icon.ico'], + ['linux', 'icon.png'], + ] as const)('uses the native icon for %s', (platform, expected) => { + expect(getWindowIconFilename(platform)).toBe(expected); + }); + + it('uses the cross-platform PNG fallback', () => { + expect(getWindowIconFilename('freebsd')).toBe('icon.png'); + }); +}); diff --git a/ui/desktop/src/utils/windowIcon.ts b/ui/desktop/src/utils/windowIcon.ts new file mode 100644 index 000000000..b316ecd00 --- /dev/null +++ b/ui/desktop/src/utils/windowIcon.ts @@ -0,0 +1,9 @@ +export function getWindowIconFilename(platform: typeof process.platform): string { + if (platform === 'darwin') { + return 'icon.icns'; + } + if (platform === 'win32') { + return 'icon.ico'; + } + return 'icon.png'; +}