Skip to content

Add version control command center#3177

Open
Quicksaver wants to merge 17 commits into
pingdotgg:mainfrom
Quicksaver:split/version-control-panel-work
Open

Add version control command center#3177
Quicksaver wants to merge 17 commits into
pingdotgg:mainfrom
Quicksaver:split/version-control-panel-work

Conversation

@Quicksaver

@Quicksaver Quicksaver commented Jun 19, 2026

Copy link
Copy Markdown

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

  • Added SOURCE_CONTROL.md to document the shipped Version Control panel behavior, entry points, layout, operations, error handling, and validation expectations.
  • Added SourceControlPanelService on 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.
  • Extended GitHub, GitLab, Azure DevOps, and Bitbucket provider plumbing so the panel can detect actionable branches relative to open PR/MR base branches.
  • Updated VcsStatusBroadcaster to support source-control refresh needs with ref-counted filesystem watching, ignored .git/ events, debounce/fingerprint suppression, and gitignore-aware filtering.
  • Added the React Version Control panel UI in the right panel with Actionable and Remotes sections, working-tree file selection, inline diffs, branch/stash/commit rows, context menus, and guarded destructive actions.
  • Added client presentation state and workspace-scope helpers so source-control UI state is tied to the active thread/project context and works after the connection-runtime updates.
  • Extended shared RPC, IPC, Git, settings, and VCS contracts for the new source-control snapshot and operation protocol.
  • Added desktop menu wiring and host display preferences for enabling the shared panel by runtime host, with VS Code defaulting to hidden so it does not compete with native Source Control.
  • Added focused tests for provider change-request base detection, source-control service behavior, VCS broadcaster behavior, source-control panel state, and workspace scope resolution.
  • Hardened review-discovered edge cases around default compare refs, non-current diverged branch merge sync, selected-file discard failures, fallback rename parsing, aggregate working-tree stats, and relative date formatting.

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 check passed with 0 errors. It reported existing lint warnings in unrelated mobile/web files.
  • pnpm exec vp run typecheck passed across all 15 configured targets.
  • Focused source-control service and panel logic tests passed after the review fixes.

Proof

Screenshot 2026-06-16 at 19 26 39

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 to SourceControlPanelService.

The web host lazy-loads SourceControlPanel from ChatView / RightPanelTabs, gated by enableSourceControlPanel (on by default in browser/desktop, off in VS Code). Branch/checkout changes from the panel update server thread metadata or draft context via handleSourceControlThreadRefChange.

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. VcsStatusBroadcaster gains 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 explicit separator items, and adds broad SourceControlPanelService / 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

  • Introduces SourceControlPanelService on 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).
  • Adds a SourceControlPanel UI 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.
  • Adds per-cwd filesystem watch loops in VcsStatusBroadcaster that debounce and filter events (ignoring .git internals and git-ignored paths) to trigger live status refreshes.
  • Extends GitHub, GitLab, and Azure DevOps source control providers to derive repository/project identifiers from remote URLs, scoping CLI calls to the correct repository.
  • Adds VS Code webview workspace scope utilities (resolveVscodeProjectScope, filterProjectsForVscodeScope, resolveVscodeInitialThreadRef) and a useHostDisplayPreferences hook for display preference synchronization.
  • Behavioral Change: default automatic git fetch interval changes from 30 seconds to 5 minutes.

Macroscope summarized 7d226ba.

- 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
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ff6b598d-e59e-4a7f-afd8-6c566df0b725

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Jun 19, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 4 potential issues.

Fix All in Cursor

❌ 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.

Comment thread apps/server/src/sourceControl/SourceControlPanelService.ts
Comment thread apps/web/src/components/source-control/SourceControlPanel.tsx
Comment thread apps/server/src/sourceControl/SourceControlPanelService.ts
Comment thread apps/web/src/components/source-control/SourceControlPanel.tsx Outdated
Comment thread apps/web/src/components/source-control/SourceControlPanel.tsx Outdated
Comment thread apps/server/src/sourceControl/SourceControlPanelService.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant