Skip to content

git diff pane + diff qol#1801

Draft
itsfrank wants to merge 1 commit intopingdotgg:mainfrom
itsfrank:git-diff-pane
Draft

git diff pane + diff qol#1801
itsfrank wants to merge 1 commit intopingdotgg:mainfrom
itsfrank:git-diff-pane

Conversation

@itsfrank
Copy link
Copy Markdown

@itsfrank itsfrank commented Apr 7, 2026

Addresses #1590 and #1122

What Changed

  • added diff toggle button that switches between session/turn diffs and full git worktree diff
  • diff QoL (applied to both git and session/turn diff views)
    • added ability to expand/collapse individual file diff cards
    • added button to expand/collapse all
    • made file diff card headers smaller/more compact
    • removed icons for added/remove/changed file status, opting for coloring the file name instead (de-cluttering the card headers)

Why

I will often use agents in combination with manual changes or with other agents. When I do this, I need the ability to review the changes to the branch holistically. T3 Code's diff UI is actually quite pleasant to read, and thus I wanted to have the ability to review the entire branch's changes from the primary UI I use in development. I find that this is critical when using a generative tooling like T3 Code for real production workflows that will affect real users.

UI Changes

Diff pane buttons

before:
image

after:
image
(red: git/session toggle, blue: expand/collapse all)

Smaller diff card headers

before:
(tbd, I dont have the ability to create session diffs on this laptop)

after:
image

Checklist

  • This PR is small and focused
    • unfortunately no, this PR contains multiple separate changes, I am keeping it as a draft for reference to help move various conversations along. If the code for specific features looks OK, I will happily slice the PR into multiple feature-specific PRs
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add git working tree diff pane with session/git scope toggle to DiffPanel

  • Adds a readWorkingTreeDiff method to GitCore that generates a unified patch covering tracked, staged, unstaged, and untracked changes, handling repos with or without an initial commit.
  • Exposes the diff over WebSocket via a new git.diff RPC method, wired through contracts, transport, and native API layers.
  • Updates DiffPanel.tsx with a toggle between 'session' and 'git' diff scopes, per-file collapse/expand controls with add/delete counts, and persisted state in localStorage.
  • Adds diffScope to the diff route URL search params; ChatView now sets diffScope: "session" when opening a turn diff.
  • Behavioral Change: DiffPanel no longer opens files in the editor when clicking a file header.
📊 Macroscope summarized 218fee3. 15 files reviewed, 2 issues evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

@github-actions github-actions bot added size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 7, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

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: 22769acd-8272-44c7-9d3b-6a579eed9c79

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.


const trackedPatchSegments = headExists
? [
yield* runGitStdoutWithOptions(
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.

🟡 Medium Layers/GitCore.ts:1362

readWorkingTreeDiff passes maxOutputBytes: LARGE_DIFF_MAX_OUTPUT_BYTES but leaves truncateOutputAtMaxBytes as the default false. When the diff exceeds 5MB, collectOutput throws a GitCommandError instead of truncating. This is inconsistent with prepareCommitContext and readRangeContext, which both set truncateOutputAtMaxBytes: true to handle large outputs gracefully. Consider adding truncateOutputAtMaxBytes: true to all three runGitStdoutWithOptions calls in this function.

🤖 Copy this AI Prompt to have your agent fix this:
In file apps/server/src/git/Layers/GitCore.ts around line 1362:

`readWorkingTreeDiff` passes `maxOutputBytes: LARGE_DIFF_MAX_OUTPUT_BYTES` but leaves `truncateOutputAtMaxBytes` as the default `false`. When the diff exceeds 5MB, `collectOutput` throws a `GitCommandError` instead of truncating. This is inconsistent with `prepareCommitContext` and `readRangeContext`, which both set `truncateOutputAtMaxBytes: true` to handle large outputs gracefully. Consider adding `truncateOutputAtMaxBytes: true` to all three `runGitStdoutWithOptions` calls in this function.

Evidence trail:
apps/server/src/git/Layers/GitCore.ts lines 1360-1391 (REVIEWED_COMMIT): three runGitStdoutWithOptions calls in readWorkingTreeDiff with only `maxOutputBytes` set. apps/server/src/git/Layers/GitCore.ts lines 600-607: collectOutput throws GitCommandError when truncateOutputAtMaxBytes is false and max exceeded. apps/server/src/git/Layers/GitCore.ts lines 1452-1460 (prepareCommitContext) and 1652-1676 (readRangeContext): all set `truncateOutputAtMaxBytes: true`.

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

Labels

size:XL 500-999 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