Repository navigation
feat(review): tick viewed files in the file list; draw the review on the terminal background - #186
Merged
Merged
Conversation
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.
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.
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.x(the whole-file view's too), when the viewer's files arrive and onr.ctrl+nonly moves the cursor. A change on disk shows in the footer and leaves the ticks as they are untilr. Afterr, a file that changed since it was viewed loses its tick, as the progress records say.clients/plannotator-tui/review-progress) and tick the list the same way.o/O) opens a second engine, which now also draws on the terminal background. No otherEngine::opencall sites exist: go to definition shows its results in the whole-file view.z) and the side-by-side layout that follows.Tests:
look.rscovers the terminal background in the diff and in the whole-file view, and light versus dark tints.viewed_flow.rscovers the ticks throughx,ctrl+n, the rail hidden and shown, a change on disk and a reload.whole_flow.rscoversxin the whole-file view.pull_flow.rscovers a PR's ticks, read back on reopen.