你的姓名 7992997057 fix(desktop): plugin settings test mock + SkillList catalog guard
The single desktop-checks failure
(`Settings > Plugins tab > navigates plugin skills into the shared
Skills page flow`) crashed in SkillList.tsx:220 with
`Cannot read properties of undefined (reading 'length')`. Two
contributing issues, both pre-existing on origin/main and surfaced
for the first time by this PR's CI fixes:

1. The test's vi.mock fixtures for both useSkillStore and
   usePluginStore are missing fields that the production stores
   gained over time. Specifically:
     - useSkillStore mock lacked: catalog, isCatalogLoading,
       installingName, fetchCatalog, installSkill.
     - usePluginStore beforeEach lacked: catalog, installingCatalogId,
       isAddingMarketplace, fetchCatalog, installCatalogPlugin,
       addMarketplaceFromInput.
   Both stores ARE always seeded with these fields at runtime
   (see stores/skillStore.ts and stores/pluginStore.ts initial
   state), so production is unaffected. The tests just diverged
   from the store shape.

2. SkillList.tsx read `catalog.length` directly. With the production
   store always seeding `catalog: []` this is safe — but a partial
   mock or any future store shape regression would white-screen the
   entire Skills page. Added a tiny `catalog ?? []` guard at the
   single read site so this can't happen again. Defense-in-depth,
   not a behavior change.

Tested:
  - bun run test --run src/__tests__/pluginsSettings.test.tsx:
    7/7 pass (was 6 pass / 1 fail before).
  - Full desktop vitest run still has 2 pre-existing failures in
    electron/services/{sidecarManager,terminal}.test.ts on Windows
    local checkouts (path/CRLF artifacts); these reproduce on
    origin/main and are not caused by this commit.

Confidence: high
Scope-risk: narrow (1 test fixture + 3-line ?? in production code).
2026-06-11 03:46:00 +08:00
..
2026-06-11 02:05:01 +08:00

Claude Code Haha Desktop

基于 Tauri 2 + React 的桌面客户端。

开发

bun install
bun run tauri dev

构建

# macOS (Apple Silicon)
./scripts/build-macos-arm64.sh

# Windows (x64, MSI only)
.\scripts\build-windows-x64.ps1

构建产物位于 build-artifacts/ 目录,文件名会显式包含平台、架构和包类型。

常见问题

macOS 提示"已损坏,无法打开"

xattr -cr /Applications/Claude\ Code\ Haha.app