Repository navigation
feat(review): diff scopes, lazy per-file patches, split/wrap/whitespace toggles, syntax colour (#1493 C) - #1500
Conversation
…-file patches git.diff takes scope/ignoreWhitespace/path/full. Branch diffs the merge base with the thread's base to the working tree; turn reuses the newest checkpoint range. The list patch keeps whole files up to the old 100k budget and flags the rest (large: over the 60k per-file cap, lazy: past the budget) so the pane can fetch them one at a time (#1493). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and syntax colour in Changes The Git pane reviews Uncommitted, Whole branch or This turn, remembered per thread; staging, discard and commit stay on Uncommitted. Files whose patch was left out of the list payload load when opened, or behind Show anyway when large. Split, Wrap and Ignore whitespace persist globally. Diff lines and markdown code blocks are coloured by highlight.js core, loaded as its own chunk and filled in idle slices (#1493). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…oth diff views Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d28090877c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| */ | ||
| function budgetPatch(patch) { | ||
| const omitted = new Map(); | ||
| if (patch.length <= PATCH_TRUNCATE) return { patch, omitted }; |
There was a problem hiding this comment.
Enforce the per-file cap before returning the full patch
When the combined patch is at most 100 KB but one file exceeds the 60 KB per-file cap, this early return bypasses the chunk inspection entirely. For example, a single 63 KB file is returned inline without patchOmitted: "large", so the renderer eagerly parses and highlights it instead of showing the intended “Large diff” gate. Apply the per-file cap regardless of whether the total patch exceeds PATCH_TRUNCATE.
Useful? React with 👍 / 👎.
| // Porcelain status for all entries; -uall lists untracked files | ||
| // individually instead of collapsing whole directories into "?? dir/". | ||
| // raw: the 2-char XY column starts with a significant space. | ||
| const porcelain = await gitOutForDiffAsync(project, cwd, ["status", "--porcelain", "-uall"], { |
There was a problem hiding this comment.
Filter tracked status entries when ignoring whitespace
In the local-worktree Uncommitted scope, a tracked file whose only change is whitespace is still inserted from unconditional git status output even though the subsequent git diff -w patch and numstat are empty. I reproduced a whitespace-only edit returning one M file with 0 additions, 0 deletions, and an empty patch, so the “Ignore whitespace” view remains nonempty and shows “No textual diff” rather than hiding the change.
Useful? React with 👍 / 👎.
| // XY PATH or XY ORIG -> PATH for renames | ||
| const status = line.slice(0, 2).trim() || line.slice(0, 1); | ||
| // Branch scope takes tracked letters from name-status below. | ||
| if (scope === "branch" && status !== "??") continue; |
There was a problem hiding this comment.
Synthesize patches for untracked files in branch scope
In the local-worktree Whole branch scope, this explicitly retains untracked files, but every patch request still uses git diff, which does not include untracked contents. I reproduced a branch containing only new.txt returning the file row with an empty patch; selecting it shows “No textual diff,” and the per-file request is also empty. Either generate a /dev/null patch for these entries or mark them for a fetch path that reads their contents so newly created files can actually be reviewed.
Useful? React with 👍 / 👎.
Item C of #1493.
What changed
git diff -w). All persist.git.diffinput widened; no new channel.Verified independently, on main merged with this branch and #1498:
vite buildpasses. The main chunk is 1,068 kB; the highlighter isn't in it.-wand large files with the path-escape check.Known limits
origin/HEAD.🤖 Generated with Claude Code