fix(file-explorer): search folder workspace roots#6170
Conversation
📝 WalkthroughWalkthrough
Tests are added: a unit test for 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The file-explorer name search returned zero results whenever the workspace root was a monorepo parent opened as a FolderWorkspace. useRuntimeFileListForWorktree resolved its worktree via useWorktreeById, which only reads worktreesByRepo, so a folder-workspace key resolved to null and the effect early-returned with setFiles([]). Resolve the Quick Open file-list target through getKnownWorktreeById so folder workspaces supply their root path (folderPath) even when absent from worktreesByRepo, and recompute connectionId from subscribed store state via getConnectionIdFromState so SSH folder roots are not left stale after hydration. Supersedes community PR #6170; adds a dedicated getConnectionIdFromState unit test that asserts resolution from a passed-in state snapshot. Fixes #5939 Co-authored-by: bennewell35 <142949922+bennewell35@users.noreply.github.com>
Resolve the File Explorer and Quick Open runtime file-list target through known worktrees so folder workspaces provide their root path, and make connectionId resolution reactive for SSH folder workspaces after store hydration. Supersedes #6170. Co-authored-by: bennewell35 <142949922+bennewell35@users.noreply.github.com>
Summary
worktreesByRepo.connectionIdfrom subscribed store state so hydration does not leave SSH folder roots stale.Fixes #5939.
Screenshots
N/A - no visual UI change. This affects Quick Open file-list loading for folder workspace roots.
Testing Checklist
Tests
pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/quick-open-file-list.test.ts src/renderer/src/components/quick-open-file-list.react.test.tsx src/renderer/src/lib/connection-context.test.ts src/renderer/src/lib/worktree-runtime-owner.test.tspnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/right-sidebar/useFileExplorerVisibleRowProjection.test.tspnpm exec vitest run --config config/vitest.config.ts --environment happy-dom src/renderer/src/components/right-sidebar/FileExplorer.test.tsxpnpm exec oxlint src/renderer/src/components/quick-open-file-list.ts src/renderer/src/components/quick-open-file-list.test.ts src/renderer/src/components/quick-open-file-list.react.test.tsx src/renderer/src/lib/connection-context.tspnpm run typecheckgit diff --check origin/main..HEADReview Report
Security Audit