Skip to content

feat(desktop): manage extra sandbox folder mounts from settings - #235

Merged
quickbeard merged 1 commit into
mainfrom
sandbox-mounts-ui
Aug 14, 2026
Merged

quickbeard merged 1 commit into
mainfrom
sandbox-mounts-ui

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Third of three stacked PRs (on #233 and the image PR). The user-facing feature: mount more folders into an existing Work sandbox.

What

  • UI: each sandbox's overflow menu (Settings → Servers) gains Folders…, opening DialogSandboxMounts: the original project folder is shown fixed; extra folders can be added via the host-native picker (multiple: true, deliberately bypassing useDirectoryPicker, whose policy would browse the guest fs) and removed; inline validation via the new pure mounts-model.ts (mirrors validateMountPaths — the app never imports the node package); a restart warning on macOS/Linux when the sandbox is live and the draft changed; a macOS-only hint that an old-image sandbox needs Reset before folders appear. Read-write only in v1.
  • Desktop main: new sandbox-update-mounts IPC channel — shape (≤16 entries, non-empty string paths), structural validation via validateMountPaths from @codev/sandbox, and per-path stat all main-side, keeping the generic controller fs-free. normalizePersistedSandbox accepts old records (absent mounts) and drops malformed entries rather than the sandbox.
  • Renderer/app plumbing: preload exposes updateMounts; the sandbox connection carries the resolved runtime.mounts; the ServerConnection sandbox variant gains mounts?; seedSandboxProjects drops its single-mount assumption and opens one project per mounted folder, naming each after its host basename (a removed mount's project intentionally stays open — sessions may reference it).
  • i18n: new sandbox.mounts.* family + sandbox.server.mounts in en and es; sandbox.add.projectDirHint reworded — the folder set is no longer "cannot be changed later".
  • Bookkeeping: DIVERGENCES row 194 updated (widened connection variant, new i18n family); CHANGELOG entry including the macOS Reset caveat.

Behavior

Windows applies mount changes instantly (no restart — WSL drives are already automounted; saving is pure path translation). macOS/Linux restart the sandbox on save: guest disk state survives, running terminals and in-flight work stop, and the dialog says so before Save.

Tests

bun test && bun typecheck from packages/app (661 pass, incl. new mounts-model.test.ts) and packages/desktop (78 pass). Manual e2e still worth a pass per platform via bun dev:desktop; one flagged check: a hot mount update on Windows should not reconnect the SDK client (the connection key is unchanged).

🤖 Generated with Claude Code

@quickbeard
quickbeard force-pushed the sandbox-mounts-image branch from 82c0320 to abbc898 Compare August 14, 2026 06:30
@quickbeard
quickbeard force-pushed the sandbox-mounts-image branch from abbc898 to 14a80d9 Compare August 14, 2026 06:33
@quickbeard
quickbeard changed the base branch from sandbox-mounts-image to main August 14, 2026 06:33
Each sandbox's overflow menu (Settings -> Servers) gains a Folders...
item opening a manage-mounts dialog: the original project folder stays
fixed, extra host folders can be added (multi-select native picker) and
removed, read-write. Windows applies changes hot; macOS and Linux warn
that saving restarts the sandbox (disk state survives, the live session
drops), and macOS also hints that an old-image sandbox needs Reset
before new folders appear.

Wiring: a sandbox-update-mounts IPC channel validates shape, structure
(shared validateMountPaths: duplicates, nesting, UNC), and existence
main-side before calling the controller; normalizePersistedSandbox
tolerates old records and drops malformed mount entries rather than the
sandbox; the renderer connection carries the resolved runtime mounts.

The app mirrors the mount types (it never imports the node package),
validates the draft inline via mounts-model.ts for i18n-able messages,
and seedSandboxProjects now opens one project per mounted folder,
naming each after its host basename. The "cannot be changed later"
copy in the add dialog is reworded in en and es.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard
quickbeard merged commit db82d3b into main Aug 14, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the sandbox-mounts-ui branch August 14, 2026 06:35
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