Commit graph

9 commits

Author SHA1 Message Date
liruifengv
8140820d59
feat(desktop): add a custom Windows title bar (#123)
* feat: refine Windows desktop chrome

* fix: preserve Windows menu interactions

* fix: address Windows titlebar review feedback

* fix: clear Windows menu access on blur

* fix: align Windows menu shortcut handling
2026-07-27 17:23:03 +08:00
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
liruifengv
6ea3027e2d chore(scripts): migrate desktop CDN publish script to repo root 2026-07-18 18:44:23 +08:00
liruifengv
a83f5dfded chore(scripts): migrate desktop CDN publish script into this repo 2026-07-18 18:34:21 +08:00
liruifengv
034c432d3f
feat(desktop): add auto-update via CDN generic feed (#26)
* feat(desktop): add auto-update via CDN generic feed

* fix(desktop): address review — merge dual-arch mac update feed, token radius, snapshot race, rollback reset

* chore(desktop): drop dev-only updater mock

* test(desktop): move renderer update tests into dedicated test dirs

* fix(desktop): keep in-flight update state on repeated update-available

* ci(desktop): merge mac update feeds with a repo-local node script

* test(desktop): fix moved update tests' import paths

* fix(desktop): clear rolled-back download errors on update-not-available
2026-07-18 16:34:23 +08:00
liruifengv
2d0b6fbeb2
ci: migrate desktop packaging to GitHub Actions and add changesets release flow (#1)
* ci: migrate desktop packaging pipeline to GitHub Actions

Replace the GitLab CI pipeline with a GitHub Actions workflow:

- .github/workflows/desktop-build.yml: workflow_dispatch trigger with
  sign-macos / retention-days inputs; matrix builds macOS arm64+x64,
  Windows x64 and Linux x64 on standard GitHub-hosted runners; checkout
  pulls the kimi-code submodule recursively; installers upload as
  kimi-desktop-<target> artifacts.
- .github/actions/macos-keychain-{setup,cleanup}: composite actions
  taken from the kimi-code repo (the previous GitLab shell scripts were
  themselves translated from these).
- Delete .gitlab-ci.yml; update AGENTS.md and apps/desktop/README.md;
  the scripts/ci/*.sh helpers are now only used by local packaging
  (package-local-macos.sh) and their headers say so.

* ci: temporarily trigger desktop-build on branch push for verification

workflow_dispatch requires the workflow file on the default branch;
before merge, run the pipeline on pushes to this branch (signed macOS
builds by default). Removed after verification.

* fix(desktop): unbreak Windows and Linux CI packaging

- Linux: electron-builder 26 validates executableName file-path safety;
  derive from package name fails (@moonshot-aikimi-desktop contains @).
  Set linux.executableName to kimi-code explicitly.
- Windows: @electron/rebuild 3.7.1 pins an old @electron/node-gyp fork
  that does not recognize Visual Studio 2026 (v18), the only toolchain
  on the windows-2025 image. Bump to 4.2.0, which uses plain
  node-gyp 12.4.0 with VS2026 support (and dedupes with
  electron-builder's own copy).

* ci: drop temporary branch push trigger from desktop-build

All four platforms verified green (macOS signed + notarized, Windows,
Linux). Back to workflow_dispatch-only as intended; the manual dispatch
becomes available once the workflow lands on the default branch.

* ci: add changesets-based desktop release flow

Mirror the kimi-code repo's changesets setup, but the publish step
produces desktop installers on a GitHub Release instead of npm:

- .changeset/: only @moonshot-ai/kimi-desktop is versioned; every other
  workspace package is ignored.
- release.yml (push to main): changesets/action maintains the
  'ci: release desktop' version PR; once it merges and the desktop
  version has no matching tag, the workflow calls desktop-build.yml
  (signed + notarized, four platforms), creates GitHub Release
  v<version> pinned to the merge commit, and uploads all installers
  as release assets. Idempotent: existing tag -> skip; the tag is only
  created alongside the release after a successful build, so reruns
  are safe.
- desktop-build.yml: restore the workflow_call trigger (same interface
  as the kimi-code repo) and switch the artifact prefix to
  kimi-code-app.

* refactor: rename desktop package to kimi-code-app, drop license fields

- apps/desktop: @moonshot-ai/kimi-desktop -> kimi-code-app (unscoped);
  homepage follows the repo name. The workflow artifact prefix already
  moved to kimi-code-app, so naming is now consistent end to end.
- Update every package-name reference (root scripts, desktop-build.yml,
  package-local-macos.sh, docs). Runtime identity strings are
  intentionally untouched: userAgentProduct 'kimi-desktop' (required
  upstream), storage keys, and [kimi-desktop] log prefixes.
- Remove the "license": "MIT" field from root / apps/web /
  apps/desktop package.json.

* refactor: rename web package to kimi-code-web

Follows the desktop rename: @moonshot-ai/kimi-web -> kimi-code-web
(unscoped). Updates every live reference (root scripts, sync script,
docs, test run hints, changesets ignore list). apps/web/CHANGELOG.md
keeps the historical name; the kimi-code submodule has no dependency
on this package name.

* chore: reset desktop version to 0.0.0

Fresh versioning baseline for the changesets flow — the first
'ci: release desktop' PR will produce the initial real version.
2026-07-16 22:45:14 +08:00
程鲁豫
f7547e49f3 feat: refresh UI typography, colors, spacing, and layout 2026-07-16 09:53:40 +00:00
liruifengv
ada047e90e chore(scripts): require KIMI_CODE_REPO in sync:web, drop dead copy-web-dist
- sync-web-to-kimi-code.mjs: KIMI_CODE_REPO is now required (no more ../kimi-code-2 default), the target is validated as a kimi-code checkout, errors are in Chinese, and a reminder to open a PR in the kimi-code repo prints after a successful sync
- Remove apps/desktop/scripts/copy-web-dist.mjs and the web-dist .gitignore entry: the desktop renderer builds from src/renderer into desktop-dist, so the web-dist copy flow is dead
- README.md / AGENTS.md updated to match
2026-07-15 13:32:03 +08:00
liruifengv
a4e0f42b59 feat: add sync-web script to vendoring web dist into kimi-code SEA 2026-07-10 11:45:48 +08:00