Repository navigation
fix(web): one-repo workspaces get their git controls back - #332
Merged
LoganRupe merged 1 commit intoOct 1, 2026
Merged
Conversation
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.
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
A
.code-workspaceproject 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,
workspaceRootis only the folder holding the.code-workspace. With one repo listed, ChatView probed that folder for git status, gotisRepo: 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 throughresolveAnchorRepoRoot. ChatView was the one place that did not.UI Changes
Before (83a7449) on the left, this branch on the right.
scope-test-threelists the repoapiand the plain folderdocs. 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 ofapi._Video:
compare.mp4