Skip to content

fix(brand): crisp taskbar & tray icons (optical-sizing .ico)#68

Open
rxm96 wants to merge 1 commit into
mainfrom
fix/icon-optical-sizing
Open

fix(brand): crisp taskbar & tray icons (optical-sizing .ico)#68
rxm96 wants to merge 1 commit into
mainfrom
fix/icon-optical-sizing

Conversation

@rxm96

@rxm96 rxm96 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Problem

The taskbar and system-tray icon looked pixelated after the new logo landed (#67).

Root cause (verified)

icons/icon.png is a genuine, crisp 1024×1024 — confirmed by inspecting the bitmap (sharp anti-aliased edges), so the file is fine. The issue is downscaling:

  • The only runtime icon source was that single 1024px dark-tile PNG.
  • Windows/Electron downscale it to ~16–32px for the taskbar (via electron-builder's generated .ico) and the tray (new Tray()).
  • At that size the droplet shrinks, the fine white arrow collapses, and the near-black tile has almost no contrast on the dark Windows taskbar.
  • electron-builder can only downscale a single PNG — it can't produce different artwork per size, so it can't fix this.

Fix — optical sizing with real multi-size .ico

Small sizes get dedicated high-contrast artwork; large sizes keep the dark tile (as chosen for the desktop/installer icon).

  • icons/icon-small.svg — violet tile + white droplet, tighter padding, for sizes ≤ 48.
  • scripts/build-icon.mjs — now rasterizes both SVGs in one offscreen window + one load (a second offscreen data: load fails with ERR_FAILED), crops them apart, high-quality-resizes to each target, and packs Windows .ico files with a small dependency-free ICO packer (PNG payloads):
    • icons/icon.ico — 16/24/32/48 violet + 64/128/256 dark tile
    • icons/tray.ico — 16/24/32 violet
  • build.win.iconicons/icon.ico so the taskbar/installer/exe get native crisp sizes.
  • src/main/index.tsBrowserWindow now sets icon, and the tray uses tray.ico, on Windows (icon.png elsewhere). Previously no window icon was set at all.
  • icons/icon.png (1024 dark tile) is unchanged and stays build.icon for macOS/default.

Verification

  • ICO files parsed back: correct entry counts/sizes, all valid PNG payloads. Extracted 32px (crisp violet) and 256px (dark tile) and eyeballed them.
  • format:check ✓, typecheck ✓ (main process changed), lint 0 errors, npm test 514 ✓, npm run build ✓.
  • Regenerate any time with npm run build:icon.

Note: the packaged taskbar/installer icon and the live tray render can only be fully confirmed by a Windows build / running app — local evidence (correct .ico contents + crisp small renders) is strong, final confirmation comes from the next build.

Test plan

  • CI verify passes.
  • npm run dev → tray + taskbar show the crisp violet icon.
  • After a Windows build: installer, desktop shortcut, taskbar, and tray all look crisp.

🤖 Generated with Claude Code

The taskbar and tray showed a pixelated icon: the only runtime icon source
was the 1024px dark-tile PNG, downscaled by Windows/Electron to ~16-32px.
At that size the droplet shrank, the white arrow collapsed, and the near-
black tile vanished against the dark taskbar. electron-builder can only
downscale a single PNG, so it can't fix this either.

Fix = optical sizing with real multi-size .ico files:
- icons/icon-small.svg: high-contrast violet tile for small sizes
- build-icon.mjs now renders both SVGs (one offscreen window + crop, then
  high-quality resize) and packs Windows .ico files dependency-free:
    icons/icon.ico  16/24/32/48 violet + 64/128/256 dark tile
    icons/tray.ico  16/24/32 violet
- build.win.icon -> icons/icon.ico (crisp taskbar/installer/exe)
- BrowserWindow icon + Tray now use the .ico on Windows (icon.png elsewhere)
- icon.png (1024 dark tile) unchanged; still build.icon for macOS/default

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant