feat: add "hide whitespace changes" option for diffs#2389
feat: add "hide whitespace changes" option for diffs#2389ipanasenko wants to merge 3 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: Approved Self-contained UI feature adding a toggle to hide whitespace-only changes in diffs. Adds a client setting (defaulting to true), propagates it through the diff API, and passes You can customize Macroscope's approvability policy. Learn more. |
| autoOpenPlanSidebar: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), | ||
| confirmThreadArchive: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), | ||
| confirmThreadDelete: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), | ||
| diffIgnoreWhitespace: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), |
There was a problem hiding this comment.
true by default plsss
| diffIgnoreWhitespace: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), | |
| diffIgnoreWhitespace: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), |
There was a problem hiding this comment.
Yeah, I also like it true by all the way, decided to keep current behaviour. Same as GitHub.
Pushed default true
| const getTurnDiff: CheckpointDiffQueryShape["getTurnDiff"] = Effect.fn("getTurnDiff")( | ||
| function* (input) { | ||
| const operation = "CheckpointDiffQuery.getTurnDiff"; | ||
| const ignoreWhitespace = input.ignoreWhitespace ?? false; |
There was a problem hiding this comment.
| const ignoreWhitespace = input.ignoreWhitespace ?? false; | |
| const ignoreWhitespace = input.ignoreWhitespace ?? true; |
| cwd: tmp, | ||
| fromCheckpointRef, | ||
| toCheckpointRef, | ||
| ignoreWhitespace: false, |
There was a problem hiding this comment.
| ignoreWhitespace: false, | |
| ignoreWhitespace: true, |
Hey guys! First of all - I want to tell that I appreciate your work a lot ❤️
Theo's videos, T3 Code, advocating for open source - it's all amazing stuff.
I wanted to contribute this exact thing the moment T3 Code was open sourced, but saw "not accepting contributions" and decided not to.
I'm mostly using Codex App, but I'm trying T3 Code from time to time, curious how you guys improve it every day.
Surprisingly, no "hide whitespaces" feature yet.
I have to say, this is a huuge deal breaker for me, I love reviewing lesser chunks of code, and this is exactly what this feature is for.
Hope this will be useful not just for me, but for other too 🙏
This PR adds "Hide whitespace changes" to Settings and a toogle in diff sidebar:
Before/After
Hiding whitespace changes can dramatically simplify reviewing code.
Unified view
Split view
Note
Add "hide whitespace changes" toggle to the diff panel
diffIgnoreWhitespaceuser setting (defaulttrue) that controls whether whitespace-only changes are shown in diffs.CheckpointStoreLive.diffCheckpointspasses--ignore-all-spacetogit diffwhenignoreWhitespace: true; the flag propagates throughCheckpointDiffQueryand the React Query layer, with separate cache keys for each mode.true.getTurnDiffandgetFullThreadDiffnow default toignoreWhitespace: true, so existing callers that omit the flag will no longer see whitespace-only changes in diffs.Macroscope summarized 6d9a2ba.
Note
Medium Risk
Changes diff-generation behavior end-to-end (contracts → server git diff invocation → web query caching/UI) and defaults to ignoring whitespace, which may surprise existing callers and affects diff output semantics.
Overview
Adds a user-controlled “hide whitespace changes” mode for diffs. A new
diffIgnoreWhitespaceclient setting (defaulttrue) and a DiffPanel toggle (pilcrow icon) let users switch between normal diffs and whitespace-ignored diffs.Plumbs
ignoreWhitespacethrough the diff stack. Contracts and React Query keys/options now includeignoreWhitespaceto avoid cache collisions, and server-side checkpoint diff RPCs default toignoreWhitespace: truewhen omitted.Updates git-backed diff generation and tests.
CheckpointStore.diffCheckpointsconditionally adds--ignore-all-space, while checkpoint summary generation inCheckpointReactorexplicitly requests whitespace-aware diffs (ignoreWhitespace: false); tests are updated/expanded to cover both modes and defaults.Reviewed by Cursor Bugbot for commit 6d9a2ba. Bugbot is set up for automated code reviews on this repo. Configure here.