Skip to content

fix(desktop): update Windows taskbar app icon - #5202

Open
Dante-dan wants to merge 2 commits into
apache:mainfrom
Dante-dan:fix/5199-windows-taskbar-icon
Open

Dante-dan wants to merge 2 commits into
apache:mainfrom
Dante-dan:fix/5199-windows-taskbar-icon

Conversation

@Dante-dan

Copy link
Copy Markdown
Contributor

Summary

  • keep the existing window HICON update and also set Windows taskbar AppUserModel details
  • persist the selected or fallback artwork as a content-addressed 256px ICO under app-owned user data so Explorer has a stable relaunch icon resource
  • apply the same taskbar metadata before a new window is shown and on later icon or theme changes

Fixes #5199

Verification

  • node --test apps/desktop/dist/main/__tests__/windows-taskbar-icon.test.js apps/desktop/dist/main/__tests__/app-icon.test.js apps/desktop/dist/main/__tests__/client-settings-effects.test.js (16 passed)
  • biome lint on the four changed TypeScript files
  • node scripts/asf-license-headers.mjs check
  • git diff --check

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex traced the Windows icon surfaces, implemented the change, and added the regression tests.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Generated-by: Codex
Signed-off-by: Dante <duanjl.china@gmail.com>
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 11, 2026

@me2seeks me2seeks left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR 5202 Review

结论

APPROVE
Windows taskbar 图标通过 per-window setAppDetails + content-addressed ICO 持久化解决,appId 与 electron-builder 的 com.maka.desktop 一致,实现与测试都扎实。

@me2seeks me2seeks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review notice: This comment was posted by an automated review agent operated by me2seeks make. It is not an independent human review and does not replace one.

Summary

Updates the Windows taskbar app icon: a new windows-taskbar-icon.ts persists the selected artwork as a content-addressed ICO file (Explorer may read the relaunch icon after process exit, so not a temp file), and encodePngAsIco hand-rolls the minimal PNG-in-ICO directory entry to avoid a native image-conversion dependency for one resource. The encoder layout checks out: ICONDIR (reserved=0, type=1, count=1) plus one 16-byte ICONDIRENTRY with width/height 0 (=256px), true colour, 32bpp, correct byte length and image offset — matches the ICO spec Windows' property store consumes. WINDOWS_APP_USER_MODEL_ID is documented to stay aligned with electron-builder's appId and the installed shortcut. package and test lanes are green, and the rollback harness (verify-windows-installer-rollback.mjs) is updated to cover the new file.

Findings

  1. [P3] WINDOWS_APP_USER_MODEL_ID = 'com.maka.desktop' is a second hard-coded copy of the appId that electron-builder owns; if the builder config's appId ever changes, the taskbar icon silently binds to the old identity with no build-time check. A tiny consistency assertion against electron-builder.config.mjs in the existing test would pin it.

Verdict

merge-ready — minimal dependency-free encoder with rollback coverage; only the duplicated appId authority nit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(desktop): Windows taskbar icon does not follow app icon selection at the default installation path

2 participants