The open source coding agent.
TypeScript
fix(desktop-electron): match dev dock icon inset on macOS (#19429)
Kit Langtond36b38e4a6f5
diff --git a/packages/desktop-electron/icons/README.md b/packages/desktop-electron/icons/README.mdindex fa219a77ef1..cf2f8e24c50 100644--- a/packages/desktop-electron/icons/README.md+++ b/packages/desktop-electron/icons/README.md@@ -9,3 +9,6 @@ Here's the process I've been using to create icons:The Image2Icon step is necessary as the `icon.icns` generated by `app-icon.png` does not apply the shadow/padding expected by macOS,so app icons appear larger than expected.++For unpackaged Electron on macOS, `app.dock.setIcon()` should use a PNG. Keep `dock.png` in each channel folder synced with the+extracted `[email protected]` from that channel's `icon.icns` so the dev Dock icon matches the packaged app inset.diff --git a/packages/desktop-electron/icons/beta/dock.png b/packages/desktop-electron/icons/beta/dock.pngnew file mode 100644index 00000000000..f274ef64598Binary files /dev/null and b/packages/desktop-electron/icons/beta/dock.png differdiff --git a/packages/desktop-electron/icons/dev/dock.png b/packages/desktop-electron/icons/dev/dock.pngnew file mode 100644index 00000000000..4953d5531e7Binary files /dev/null and b/packages/desktop-electron/icons/dev/dock.png differdiff --git a/packages/desktop-electron/icons/prod/dock.png b/packages/desktop-electron/icons/prod/dock.pngnew file mode 100644index 00000000000..f2ab694e97dBinary files /dev/null and b/packages/desktop-electron/icons/prod/dock.png differdiff --git a/packages/desktop-electron/src/main/windows.ts b/packages/desktop-electron/src/main/windows.tsindex 0b7783f289e..170cd877cd9 100644--- a/packages/desktop-electron/src/main/windows.ts+++ b/packages/desktop-electron/src/main/windows.ts@@ -50,7 +50,8 @@ export function setTitlebar(win: BrowserWindow, theme: Partial<TitlebarTheme> =export function setDockIcon() {if (process.platform !== "darwin") return- app.dock?.setIcon(nativeImage.createFromPath(join(iconsDir(), "[email protected]")))+ const icon = nativeImage.createFromPath(join(iconsDir(), "dock.png"))+ if (!icon.isEmpty()) app.dock?.setIcon(icon)}export function createMainWindow(globals: Globals) {