kimi-code/scripts
Luyu Cheng 4de4c9c0ff
feat(desktop): theme-following Dock icon, app-icon picker, v2 brand kit (#92)
* feat(desktop): adopt new brand kit for app icons and in-UI brandmarks

- replace KIMI CODE LOGO/ with the new designer delivery
- regenerate icon.icns/icon.ico/icon.png, tray icons and web favicon
  (squircle baked at Apple's 824/1024 grid so pre-Tahoe macOS keeps a
  correctly sized, rounded Dock icon)
- port onboarding BrandLogo and the sidebar mark to the new geometry
  in both apps, keeping the blink easter eggs
- add scripts/build-brand-icons.mjs (pnpm build:icons) so future kit
  updates regenerate everything reproducibly

* feat(desktop): theme-following Dock icon, app-icon picker, and v2 brand kit

- runtime Dock icon follows the effective appearance (light/dark tile);
  new macOS-only settings row picks light/dark/system with live previews
  in a dedicated DockIconPicker (squircle tiles, sliding indicator)
- choice persists renderer-side (lib/dockIconChoice.ts) and pushes via
  kimi:dock-icon-choice; ipc/preload validate the three literals
- icon-dark.png ships in mac packages only; afterPack compiles an
  optional build/AppIcon.icon into Assets.car for Tahoe appearances
  (no-op until the artifact lands; .icns stays as pre-Tahoe fallback)
- adopt the v2 KIMI CODE LOGO kit; rasterize app icons from the SVG
  vectors (the v2 PNGs are previews), parse stroke widths from the kit
  instead of hardcoding, drop the 5px centering correction (v2 is
  centered by design)

* fix(desktop): resolve Dock icon auto mode against the real OS appearance

nativeTheme.shouldUseDarkColors follows themeSource, which the renderer
sets from the app's own theme setting — so 'auto' would track the app
theme instead of macOS. Read systemPreferences.getEffectiveAppearance()
(unknown falls back to shouldUseDarkColors) and also subscribe to
AppleInterfaceThemeChangedNotification, since nativeTheme 'updated'
does not fire on OS changes while the app theme is pinned.

* fix(desktop): follow the real OS appearance for the auto Dock icon

- resolve 'auto' via /usr/bin/defaults read -g AppleInterfaceStyle:
  nativeTheme.shouldUseDarkColors and getEffectiveAppearance both follow
  the app-level appearance override (themeSource), so they can't serve
- push the same OS appearance to the renderer (kimi:os-appearance +
  kimi:os-appearance-changed) so the picker's System preview matches
  the actual Dock icon; older bridges fall back to the app theme
- register the DockIconPicker pattern in DesignSystemView (§03, with a
  live demo) and move its caption onto --text-2xs / --weight-caption
- tolerate the brand-mark viewBox height in check-style (32x28.x)

* chore: split the brand mark into Icon Composer layers

scripts/export-icon-layers.mjs regenerates KIMI CODE LOGO/layers/
(1024pt per-layer SVGs + PNGs, bottom-to-top: background, head, eyes,
terminal, dot) from the kit's White/Black Background.svg

* fix(desktop): address codex review on dock icon picker

- osAppearance: fall back to the app-level appearance when macOS
  appearance is Auto (AppleInterfaceStyle key absent) instead of
  wrongly reporting light
- DockIconPicker: WAI-ARIA radio-group keyboard model (roving tabindex,
  arrow/Home/End keys move selection and focus)
- move 2px group gap/padding onto the new --space-05 token; trim the
  component header comment (rationale stays in docs)

* fix(desktop): address second codex pass on dock icon picker

- give the icon radiogroup an accessible name (aria-label)
- guard the async IPC gap in onMounted so late resolves can't
  subscribe listeners after unmount
- build-brand-icons: fail on non-macOS instead of leaving a stale
  icon.icns next to regenerated assets
- trim rationale comments (details live in docs)

* fix(desktop): address third codex pass on dock icon picker

- build-brand-icons: move the macOS guard before any output is written
  (a mid-run throw left a partially refreshed icon set)
- caption line-height uses --leading-tight instead of a bare 1
- trim the remaining rationale comments in DockIconPicker

* fix(desktop): read the true system appearance in macOS Auto mode

When macOS appearance is Auto the AppleInterfaceStyle key is absent;
the previous fallback (nativeTheme.shouldUseDarkColors) follows the
app-level theme override, so a pinned app theme would win over the OS.
Ask a fresh JXA helper process for its own effectiveAppearance instead —
no override in that process, no TCC prompt, accurate under Auto.
2026-07-24 06:31:53 +08:00
..
build-brand-icons.mjs feat(desktop): theme-following Dock icon, app-icon picker, v2 brand kit (#92) 2026-07-24 06:31:53 +08:00
export-icon-layers.mjs feat(desktop): theme-following Dock icon, app-icon picker, v2 brand kit (#92) 2026-07-24 06:31:53 +08:00
merge-mac-update-yml.mjs feat(desktop): add auto-update via CDN generic feed (#26) 2026-07-18 16:34:23 +08:00
prepare-fonts.mjs feat: refresh UI typography, colors, spacing, and layout 2026-07-16 09:53:40 +00:00
sync-web-to-kimi-code.mjs ci: migrate desktop packaging to GitHub Actions and add changesets release flow (#1) 2026-07-16 22:45:14 +08:00