Skip to content

feat(review): tick viewed files in the file list; draw the review on the terminal background - #186

Merged
backnotprop merged 3 commits into
mainfrom
feat/viewed-ticks
Nov 23, 2026
Merged

backnotprop merged 3 commits into
mainfrom
feat/viewed-ticks

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

The diff viewer's file list ticks viewed files (✓ after the counts) and dims their rows. A folder gets the tick once every file in it is viewed, also when it is collapsed. The code review also draws on the terminal's own background, as the document screen does. Only changed lines, hunk headings and the empty side of a split row keep a tint, taken from the light or dark palette.

Both use diffs-rs 0.2.1 (Engine::set_file_marks, Engine::set_terminal_background), now taken from crates.io. The temporary [patch.crates-io] git pointer is gone.

  • The marks are synced on open, on every x (the whole-file view's too), when the viewer's files arrive and on r. ctrl+n only moves the cursor. A change on disk shows in the footer and leaves the ticks as they are until r. After r, a file that changed since it was viewed loses its tick, as the progress records say.
  • A PR review's marks stay in this app's own folder (clients/plannotator-tui/review-progress) and tick the list the same way.
  • The whole-file view (o/O) opens a second engine, which now also draws on the terminal background. No other Engine::open call sites exist: go to definition shows its results in the whole-file view.
  • The ticks stay with the rail hidden (z) and the side-by-side layout that follows.

Tests: look.rs covers the terminal background in the diff and in the whole-file view, and light versus dark tints. viewed_flow.rs covers the ticks through x, ctrl+n, the rail hidden and shown, a change on disk and a reload. whole_flow.rs covers x in the whole-file view. pull_flow.rs covers a PR's ticks, read back on reopen.

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`.
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.
…inal 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.
@backnotprop
backnotprop added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit d9ca560 Nov 23, 2026
3 checks passed
@backnotprop
backnotprop deleted the feat/viewed-ticks branch November 23, 2026 00:10
@backnotprop backnotprop mentioned this pull request Nov 23, 2026
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