Repository navigation
Conversation
…list For a .code-workspace project the files panel and @ search now span every folder the file lists that exists on disk, git or not, instead of the git repos (two or more) or the whole workspace folder (one). Git surfaces keep using repoRoots. Fixes #323
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The file browser retains path-keyed caches when refreshed roots change, potentially showing files from the previous folder.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Updates workspace-backed file browsing and @ search to use listed .code-workspace folders while preserving Git-specific repoRoots.
Changes:
- Resolves file roots from existing workspace folders with worktree substitution.
- Refreshes workspace-file data after dialog reads and saves.
- Renames file component props from
repoRootsto generalizedroots.
| File | Description |
|---|---|
apps/web/src/lib/projectFileRoots.ts |
Resolves workspace file roots. |
apps/web/src/lib/projectFileRoots.test.ts |
Tests root resolution behavior. |
apps/web/src/components/ProjectFoldersDialog.tsx |
Refreshes workspace data on open/save. |
apps/web/src/components/files/FilePreviewPanel.tsx |
Passes generalized roots to file UI. |
apps/web/src/components/files/FileBrowserPanel.tsx |
Browses and searches generalized roots. |
apps/web/src/components/files/FileBreadcrumbs.tsx |
Labels generalized root breadcrumbs. |
apps/web/src/components/ChatView.tsx |
Connects workspace-file folders to browsing and mentions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@dotrahat could you review this when you get a chance? |
The file tree cached folders by their label, so a listed folder whose path changed under the same name (docs -> archive/docs) kept showing the old contents; it now remounts when its roots change. Roots now carry the label of the folder they came from, so an isolated run of two repos named `app` shows client/app and server/app instead of their worktrees' app and app-2, in the tree, the breadcrumbs and @ search.
|
@LoganRupe Thanks for turning this around so fast. It merged before I finished, so here's my review as follow-ups. I tested an AppImage built from Test results
E also fixes a bug I was about to file: the dialog used a cached read for 30 seconds, so reopening it soon after a save showed the old folder list, and saving that list dropped folders from the file without a warning. The new tests pass, the web typecheck is clean, and lint shows no new warnings in the changed files. Follow-ups1. Chat file links still resolve against 2. The folder list only refreshes through Manage folders (F, H). Nothing reliably re-reads the chat view's 3. One-repo workspaces can't start isolated runs. The PR notes that one-repo workspaces still offer Initialize Git. The effect is wider: with one repo, 4. Not covered here, for a decision later:
Happy to open issues for any of these. |

What Changed
For a
.code-workspaceproject, the files panel and@search now show every folder the file lists that exists on disk, git or not, however many repos there are. Diffs, checkpoints, PRs and git status still userepoRoots.ChatView reads the folder list through the existing
readWorkspaceFilequery instead of storing it on the project, as #323 suggested. That means no new column and no migration 060. The folders dialog now re-reads the file when it opens and after a save, so the panel follows edits without a reload. In an isolated run, a repo that has its own worktree is shown as that worktree. Multi-repo isolated runs used to show the original checkouts here. Each root keeps its repo's name, so two repos namedappshow asclient/appandserver/apprather than their worktrees'appandapp-2. The tree remounts when a folder's path changes under the same name, so it doesn't keep showing the old folder's contents.The file components'
repoRootsprop is nowroots, since it can hold plain folders.Why
With two or more repos, the panel and
@search only showed the git folders, so a listed plain folder likedocswas missing. With one repo, they showed the whole folder the file sits in, so unlisted folders appeared.Not covered here: a workspace that lists a single folder still shows the whole workspace folder, and one-repo workspaces still offer Initialize Git.
Fixes #323
UI Changes
Before (b36c4d2) on the left, this branch on the right. Two repos plus a listed plain
docsfolder, then one repo withdocsand an unlistedluigifolder._Video:
compare.mp4