Repository navigation
Hide whitespace changes on the Code tab, with a row that shows them - #75
Conversation
The Code tab hides changes to whitespace at first, as the desktop's diffIgnoreWhitespace setting does, and a row above the fold row shows them or hides them again. Each hunk is compared again without whitespace by a port of jsdiff 9.0.0's line diff, checked against the desktop's own filter on 59 recorded patches. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tespace row A hunk too large for the steps left no longer takes the smaller hunks after it down with it: the hunks are compared from the fewest lines up. Tests cover the row's label, action, color and width, its toggle through reads and commits, the note on hunks too large to compare, and Enter and a click on the panel. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…and drop a check that never fails Mutations showed no test of a hunk whose last line, in context, is left removed or added once compared without whitespace. pierre puts the note after that line, and two tests now check it does here. The check that a hunk has lines before its note can never fail, since a hunk with no lines has no note. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Once a hunk spends the last of `MOST_STEPS`, every larger hunk after it fails on its first step, so `hide` no longer strips, hashes and lays out their lines first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in after a theme change Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hitespace row Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e recipe Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and the fixes and recipes under it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the Code recipe Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changes to whitespace start hidden, so the recipe checks reader.rs at +5 -3 with its reindented and repeated lines unchanged, shows them with the row and checks that nothing is read, then runs the rest with them shown. #70's Code starts hidden again. TB counts the second toolbar row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…count at the highest line number Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n the boundary unfold test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
FAIL for head
Regression sweep: Parent 13 of 13; head 12 of 13 in the full run. The same head Code recipe passed on retry, 1 of 1. The original failure is finding 2 below. The parent sweep reuses the f4d6ccc run in Tests: independent Findings:
Notes: Master 7ae927b recipes were also run against both binaries. Its CLI recipe stops at
Binaries are Evidence: |
The trip that reads no marks has to come back within 15 s of their first read. The whitespace steps sat inside that span, and on a macOS runner on CI the trip came back after 19 s, so t3term read the marks again and the recipe failed at its check on #76, #77 and #79. The trip now comes right after the second slice, as on #73 and #74, and a gotcha keeps later steps out of the span. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n while the file's text is read and brings #68's fix that lays review threads out again when the theme changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removing the early stop left every test passing, as the hunks after it fail on their first step and show as the patch has them either way. A count of the hunks read, kept only in tests, now tells them apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ents out again when the theme changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
PASS+NOTES for head
The round 1 findings are both closed. Regression sweep: 13 of 13 own-checkout recipes pass on each side. Base evidence Rules: doctor and check pass in the focused drives and before and after stop in the sweeps. Matched steps send the same CI: all four checks pass on this exact head, including macOS and E2E smoke. Greptile: 1 thread, resolved and answered; no new unanswered finding. The head updates Binary provenance: base Notes: master's current sweep is 11 of 13 on both sides, at No new blocking findings. Evidence stays under the paths above. All owned runs were stopped and checked; no branch or PR code was changed. |
Hides changes to whitespace on the Code tab at first, as the desktop does, and adds a row above the fold row that shows them or hides them again.
¶ Show whitespace changessits above⇊ Expand all filesonce the tab has files. Enter or a click shows the patch's own lines in every file, those read later too, and the row then reads¶ Hide whitespace changes. A read again and another diff picked from the commits keep the choice. The status line saysEnter show whitespace changesorEnter hide whitespace changes.hideWhitespaceChangesand the line diff it runs: jsdiff 9.0.0's Myers diff, with jsdiff's choice between paths of the same length, so the same lines pair. JavaScript's\sdecides what counts as whitespace, so U+FEFF is whitespace and U+0085 isn't.N hunks too large to compare show their whitespace changes.says so under the count.Stacked on #74.
Both come from the fixture server at 120x48. #7's invented diff now has two lines changed only in whitespace: a
Ok(config)indented with a tab before and spaces after, andSelf {version: 3}formatted asSelf { version: 3 }. Hidden, jsdiff also pairslet config, which the fixture's patch lists as removed and added again with the same text.Decision log
What I noticed. docs/pull-request-panel.md listed the desktop's whitespace toggle among what the Code tab lacked. The desktop hides whitespace changes by default, so a reader moving from it to t3term saw a reformatted file's every line as changed where the desktop showed only the real edits.
How I confirmed it. In the pinned T3 source (f570bd2):
diffIgnoreWhitespacedefaults to true (packages/contracts/src/settings.ts:377). The Code tab'signoreWhitespacestarts from it and isn't reset with the diff picked (apps/web/src/components/pullRequest/PullRequestCodeTab.tsx).Show whitespace changeswhile they're hidden andHide whitespace changeswhile they show (PullRequestCodeTab.tsx:1211-1234). The parse cache's key holds the toggle, so each slice is parsed again when it flips (384-402).hideWhitespaceChanges(apps/web/src/lib/diffRendering.ts:87-138) takes each hunk's old lines (context and removed) and new lines (context and added), takes every\sout of each, and runsparseDiffFromFilewithcontext: Infinity. That calls jsdiff 9.0.0'sstructuredPatch, then @pierre/diffs 1.5.2'sprocessFile.\r, characters JavaScript doesn't call whitespace, and\ No newline at end of fileon either side or both. The port matched every one of 101,104 hunks. jsdiff.json keeps 59 patches (261 hunks), which tests.rs checks on every run.Options.
similar, which is a new dependency and pairs lines differently where several paths have the same length. Since the desktop renders jsdiff's path, a different path would show different lines as changed.\ No newline at end of filenote where the desktop marks a row. pierre draws the mark only on the last run of a hunk, and t3term follows that rather than keeping the patch's note where the line moved.What review changed.
A test of two slices showed the shared budget failing every hunk after a large one, small ones included. The hunks are now compared smallest first, and a test checks that a 2-line hunk after two of 1,500 lines is compared.
Mutation testing changed whitespace.rs and code.rs in 59 ways, and the tests caught 47 at first. Four of the rest moved the
\ No newline at end of filenote when a hunk's last line, in context, is left removed or added once whitespace is ignored. Two tests now check where it goes, matched in Node against where pierre puts it, and catch all four. A fifth was a check that a hunk has lines before its note, which can't fail, so the check is gone.Of the other seven, one puts the new side's note before the old side's, and the two notes read the same. Four widen or loosen jsdiff's bounds on the paths it tries: 3,000,000 random hunks of a few letters found no difference from the port, so the bounds stay as jsdiff has them. Two take a file's path or place from the patch's files rather than those shown, and the two lists share both.
Greptile pointed out that once the budget ran out, every larger hunk was still stripped and hashed before
comparefailed on its first step.hidenow stops there. The rows are the same, and a slice of 26 hunks past the budget (about 200,000 lines) takes 21 ms inhiderather than 29 ms in a release build.15bb2da and 3036809 merge #74 at f7866d8 and f4d6ccc, which bring #66's fix for a hunk that removes nothing at the highest line number (8073497) and its test, with the same patch.
The appearance test that #66 added pressed Down once to reach a file, and the whitespace row puts another stop above it. 96bf5df presses Down until the status line says
Enter expand file, and 9f252f2 allows up to 10 presses for the rows the next layers add.CI's E2E smoke then failed on #76, #77 and #79 at the Code recipe's check that a trip to the Timeline reads no marks. On a macOS runner the trip came back 19 s after the marks' first read, past the 15 s in which t3term reads nothing, because this layer's whitespace steps sat in between. d9fd767 moves the trip before them, as on #73 and #74, and adds a gotcha that keeps later steps out of that span.
Sol's round 1 verdict on 3036809 found two gaps. Removing
hide's early stop left every test passing, since the hunks after it fail on their first step and show as the patch has them either way. 7d8ecf8 counts the hunksrebuiltreads, in tests only, andno_hunk_is_read_once_the_steps_run_outexpects three of four read. Without the stop it reads all four. Sol's sweep also failed the Code recipe at the Timeline trip after the whitespace steps, the span d9fd767 moves.507c71d and 49e292e merge #74 at ed13d8b and ce3e374, which bring #72's fix that counts each Enter on a run while the file's text is read and the fixes that lay a thread's comments and its loaded pages out again when the theme changes (#68's ad1590c and #69's 942dad5).
Known limits.
diffIgnoreWhitespacesetting isn't read, so whitespace always starts hidden, and the row's choice isn't saved.Tests
comparetaking jsdiff's path with its step count on 9 cases and the budget's edge.Enter show whitespace changeswith the row chosen.¶ Show whitespace changesrow. d9fd767 changes only the recipe, which passes with it on 3036809's build.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issue was found.Summary
Adds a Code tab row that shows or hides whitespace changes. Whitespace starts hidden, and the choice stays through refreshes and commit changes.
Reviews (7) · Last reviewed commit: "Merge the fold-all branch at ce3e374, wh..." · Reviewed by Greptile