Skip to content

fix(desktop): keep collapsed workspaces across restarts and set the macOS Dock icon - #542

Merged
huichen merged 3 commits into
mainfrom
claude/desktop-collapse-dock-icon
Sep 10, 2026
Merged

huichen merged 3 commits into
mainfrom
claude/desktop-collapse-dock-icon

Conversation

@huichen

@huichen huichen commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Two desktop fixes reported together.

Collapsed workspace groups reset on every launch

The activity rail held per-workspace collapse state in component state, so a restart brought the whole workspace list back expanded. It now lives in a useCollapsedWorkspaces hook that persists the collapsed workspace ids in localStorage (future.collapsedWorkspaces) and restores them on mount — the same convention the left panel width already uses. Unknown/deleted ids and corrupt or unavailable storage degrade to "fully expanded"; nothing user-visible is lost.

Section-level collapse (the 工作区列表 / 对话列表 headers) is deliberately left per-session — only the per-workspace groups persist.

Generic exec icon in the Dock after make install + future-desktop

macOS reads the Dock icon from the app bundle's Info.plist, so a bundled .app was fine, but an unbundled process (tauri dev, or make install + future-desktop) got the generic executable icon. The setup hook now sets NSApplication.setApplicationIconImage from the icon PNG embedded in the binary (icons/icon.png, the same embedding rationale as the existing Windows ICO path), before the window is shown. Bundled launches are unaffected.

Verification

  • npx tsc --noEmit, npx eslint "src/**/*.{ts,tsx}", npx vitest run (86 files / 791 tests) — pass
  • cargo fmt --check, cargo clippy --all-targets, cargo test (1129 tests) in desktop/src-tauri — pass

The Dock icon needs one visual confirmation in a live run: the app was running during development, so the single-instance plugin prevented launching a second instance alongside it.

…ock icon

The activity rail kept per-workspace collapse state in component state, so every launch brought the whole workspace list back expanded. Move it into a useCollapsedWorkspaces hook that persists the collapsed workspace ids in localStorage (same convention as the left panel width) and restores them on mount.

On macOS the Dock icon comes from the app bundle, so an unbundled process (tauri dev, or make install followed by future-desktop) showed the generic executable icon. Set the shared application's icon image from the icon embedded in the binary during setup, before the window is shown.
@huichen
huichen enabled auto-merge (squash) September 10, 2026 09:06
jsdom on Linux CI provides a real Storage while the macOS test setup installs a plain in-memory object, so an instance/prototype spy only intercepted in one of them. Replacing the global covers both.
@huichen
huichen merged commit 3d7abe2 into main Sep 10, 2026
12 checks passed
@huichen
huichen deleted the claude/desktop-collapse-dock-icon branch September 10, 2026 09:21
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