feat(workspaces): import a VS Code .code-workspace as a workspace#22
Merged
Conversation
Palette "Import .code-workspace..." and an import row in the manager create a named workspace from a VS Code multi-root workspace file. Parsing is pure, unit-tested TS (lib/codeWorkspace.ts): JSONC-tolerant (string-aware comment + trailing-comma stripping), local `path` entries only (remote `uri` ignored), relative paths joined against the file's directory without canonicalizing - each folder is validated through repoOpen and the canonical meta.path is what gets stored (the Windows re-spelling rule). The file is read by a new deliberately narrow IPC command, workspace_file_read: the name must end .code-workspace and the file be <= 1 MB, so the webview gains no generic file reader. useWorkspaces.importCodeWorkspace returns added/skipped; non-repo folders are reported (toast / manager message) - only zero resolving repos is an error. Verified: cargo test -p strand-tauri (+1 gate test), clippy, tsc, vitest (171, +13 codeWorkspace), vite build, and an end-to-end pass against the running Tauri app over WebView2 CDP (JSONC fixture with two real repos + a non-repo + a remote uri -> imported "acme" with 2 added / 1 skipped and members tabbed; all-non-repo file throws creating nothing; backend refuses a non-workspace path).
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.
Summary
Closes the second Workspaces Phase 3 item: a VS Code multi-root
.code-workspacefile imports as a named Strand workspace.lib/codeWorkspace.ts): JSONC-tolerant (string-aware comment + trailing-comma stripping), localpathentries only (remoteuriignored), relative paths joined against the file directory without canonicalizing — each folder is validated throughrepoOpenand the canonicalmeta.pathis what gets stored (the Windows re-spelling rule).workspace_file_read: the name must end.code-workspaceand the file be <= 1 MB, so the webview gains no generic file reader out of this.Test plan
cargo test -p strand-tauri— 12/12 (incl. newworkspace_file_readgate test)cargo clippy -p strand-core -p strand-tauri -- -D warnings— cleanpnpm --filter ./ui exec tsc --noEmit— cleanpnpm --filter ./ui test— 171/171 (+13codeWorkspacetests)pnpm --filter ./ui exec vite build— green.code-workspacepath.🤖 Generated with Claude Code