Skip to content

fix(app): name a sandbox's project after its folder, and explain the field - #223

Merged
quickbeard merged 1 commit into
mainfrom
sandbox-folder-clarity
Aug 13, 2026
Merged

quickbeard merged 1 commit into
mainfrom
sandbox-folder-clarity

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Two things about a sandbox's project folder were left to be discovered.

The workspace label

Inside a sandbox the folder is mounted at a fixed guest path, so displayName (project.name || getFilename(worktree)) fell back to the basename of /workspace. Every sandbox on the machine showed the same meaningless label in the sidebar, tabs and command palette, and nothing anywhere tied one back to the host folder it works on — which reads as "the sandbox ignored the folder I chose".

It doesn't. Verified on a live sandbox: guest /workspace has the same files as its host folder, same git branch, writable. Only the label was wrong.

Each sandbox now names its project after the folder it was created with, so a sandbox on ~/repos/codev-hub reads codev-hub. Written through client.project.update — the call behind rename-project — so the name persists in the guest and reaches every surface, rather than being patched into each of the many displayName call sites.

Two rules: only when the project has no name (a name the user chose must survive the next launch), and once per run, since the rename lands back as a project.updated event and the effect can re-run before it arrives. A failed rename is retried rather than swallowed.

Carrying the host path needs it on the connection, so the sandbox sidecar variant gains an optional projectDir, populated in readySandboxConnections.

The unexplained field

The dialog asked for a folder with no indication of what it commits you to: it's the only part of the machine the sandbox can reach, it's fixed for the sandbox's lifetime, and the agent edits files in it without asking (sandboxes inject permission: "allow"). Now stated above the field, en and es.

Choose the folder you want to work on. It is the only folder on this computer the sandbox can reach, it cannot be changed later, and the agent edits files in it without asking.

The field stays mandatory and is deliberately not prefilled — picking a folder should be a decision, not a default someone clicks past.

Verification

Five new tests in test-browser/sandbox-projects.test.ts, on top of the six from #221: names from the host folder, takes the last segment of a Windows path (WSL sandboxes get a Windows projectDir), never renames over a user's name, does nothing before the server reports a project, renames once across effect re-runs, and retries after a failure.

bun typecheck + bun run test:unit (657) + bun run test:browser (57) clean in packages/app; bun typecheck clean in packages/desktop.

Note for existing sandboxes

The name is applied on next launch. Two sandboxes on this machine also carry a stale /home/codev/.cache/codev project row — leftovers from the picker opening on the guest home before #221 seeded the real project. Those are user data, so nothing here removes them; close the row to clear it.

🤖 Generated with Claude Code

…field

Two things about the project folder were left to be discovered.

Inside a sandbox the folder is mounted at a fixed guest path, so the project
read "workspace" in the sidebar, tabs and command palette — the same label for
every sandbox on the machine, with nothing anywhere tying one back to the host
folder it works on. Name it after that folder instead, written through
client.project.update (the call behind rename-project) so the name persists in
the guest and reaches every surface. Only ever when the project has no name:
a name the user chose must survive the next launch. Carrying it needs the host
path on the connection, so the sandbox sidecar variant gains projectDir.

The Add sandbox dialog asked for a folder with no indication that it is the
only part of the machine the sandbox can reach, that it cannot be changed
afterwards, or that the agent edits files in it without asking. Say so above
the field.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard force-pushed the sandbox-folder-clarity branch from 734ba04 to e4f613e Compare August 13, 2026 09:08
@quickbeard
quickbeard merged commit 25956ea into main Aug 13, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the sandbox-folder-clarity branch August 13, 2026 09:08
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