Skip to content

fix(web): one-repo workspaces get their git controls back - #332

Merged
LoganRupe merged 1 commit into
multi-repo-workspacesfrom
bug/323/one-repo-workspace-git-controls
Oct 1, 2026
Merged

LoganRupe merged 1 commit into
multi-repo-workspacesfrom
bug/323/one-repo-workspace-git-controls

Conversation

@LoganRupe

@LoganRupe LoganRupe commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

What Changed

A .code-workspace project that lists one git repo now runs the chat view's git surfaces in that repo. That covers git status, the header's git actions, the checkout and branch strip under the composer, switching the checkout back to a thread's branch, and the PR checkout dialog.

Ordinary projects resolve to the same directory as before. Multi-repo workspaces are untouched: their git surfaces already fan out per repo.

Why

Follow-up 3 from the review of #325 on #323.

For a workspace-file project, workspaceRoot is only the folder holding the .code-workspace. With one repo listed, ChatView probed that folder for git status, got isRepo: false, and hid everything gated on it: the checkout strip, New worktree, and the header's git actions, which offered Initialize Git instead. So a one-repo workspace could not start an isolated run. The branch toolbar, diff panel, sidebar and server already anchor on the repo root through resolveAnchorRepoRoot. ChatView was the one place that did not.

UI Changes

Before (83a7449) on the left, this branch on the right. scope-test-three lists the repo api and the plain folder docs. An existing thread is opened, then a new thread picks New worktree and sends a message. On the left there is no strip to pick from and the run starts in the workspace folder. On the right the run starts in a worktree of api.

_Video:

compare.mp4

A .code-workspace project's workspaceRoot is only the folder holding the file,
so the chat view probed a non-repo for git status and hid the checkout strip,
New worktree and the header's git actions. With one repo listed, status, the
header's git actions, checkout switching and PR checkout now run in that repo.
Copilot AI balanced review requested due to automatic review settings October 1, 2026 00:32
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Oct 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The targeted routing fix preserves existing ordinary and multi-repo behavior with focused test coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Routes single-repo workspace Git controls to the actual repository root.

Changes:

  • Adds centralized Git cwd resolution.
  • Applies it to status, header actions, branch switching, and PR checkout.
  • Adds focused resolver tests.
File Description
ChatView.tsx Uses the resolved repository cwd across Git surfaces.
ChatView.logic.ts Adds project Git cwd resolution.
ChatView.logic.test.ts Covers ordinary, single-repo workspace, and multi-repo cases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@LoganRupe
LoganRupe merged commit 995120e into multi-repo-workspaces Oct 1, 2026
8 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants