Repository navigation
feat(review): whole-file view (o / O) - #172
Merged
Merged
Conversation
backnotprop
force-pushed
the
feat/review-whole-file
branch
from
November 20, 2026 01:25
ad3b6ad to
980e2bd
Compare
o opens the file under the cursor as it is now at the same line; O opens the base version at the matching old line. Line numbers, syntax colors, and a bar on the changed lines. o, O or Esc go back to the diff at the same place; n/N move between files and the notes rail stays. A note on a line inside a hunk is an ordinary diff note. A note outside every hunk is a new-side note with outsideDiff and anchorText, as in the browser; it lists under "Not in the diff", Enter opens it in the whole file, and the resolver no longer marks it outdated for being outside the hunks. The base version is read-only for notes. Files over 5 MiB, binary, added and deleted files show a message instead. x marks the shown file viewed.
…ounts diffs-rs labels the made-up patch "Modified +0 −0"; the view now writes the file's status and counts in the diff over it (or "Not in the diff").
backnotprop
force-pushed
the
feat/review-whole-file
branch
from
November 20, 2026 02:53
980e2bd to
091c5c6
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 20, 2026
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Nov 23, 2026
…the terminal background (#186) * feat(review): tick viewed files in the file list The diff viewer's file list now shows a tick after a viewed file's counts and dims its row; a folder gets the tick once every file in it is viewed, also when collapsed. It uses diffs-rs `Engine::set_file_marks`, synced on open, on every toggle, when files arrive and on reload. Not mergeable yet: `set_file_marks` is not in a diffs-rs release. The root Cargo.toml patches diffs-rs to a commit of plannotator/diffs-rs feat/file-badges. Once diffs-rs 0.2.1 is published: delete the [patch.crates-io] section, require diffs-rs = "0.2.1" in crates/plannotator-tui/Cargo.toml, and run `cargo update -p diffs-rs`. * feat(review): draw the code review on the terminal's own background The diff viewer now leaves empty rows, plain context lines and its file list to the terminal's background and plain text to its foreground, as the document screen does. Changed lines and hunk headings keep tints from the light or dark palette that the theme setting picks. Uses diffs-rs `Engine::set_terminal_background`. Not mergeable yet: needs plannotator/diffs-rs#13 and a diffs-rs release. The root Cargo.toml patches diffs-rs to that PR's commit; once 0.2.1 is published, delete the [patch.crates-io] section, require diffs-rs = "0.2.1", and run `cargo update -p diffs-rs`. If the whole-file view (#172) lands first, its second engine needs the same call. * build: diffs-rs 0.2.1 from crates.io; the whole-file view on the terminal background too The [patch.crates-io] pointer to a diffs-rs commit is gone: 0.2.1 has Engine::set_file_marks and Engine::set_terminal_background. The whole-file view (o, O) opens a second engine; it now draws on the terminal's background as the diff does. Tests cover that, the light palette, and the file list's ticks through x in the whole-file view, ctrl+n, the rail hidden and shown, a change on disk, a reload that drops a changed file's mark, and a PR review's own marks.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a whole-file view to the code review screen.
oopens the file under the cursor as it is now, at the same line.Oopens the base version at the matching old line (the line is mapped through the hunks; a replaced line maps to the line it replaced).Whole file · new · <path>orWhole file · base (abc1234) · <path>.o,Oor Esc go back to the diff at the same place.n/Nmove between files,]/[move between changed runs, and the notes rail stays.con a line inside a hunk makes an ordinary diff note. Outside every hunk it makes a new-side note withoutsideDiff: trueandanchorText, like the browser. Such notes list under "Not in the diff" in the rail, and Enter opens the whole file at their line. They export with the browser's(not in the diff)heading and a**Code:**block (checked byte for byte against the browser'sexportReviewFeedback).Keys:
whole-file=o,whole-base=O, in the diff context only (okeeps opening the editor elsewhere). Both are in the "late" list, so an older config that already usesoorOin the diff keeps its binding. README and the help screen are updated.How it works: the whole-file view is a second diffs-rs engine given a synthetic patch with one context-only hunk that covers the file. This needed no change to diffs-rs.
Limits from the engine, and what this PR does about them:
Options::line_numbers: bool(all numbers on or off). The unified gutter always prints both numbers:render.rsdraw_rowbuildsnumber(old) + " " + number(new), andcode_widthreservesdigits * 2 + 1 + 3columns. Removing the duplicate needs a diffs-rs switch read in both places, for example anOptionsfield (unified_numbers: Both | New | Old) or a per-file setting next to the file badges. A way to set the file heading's summary text from the host would also replace the overwrite above.Tests: patch line mapping,
read_wholelimits, export, resolver, keymap, and screen tests inreview/tests/whole_flow.rsplus a PR cache-repository test inpull_flow.rs.Rebased onto main after #168 and #170.
xin the whole-file view marks the shown file viewed (#171).