Skip to content

fix(app): show the host folder name while a sandbox project is unnamed - #258

Merged
quickbeard merged 1 commit into
mainfrom
sandbox-name-flash
Aug 17, 2026
Merged

quickbeard merged 1 commit into
mainfrom
sandbox-name-flash

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

What

A freshly created sandbox's project briefly showed "workspace" in the sidebar before flipping to the selected folder's name. The label comes from displayName() = name || basename(worktree), the guest worktree is the fixed mount point /workspace, and the real name only arrives after adoptFolderName's rename round-trips through the guest server (record reported → project.update → project.updated event).

The fix is a display-only fallback: enrich() in context/global.tsx fills an unnamed sandbox project's label from the new fork-only helper sandboxProjectHostName (packages/app/src/sandbox/projects.ts), which maps the connection's guest paths back to the host folders the app already knows:

  • the primary folder → conn.projectDir's basename, matched by the synced primary directory — with the /workspace literal as a pre-sync fallback so a relaunch doesn't flash either;
  • extra mounts → the matching conn.mounts[].path basename.

Non-sandbox servers and already-named projects are untouched; the helper returns nothing for unknown guest paths. The durable server-side rename is unchanged and takes precedence the moment it lands, as does any name the user set themselves. (On WSL there was no flash to begin with — the guest primary is the translated host path, whose basename already matches.)

Notes

  • Unit tests for the helper in packages/app/src/sandbox/projects.test.ts (primary via synced directory, WSL-shaped primary, pre-sync /workspace, extra mounts, unknown paths, non-sandbox servers).
  • DIVERGENCES.md gains a row for the one-line global.tsx edit with on-conflict guidance; CHANGELOG.md records the user-facing change.
  • bun typecheck and the src/sandbox suite (20 tests) pass from packages/app.

🤖 Generated with Claude Code

A sandbox's project folder is mounted at a fixed guest path, so a
fresh project record has no name and displayName() fell back to the
guest worktree's basename — "workspace" — until adoptFolderName's
rename round-tripped through the guest server (record reported →
project.update → project.updated event).

enrich() now fills an unnamed project's label from the fork-only
sandboxProjectHostName, which maps the connection's guest paths back
to host folders: conn.projectDir for the primary (matched by the
synced primary directory, or the /workspace literal before sync loads
on a relaunch) and conn.mounts[].path for extras. Display-only: the
durable server-side rename is unchanged and wins the moment it lands,
as does any name the user set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard
quickbeard merged commit d5a84b0 into main Aug 17, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the sandbox-name-flash branch August 17, 2026 11:04
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