Add version control command center#3177
Conversation
- Query open change requests across supported remotes - Surface actionable branch rows only when local branch is behind the MR/PR base - Pass remote repository context to GitHub, GitLab, and Azure DevOps CLIs
…ol-panel-work # Conflicts: # apps/web/src/components/ChatView.tsx # apps/web/src/environmentApi.ts # apps/web/src/environments/runtime/service.threadSubscriptions.test.ts # packages/client-runtime/src/wsRpcClient.ts
- Extract shared source control panel state and API wiring - Move VS Code project scope and subagent parent resolution into runtime helpers - Add tests for presentation state and subagent control resolution
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 4 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4b645ae. Configure here.
ApprovabilityVerdict: Needs human review Diff is too large for automated approval analysis. A human reviewer should evaluate this PR. You can customize Macroscope's approvability policy. Learn more. |
- Treat same-name remotes as publish/pull upstreams - Split sync-state logic into shared web module - Cover publish target behavior with tests and docs
- Add `forceRefresh` support to query runners and runtime execution - Refresh cached SWR atoms before resolving so panel data stays current - Cover first-run and cached-refresh behavior with runtime tests
- Move sync refresh feedback into a compact spinner icon - Keep the banner for non-refresh sync messages
- Sum merged working-tree row stats across both sides - Keep default compare ref on the repository default branch - Restrict diverged merge sync to the checked-out branch - Surface tracked discard failures and rename sources - Move shared panel logic into the logic module
- Infer rename status for numstat fallback entries - Align diverged merge sync guard and disabled state - Clarify aggregate working-tree stats and date buckets

PR id: 3177
PR url: #3177
PR title: Add version control command center
PR target: pingdotgg/t3code:main
PR head: Quicksaver:split/version-control-panel-work
Summary
Adds a Git-backed Version Control surface to the existing right panel. The surface is scoped to the active project/repository, stays server-authoritative for Git operations, and can be opened from draft or existing conversations once repository context is available.
The feature is intentionally a command center rather than a full Git dashboard: it highlights currently actionable work from the working tree, local branches, stashes, and branch state versus configured remotes and open change-request bases.
What Changed
SOURCE_CONTROL.mdto document the shipped Version Control panel behavior, entry points, layout, operations, error handling, and validation expectations.SourceControlPanelServiceon the server for panel snapshots, branch/stash/commit/compare data, selected-file commit and stash flows, discard operations, branch operations, remote operations, and provider-derived PR/MR base checks.VcsStatusBroadcasterto support source-control refresh needs with ref-counted filesystem watching, ignored.git/events, debounce/fingerprint suppression, and gitignore-aware filtering.ActionableandRemotessections, working-tree file selection, inline diffs, branch/stash/commit rows, context menus, and guarded destructive actions.Why
This is an attempt at a version control center for T3 Code. Rather than building a full Git-based dashboard, it acts more as a command center that gives the user information on what is currently actionable based on their working tree and local branches versus existing remotes.
That keeps the surface focused on decisions users can take now: committing or stashing selected work, seeing branches that need sync or publication, inspecting stashes, and noticing when an open PR/MR base has moved ahead.
Validation
pnpm exec vp checkpassed with 0 errors. It reported existing lint warnings in unrelated mobile/web files.pnpm exec vp run typecheckpassed across all 15 configured targets.Proof
Note
High Risk
Introduces many server-side Git mutations (discard, push, rebase, branch delete) and live watcher-driven refreshes; mistakes could affect working trees or publish to wrong remotes despite scoped provider/repo parsing.
Overview
Adds a server-authoritative Version Control surface in the right panel: snapshots, working-tree actions, branch/sync/stash/remote operations, and compare/diff loading flow through new
vcs.panel.*WebSocket RPCs wired toSourceControlPanelService.The web host lazy-loads
SourceControlPanelfromChatView/RightPanelTabs, gated byenableSourceControlPanel(on by default in browser/desktop, off in VS Code). Branch/checkout changes from the panel update server thread metadata or draft context viahandleSourceControlThreadRefChange.Actionable rows combine Git fork detection with open PR/MR base checks: GitHub, GitLab, and Azure DevOps providers now pass
--repo/--repository(and Azure project) parsed from the active remote URL.VcsStatusBroadcastergains ref-counted cwd filesystem watchers (ignore.git, debounce,git check-ignore) so panel status can refresh without refocus.Also documents behavior in
SOURCE_CONTROL.md, extends Electron context menus with explicitseparatoritems, and adds broadSourceControlPanelService/ broadcaster / provider tests.Reviewed by Cursor Bugbot for commit 7d226ba. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add version control command center with a VCS panel for branches, commits, stashes, and remotes
SourceControlPanelServiceon the server with ~30 WebSocket RPC endpoints for Git operations (snapshot, branch details, file staging/unstaging/discarding, diffs, commit, pull/push/fetch, stash, merge, rebase, remote management, compare).SourceControlPanelUI surface in the right panel, gated by host display preferences and Git repository availability, with logic for branch sync state, file change merging, and relative date formatting.VcsStatusBroadcasterthat debounce and filter events (ignoring.gitinternals and git-ignored paths) to trigger live status refreshes.resolveVscodeProjectScope,filterProjectsForVscodeScope,resolveVscodeInitialThreadRef) and auseHostDisplayPreferenceshook for display preference synchronization.Macroscope summarized 7d226ba.