Skip to content

feat(tui): /diff v2 — search, review marks, split view, staging - #425

Merged
mohitranka merged 1 commit into
mainfrom
feat/diff-view-v2-onto-main
Aug 22, 2026
Merged

mohitranka merged 1 commit into
mainfrom
feat/diff-view-v2-onto-main

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Re-targets #424 at main. That PR was merged into feat/diff-view 13 seconds after #423 squash-merged that same branch into main, so its commits never reached main — this is the identical commit, cherry-picked onto main. No content changes.

What's new

Key Behaviour
/ Search within the patch
Tab / Shift+Tab Next / previous hit once the prompt is closed
m Mark this file reviewed
v Unified / split layout
s / u Stage / unstage this file

/ search

The prompt takes over the bottom row and owns the keyboard while open — n is a letter there, not a file jump. Enter steps through hits, Esc closes the prompt but keeps the highlights.

Reloading a patch recomputes matches without moving the reader; only typing jumps. Two separate calls on purpose, so a background status refresh can't yank you to a hit.

m mark reviewed

Session-scoped, and marking a file advances to the next unreviewed one — the value of the mark is knowing what's left. A file whose patch content changes silently loses its mark: a tick is a claim about content that no longer exists.

s / u staging

Working-tree source only, and only stage/unstage — both reversible, which is why they run without a confirmation. Discarding work stays unbound even though git_review::discard_hunk exists.

Two redesigns the PTY forced

Split view had to hide the explorer. The patch pane never reaches a readable split width beside it — widening the terminal hands the extra columns to the conversation sidebar, so at 200 columns the pane was still ~62. v now hides the explorer (redundant while reading one patch; the header names the file) and restores it on the way out. SPLIT_MIN_WIDTH is 72, 36 per side.

The header had to shrink. Source, layout and search state had been appended past the ~50 columns the pane actually gets, i.e. invisible. Now:

  • the default source is unnamed; only last turn earns words
  • layout and search live on the bottom row (split right-aligned; the search prompt replaces the hints while open)
  • a long path is elided from the left so the counts and N of M survive — that's the state you can't read anywhere else

Notes

The inline hint row holds five of thirteen bindings, chosen so the verbs still fit at ~50 columns. ? carries the rest and never leaves the row.

Verification

Re-verified after the cherry-pick onto main: cargo fmt --all -- --check clean · cargo clippy --all-targets clean · 55 diff tests pass.

Originally driven in a PTY: search prompt with live 1 of 3 counter and Enter cycling; m advancing with the header showing 1 reviewed; v producing a real side-by-side with the explorer gone and split tagged on the hint row, then restoring both; s staging tests/test_report.py (confirmed with git diff --cached).

https://claude.ai/code/session_018ihDDc3ahfrxu5AYL9moXs

Four additions to the review mode, and two redesigns the PTY forced.

/ searches within the patch. The prompt takes over the bottom row and owns
the keyboard while it is open — `n` is a letter there, not a file jump.
Enter steps through hits, Esc closes the prompt but keeps the highlights,
Tab/Shift+Tab step through them afterwards. Reloading a patch recomputes
matches without moving the reader; only typing jumps.

m marks a file reviewed and advances to the next unreviewed one, because
the value of the mark is knowing what is left. A file whose patch content
changes loses its mark: a tick is a claim about content that no longer
exists.

v switches to split view, old on the left and new on the right, with
removals blanking the right column and additions the left so the two stay
aligned.

s and u stage and unstage the selected file. Working-tree source only, and
only these two — both are reversible, which is why they need no
confirmation. Discarding work stays unbound even though discard_hunk exists.

Split view had to hide the explorer. The patch pane never reaches a
readable split width beside it: widening the terminal hands the extra
columns to the conversation sidebar, so at 200 columns the pane was still
~62. `v` now hides the explorer — redundant while reading one patch, since
the header names the file — and restores it on the way out.
SPLIT_MIN_WIDTH is 72, 36 per side.

The header had to shrink. Appending source, layout and search state pushed
them past the ~50 columns the pane really gets, where they were invisible.
The default source is now unnamed (only "last turn" earns words), layout
and search moved to the bottom row, and a long path is elided from the left
so the counts and "N of M" survive — that is the state you cannot read
anywhere else.

The inline hint row holds five of the thirteen bindings, chosen so the
verbs still fit; `?` carries the rest and never leaves the row.

Claude-Session: https://claude.ai/code/session_018ihDDc3ahfrxu5AYL9moXs
@mohitranka
mohitranka merged commit ab380c8 into main Aug 22, 2026
7 checks passed
mohitranka added a commit that referenced this pull request Sep 11, 2026
Four additions to the review mode, and two redesigns the PTY forced.

/ searches within the patch. The prompt takes over the bottom row and owns
the keyboard while it is open — `n` is a letter there, not a file jump.
Enter steps through hits, Esc closes the prompt but keeps the highlights,
Tab/Shift+Tab step through them afterwards. Reloading a patch recomputes
matches without moving the reader; only typing jumps.

m marks a file reviewed and advances to the next unreviewed one, because
the value of the mark is knowing what is left. A file whose patch content
changes loses its mark: a tick is a claim about content that no longer
exists.

v switches to split view, old on the left and new on the right, with
removals blanking the right column and additions the left so the two stay
aligned.

s and u stage and unstage the selected file. Working-tree source only, and
only these two — both are reversible, which is why they need no
confirmation. Discarding work stays unbound even though discard_hunk exists.

Split view had to hide the explorer. The patch pane never reaches a
readable split width beside it: widening the terminal hands the extra
columns to the conversation sidebar, so at 200 columns the pane was still
~62. `v` now hides the explorer — redundant while reading one patch, since
the header names the file — and restores it on the way out.
SPLIT_MIN_WIDTH is 72, 36 per side.

The header had to shrink. Appending source, layout and search state pushed
them past the ~50 columns the pane really gets, where they were invisible.
The default source is now unnamed (only "last turn" earns words), layout
and search moved to the bottom row, and a long path is elided from the left
so the counts and "N of M" survive — that is the state you cannot read
anywhere else.

The inline hint row holds five of the thirteen bindings, chosen so the
verbs still fit; `?` carries the rest and never leaves the row.

Claude-Session: https://claude.ai/code/session_018ihDDc3ahfrxu5AYL9moXs
mohitranka added a commit that referenced this pull request Sep 11, 2026
Four additions to the review mode, and two redesigns the PTY forced.

/ searches within the patch. The prompt takes over the bottom row and owns
the keyboard while it is open — `n` is a letter there, not a file jump.
Enter steps through hits, Esc closes the prompt but keeps the highlights,
Tab/Shift+Tab step through them afterwards. Reloading a patch recomputes
matches without moving the reader; only typing jumps.

m marks a file reviewed and advances to the next unreviewed one, because
the value of the mark is knowing what is left. A file whose patch content
changes loses its mark: a tick is a claim about content that no longer
exists.

v switches to split view, old on the left and new on the right, with
removals blanking the right column and additions the left so the two stay
aligned.

s and u stage and unstage the selected file. Working-tree source only, and
only these two — both are reversible, which is why they need no
confirmation. Discarding work stays unbound even though discard_hunk exists.

Split view had to hide the explorer. The patch pane never reaches a
readable split width beside it: widening the terminal hands the extra
columns to the conversation sidebar, so at 200 columns the pane was still
~62. `v` now hides the explorer — redundant while reading one patch, since
the header names the file — and restores it on the way out.
SPLIT_MIN_WIDTH is 72, 36 per side.

The header had to shrink. Appending source, layout and search state pushed
them past the ~50 columns the pane really gets, where they were invisible.
The default source is now unnamed (only "last turn" earns words), layout
and search moved to the bottom row, and a long path is elided from the left
so the counts and "N of M" survive — that is the state you cannot read
anywhere else.

The inline hint row holds five of the thirteen bindings, chosen so the
verbs still fit; `?` carries the rest and never leaves the row.

Claude-Session: https://claude.ai/code/session_018ihDDc3ahfrxu5AYL9moXs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant