feat: add "hide whitespace changes" option for diffs#2389
feat: add "hide whitespace changes" option for diffs#2389juliusmarminge merged 5 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)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 This PR adds a straightforward user preference for hiding whitespace changes in diffs. The change is well-scoped, includes comprehensive tests, and only affects diff display formatting. Review comments have been addressed. 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, |
Dismissing prior approval to re-evaluate a1c2eaf
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 diff panel and settings
diffIgnoreWhitespaceclient setting (defaulttrue) that controls whether diffs suppress whitespace-only changes.ignoreWhitespaceinto the checkpoint diff query.diffCheckpointsin CheckpointStore.ts conditionally appends--ignore-all-spaceto the git diff command whenignoreWhitespaceis true.ignoreWhitespaceis propagated through the full call chain: contracts → React Query helpers (included in cache key) →getTurnDiff/getFullThreadDiff→diffCheckpoints.ignoreWhitespacenow gettruevia the?? truedefault in CheckpointDiffQuery.ts.CheckpointReactorexplicitly passesfalseto preserve existing behavior.Macroscope summarized 27d3b21.
Note
Medium Risk
Medium risk because it changes the diff generation contract end-to-end (web query keys/RPC inputs through server
git diffinvocation), which could affect diff caching and checkpoint diff outputs across clients.Overview
Adds a new “hide whitespace changes” capability for turn/thread diffs, controlled by a persisted client setting (
diffIgnoreWhitespace, defaulting totrue) and a DiffPanel toolbar toggle.Threads the new
ignoreWhitespaceflag through the diff pipeline (contracts, React Query request + cache keys, serverCheckpointDiffQuery, andCheckpointStore.diffCheckpoints), and implements it by conditionally addinggit diff --ignore-all-space. Tests are updated/added to assert default behavior and that caches don’t collide across whitespace modes.Reviewed by Cursor Bugbot for commit 27d3b21. Bugbot is set up for automated code reviews on this repo. Configure here.