Skip to content

feat(web): stage and unstage files from the diff view and filter by index state - #100

Merged
MTVaught merged 1 commit into
mainfrom
t3code/stage-files-in-diff-view
Sep 19, 2026
Merged

MTVaught merged 1 commit into
mainfrom
t3code/stage-files-in-diff-view

Conversation

@MTVaught

Copy link
Copy Markdown
Owner

Problem

Reviewing agent output in the diff panel had no way to mark a file as reviewed. Every turn re-rendered the whole working tree against HEAD, so files that were already accepted came back mixed in with the new edits, and there was no way to narrow the view to what still needed a look.

Fix

The Working tree scope now supports git's index as the review checklist:

  • Stage and unstage buttons in each file header, plus a Staged / Partially staged badge. Stage all / Unstage all act on the files currently shown.
  • A filter with All, Unstaged, and Staged. Unstaged diffs the index against disk (untracked files included), so after staging the reviewed files and running the agent again, it shows only the new edits, including new edits to files that were already staged. Staged diffs HEAD against the index. The choice persists per thread.
  • Full-file expansion reads the index for the staged and unstaged views.

Server side, the git driver builds the three diffs through the same rename-aware path and the existing temporary-index trick for untracked files. Per-file staging state comes from git status --porcelain=v1 -z. Staging uses git add --all / git reset with NUL-delimited literal pathspecs from the repository root, so paths from a nested workspace and pathspec-magic filenames work. A new vcs.stagePaths RPC carries it; the contract additions are optional so older clients and mobile keep decoding.

Mobile is unchanged and shows the unfiltered working tree without staging controls.

Tests

  • Driver: porcelain parsing, filtered previews with staging state, a staged rename, index-based file expansion, stage/unstage from a nested cwd.
  • Web: per-thread filter in the diff panel store.

Evidence

Before/after screenshots pending; will attach after a live pass in the web app.

Built with Claude Fable 5.1 via Claude Code in T3 Code.

@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 19, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.6 KiB −9 B (−0.1%) 15.1 KiB ✅
Codex Thread snapshot wire 7.1 KiB 7.1 KiB +8 B (+0.1%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.5 KiB 6.5 KiB −17 B (−0.3%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 57.0 KiB 57.0 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 8 8 0 (0.0%) 21 ✅
Claude Total thread wire 13.5 KiB 13.6 KiB +152 B (+1.1%) 15.1 KiB ✅
Claude Thread snapshot wire 7.1 KiB 7.1 KiB −8 B (−0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.4 KiB 6.6 KiB +160 B (+2.4%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.0 KiB 57.9 KiB +928 B (+1.6%) 66.4 KiB ✅
Claude Live turn messages 8 10 +2 (+25.0%) 21 ✅

Baseline: e992109 · PR result: 89a5908 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant