Skip to content

feat(workspaces): decouple display name from git branch#87

Open
Rinat S (rsolmano) wants to merge 3 commits into
mainfrom
workspace-naming-ux-review
Open

feat(workspaces): decouple display name from git branch#87
Rinat S (rsolmano) wants to merge 3 commits into
mainfrom
workspace-naming-ux-review

Conversation

@rsolmano

Copy link
Copy Markdown
Collaborator

What & why

Workspace names rendered in the left-nav as kebab slugs (e.g. fix-auth-redirect) because a workspace's name doubled as its git branch. That reads poorly. This splits the two:

  • name — a human-readable display label (Title Case, spaces), shown in the sidebar.
  • branch — a kebab slug derived from the name and uniqued against refs + worktree dirs (git-clean, unchanged behavior).

The left-nav now shows the display name with a secondary monospace branch chip, rendered only when it differs from the name (so pristine workspace-N / legacy rows stay clean). The git branch stays glanceable for matching against git.

The contract already had separate name / branch fields — the server just forced them equal, so there is no wire-shape or protocol-version change.

Changes

  • assist — namers emit Title Case display names: naiveWorkspaceSlug → naiveWorkspaceName (Title Case phrase), toWorkspaceSlug → toWorkspaceName (casing-preserving clamp, so Add OAuth login survives), and suggestWorkspaceName's system prompt asks for a short human-readable name. Branch derivation stays out of assist.
  • workspaces — drop the name === branch invariant; createWorkspace / renameWorkspace set the display name and the derived branch independently. Display names may repeat; only the branch is uniqued (the chip disambiguates). The auto workspace-N placeholder is unchanged (name === branch).
  • host/autoRename — the pristine-gate keys off the branch (^workspace-\d+$), not the display name, so the format decoupling cannot break it.
  • webWorkspaceRow gains a secondary mono branch chip (data-testid="workspace-branch"), token utilities only.
  • specs — updated contracts / assist / workspaces / host / panels SPECs to record the decoupling.

Out of scope

  • A workspace.rename wire method / UI rename affordance (does not exist today).
  • A name field in the New-Workspace dialog (it sends no name today).
  • Migrating/prettifying existing workspace names (they keep their stored name, which equals their branch).

Verification

  • check:deps + lint + typecheck — green (pre-commit).
  • bun run test — 151 server unit tests pass (updated assist / workspaces / autoRename specs), plus web/contracts.
  • bun run e2e (no-agent gate) — passes; the intermittent failures observed were confirmed flaky (each passed in isolation; different specs failed across runs, none in the changed area).
  • e2e/auto-rename.live.spec.ts (AGENT, Inc. (@agent)) updated to assert Title Case names + the branch chip.

Workspace names rendered in the left-nav as kebab slugs because a
workspace's name doubled as its git branch. Split the two: `name` is now
a human-readable display label (Title Case, spaces) and `branch` is a
kebab slug derived from it and uniqued against refs + worktree dirs. The
left-nav shows the name with a secondary monospace branch chip, rendered
only when it differs from the name (pristine/legacy rows stay clean).

- assist: namers emit Title Case display names (naiveWorkspaceName,
  toWorkspaceName preserving casing); branch derivation stays in workspaces
- workspaces: drop the name === branch invariant; createWorkspace /
  renameWorkspace set name + derived branch independently; display names
  may repeat, only the branch is uniqued
- host/autoRename: pristine gate keys off the branch, not the display name
- web: WorkspaceRow gains a secondary mono branch chip (workspace-branch)
- specs updated: contracts / assist / workspaces / host / panels
…chip

The git branch now renders on a second line beneath the display name
instead of an inline chip, so the name and branch stop competing for
horizontal width and both read fully. The branch line is still shown only
when it differs from the name, so pristine/legacy `workspace-N` rows stay
a single compact line (the row grows to fit via min-h-7 + py-xs).

Updates panels + workspaces SPECs and the @agent auto-rename spec's
comments/locator (the workspace-branch testid is unchanged).
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