Repository navigation
fix(desktop): keep collapsed workspaces across restarts and set the macOS Dock icon - #542
Merged
Merged
Conversation
…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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
useCollapsedWorkspaceshook that persists the collapsed workspace ids inlocalStorage(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-desktopmacOS reads the Dock icon from the app bundle's
Info.plist, so a bundled.appwas fine, but an unbundled process (tauri dev, ormake install+future-desktop) got the generic executable icon. The setup hook now setsNSApplication.setApplicationIconImagefrom 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) — passcargo fmt --check,cargo clippy --all-targets,cargo test(1129 tests) indesktop/src-tauri— passThe 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.