feat(desktop): one Changes surface with an integrated top-bar ship flow

Merged
AV
2mo ago
+10440-5368

Summary

Makes the v2 workspace's Changes pane the single Changes surface — at PR-code-view parity — and consolidates every branch-lifecycle affordance into one top-bar control.

  • Changes pane ↔ PR Code tab parity: the pane uses the same card-styled diff, shared DiffViewToolbar (Files toggle, collapse/expand-all, unified/split), in-pane file panel, and sticky section bars as the PR view's Code tab, plus a pane-header link into the in-app PR view when a PR exists.
  • One Changes surface: the sidebar's Changes tab (staged/unstaged sections, commit filter, base-branch controls, discard, context menus) transplanted into the pane's left panel; the sidebar drops to Files/Review. Entry points: top-bar pill, ⌘⇧L, the + tab menu, and the empty state — all through one shared opener.
  • Top-bar ChangesControl: diff-stat pill (opens the pane) next to the PR badge — state-tinted icon, number, check indicators, hover detail card, merge dropdown + View on GitHub — which now opens the in-app PR view. The sidebar's old PR action header shrinks to drag region + open-in button.
  • Ship flow: before a PR exists the badge slot is a progressive action — Commit (message popover with a generated-fallback message) → Create PR (title prefilled from the latest commit subject, optional body, draft toggle; auto-pushes an unpublished/ahead branch) → the PR badge. Push is always a chevron away. Create PR disables with a tooltip when the branch has no commits ahead of its base.
  • Host-service: new git.commit, git.push (sets upstream on first push), and pullRequests.createForWorkspace (resolves head/configured base/live GitHub repo, refreshes the workspace's PR link immediately) with real-repo tests against a local bare remote.
  • Styling: pane header strips get a background, clearer Files-toggle open/closed state, hairline consistency.

Test plan

  • Desktop + host-service typecheck, biome, sherif
  • bun test: moved/changed suites (36 desktop) + host-service git router (136, incl. 6 new commit/push tests)
  • i18n: extract, compile --strict, stale-translation check; new strings hand-filled across all 16 locales
  • Live CDP verification: pane parity + entry points, pill → pane, PR badge → in-app PR view, draft PR menu shows no merge actions, Create PR popover prefill, Commit→Create PR transition after committing, disabled Create PR (no commits ahead) with tooltip

Changes open target (setting)

Settings → General gains "Changes open target" — whether the top-bar Changes control (and ⌘⇧L) opens the Changes view by splitting the current tab (Pane in current tab, the new default) or by focusing/creating a dedicated tab (New tab).

Pane in current tab (default) — clicking the top-bar control splits the active tab:

Open as pane in current tab

New tab — the same click focuses/creates a dedicated Changes tab:

Open as new tab

https://claude.ai/code/session_0185mve7uXCJud6RUoYZHzCG


Summary by cubic

The v2 workspace now uses one Changes surface in an integrated pane and top-bar control instead of a separate sidebar Changes tab, with the pane matching PR Code view. The control also handles branch shipping, and Settings → General now lets users choose whether it opens Changes in the current tab as a pane (the new default) or in a dedicated tab.

Changes surface

  • Reuses the PR Code view's card-styled diffs, file trees, toolbar, diffstats, comment navigation, and PR links.
  • Opens from the top bar, ⌘⇧L, the + menu, or the empty state; the selected open target applies to the top-bar control and shortcut.
  • Supports commit, range, uncommitted, and base-branch scopes, inline branch renaming, file selection, staging, discard, and context-menu actions.
  • Shows per-section +N/−N totals on section headers; picking the repo default as base clears the override.
  • Hides the file tree below 820px and lets the Files control reopen it.
  • Migrates persisted Changes rows to Files and removes the rightSidebarTab setter.
  • Stops offering dead terminal agents in the diff composer; a failed send now invalidates the agent-bindings query so the dead target drops out immediately.
  • Raises the PR diff fetch stdout cap to 200MB so large changesets (locale catalogs, lockfiles) load instead of failing with maxBuffer exceeded.

Ship flow

  • Adds Commit, Push, and Create PR actions with generated commit-message fallbacks, editable title prefill, draft support, and a no-commits-ahead guard against the configured base; the greyed-out Create PR item stays clickable and explains itself via toast.
  • Always pushes before creating a PR, reports push failures separately, and refreshes branch state, refs, and commits so the new PR links immediately.
  • Publishes workspace branches under their own remote name while preserving linked PR checkout tracking.
  • Consolidates PR status, merge, Ready for review, View on GitHub, and Open pull request actions in the badge menu, with the GitHub fallback retained for project-less workspaces.
  • Links the PR-created toast to both GitHub and the in-app PR view.

Summary by CodeRabbit

  • New Features
    • Added an integrated Changes pane with tree or folder views, filtering, refresh, diff statistics, collapse/expand controls, file actions, drag-and-drop, and comment navigation.
    • Added workspace actions for committing, pushing, and creating pull requests.
    • Added pull-request links and status actions in workspace and diff views.
    • Added Changes access from the tab menu, empty state, toolbar, and keyboard shortcuts.
  • Bug Fixes
    • Improved handling of conflicting file and folder paths.
    • Updated persisted workspaces to default to the Files view.
  • UI Updates
    • Removed the separate Changes sidebar tab and related preference controls.