Repository navigation
Show Source Control for Folder Workspaces - #6432
brennanb2025 wants to merge 5 commits into
Conversation
|
Warning Review limit reached
More reviews will be available in 9 minutes and 27 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe base-ref lookup path now passes optional repo path and execution host context through the preload bridge, runtime client, and main IPC handlers. The right sidebar now routes folder workspaces to a dedicated source control panel, adds folder-workspace refresh scheduling, and updates embedded SourceControl behavior to use scoped worktree and connection state. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
src/renderer/src/components/right-sidebar/FolderWorkspaceSourceControlPanel.tsx (2)
92-157: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winRedundant
refreshCandidatesin effect deps defeats therefreshCandidateSignaturegate.
refreshCandidateSignatureis computed to suppress unnecessary effect re-runs, butrefreshCandidates(a fresh array reference wheneverrepos,childWorktrees,expandedWorktreeIds, ormanualWorktreeIdschange identity) is also listed in the dependency array and used in the body. Because the array identity changes even when the signature is unchanged (e.g. areposstore update that doesn't affect these worktrees), the effect re-runs, invalidates the in-flight generations, and restarts the limited refreshes — so the signature memo currently adds no value.Consider reading the candidates from a ref keyed by the signature so the effect depends only on
refreshCandidateSignature(plus the stable deps/setters).
36-38: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional:
refreshOutcomesis never pruned when worktrees detach.Entries accumulate in
refreshOutcomesfor every worktree id ever seen and are not removed when a worktree leaveschildWorktrees.isRefreshingalready filters bycurrentChildWorktreeIds, so this is functionally harmless, but the map grows unbounded over a long session. Consider pruning to the current child ids alongside theexpandedWorktreeIdscleanup effect.Also applies to: 159-165
src/main/ipc/repos.ts (1)
2407-2419: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winType the search handler args as
BaseRefSearchArgsfor contract consistency.
getBaseRefDefaultwas updated toBaseRefRepoLookupArgs, but these two handlers still declare{ repoId; query; limit? }. They forwardargsstraight intosearchBaseRefDetailsForRepo(store, args: BaseRefSearchArgs), sorepoPath/executionHostIdonly survive because JS keeps extra object properties. The annotation hides the discriminators a caller now relies on; a futureconst { repoId, query, limit } = argsrebuild would silently drop them and revert duplicate-repo-id lookups to the wrong host.♻️ Align handler arg types
ipcMain.handle( 'repos:searchBaseRefs', - async (_event, args: { repoId: string; query: string; limit?: number }) => { + async (_event, args: BaseRefSearchArgs) => { return (await searchBaseRefDetailsForRepo(store, args)).map((entry) => entry.refName) } ) ipcMain.handle( 'repos:searchBaseRefDetails', - async (_event, args: { repoId: string; query: string; limit?: number }) => { + async (_event, args: BaseRefSearchArgs) => { return searchBaseRefDetailsForRepo(store, args) } )
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 8ee1109d-49db-437f-b299-e88342e2924f
📒 Files selected for processing (25)
src/main/ipc/repos-remote.test.tssrc/main/ipc/repos.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/components/right-sidebar/FolderWorkspaceSourceControlPanel.test.tsxsrc/renderer/src/components/right-sidebar/FolderWorkspaceSourceControlPanel.tsxsrc/renderer/src/components/right-sidebar/SourceControl.preview-open.test.tsxsrc/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/activity-bar-buttons.tsxsrc/renderer/src/components/right-sidebar/folder-workspace-source-control-refresh.test.tssrc/renderer/src/components/right-sidebar/folder-workspace-source-control-refresh.tssrc/renderer/src/components/right-sidebar/folder-workspace-source-control-section.tsxsrc/renderer/src/components/right-sidebar/index.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.tssrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.tssrc/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-titlebar-drag-regions.render.test.tsxsrc/renderer/src/components/right-sidebar/useGitHistoryCommitActions.tssrc/renderer/src/components/settings/BaseRefPicker.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/runtime/runtime-repo-client.ts
|
Moving this PR to draft because it has been untouched for more than 80 days (latest recorded PR activity or commit timestamp: 2026-06-27T01:10:38Z; checked on 2026-10-27). This keeps the review queue focused on active work while preserving the proposal. Please mark it ready for review when work resumes. |
|
Superseded by #38831, which shipped Source Control for folder workspaces. |
Summary
Adds a Source Control activity to folder workspaces so a top-folder import can show one collapsible Source Control section per attached child worktree. Embedded child sections reuse the regular Source Control UI while scoping git status, file opens, history actions, and base-ref lookup/search to the child worktree and its repo host.
The implementation keeps hosted-review/create-review surfaces disabled in embedded child sections until those APIs can be safely host-scoped end to end. Base-ref changes from embedded sections are saved on the worktree, not the repo, to avoid duplicate repo-id ambiguity.
Design and implementation
design-docs/multi-repo-folder-source-control.md.auto-design-review-fixcompleted READY.FolderWorkspaceSourceControlPanel, bounded/tokenized child refresh scheduling, folder-workspace Source Control visibility, embeddedSourceControlscoping, and host-aware base-ref IPC viarepoPath + executionHostId.Review
Validation
pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/right-sidebar/right-sidebar-titlebar-drag-regions.render.test.tsx src/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.ts src/renderer/src/components/right-sidebar/FolderWorkspaceSourceControlPanel.test.tsx src/renderer/src/components/right-sidebar/SourceControl.preview-open.test.tsx src/renderer/src/components/right-sidebar/folder-workspace-source-control-refresh.test.ts src/main/ipc/repos-remote.test.ts- 6 files / 138 tests passed after the CI expectation fix.pnpm run typecheck.pnpm run lint.git diff --check- clean aside from Windows CRLF warnings.pnpm build:relayduring Brennan validation.brennanb2025/kahawai, rootC:\Users\neil\orca\workspaces\orca\kahawai.alpha-repoandbeta-repounder a folder workspace.2 attached worktrees, collapsible child sections, and each embedded Source Control section showed its own changed/untracked files.repoPath + executionHostIdreturned the scoped child repo default.Wsl/Service/E_UNEXPECTED, and no disposable SSH target was configured. Brennan will run SSH validation separately before merge.Screenshot evidence:
.context/multi-repo-source-control-validation-20260626/folder-source-control-initial.png.context/multi-repo-source-control-validation-20260626/folder-source-control-both-expanded.png.context/multi-repo-source-control-validation-20260626/folder-source-control-base-ref-picker.pngCleanup
Validation cleanup removed the disposable child worktrees, folder workspace, project group, imported repos, temp repos/profile/worktree directories, and stopped the Electron process tree started for validation.
Post-PR stabilization
verifyfailure by updating the folder-workspace sidebar titlebar test expectation for the newly visible Source Control activity.verifypasses.@coderabbitai review; CodeRabbit repliedReview finishedand did not leave actionable review comments.verifyandtrack-community-pr.