Repository navigation
feat(review): layout switch, diff settings menu and a draggable split line - #194
Merged
Merged
Conversation
… line The header shows Split | Unified (the layout in force lit) and a Wrap switch; a click does what u and w do. ',' or the header's Settings button opens a menu of every diff setting the viewer supports: layout, split ratio, wrap, line numbers, colours and background. Each change applies at once and is written to [review] in the config file, only the keys that changed, so the next review opens the same way. In a split diff the line between the sides can be dragged, moved with ( and ), and evened with a double click; it lights under the pointer. A narrow header gives way in steps and keeps the switch. Uses diffs-rs feat/split-ratio through [patch.crates-io] until it is released.
… review is not built
… screen never scrolls
…config file Choices made in the review (the menu, u, w, the header switches, ( and ), a drag of the middle line) now go to review-settings.toml in the data folder, over [review] in the config file, which is read but never written. Only the keys a review changed are written, onto the file as it is, through a synced temporary file and a rename, so two reviews and a hand edit keep each other's choices. A state file with bad keys is read leniently and named once; a failed write is said once and the setting holds for the session. The menu gains Reset to defaults. The header keeps Review before Settings and Wrap. ( and ) step by clean twentieths, and a drag is remembered to two decimals. The theme integration test no longer reads the caller's config.
# Conflicts: # crates/plannotator-tui/src/review/draw.rs # crates/plannotator-tui/src/review/mod.rs
…ft keeps the settings still
… notes never flips the diff
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.
What
Split Unifiedwith the layout in force lit, and aWrapswitch.uorwdoes; both keys still work.ui/chips.rs, with two new rows in its contrast table, dark and light.,or the header'sSettingsbutton opens it.↑↓pick a row,←→change it,enter/spacemove it on (and even the ratio), a click on a row does the same,esc/,/click outside close it.(/).[review]in config.toml (optional, read only, strictly validated) < choices remembered in<data>/clients/plannotator-tui/review-settings.toml.u,w, the header switches,(/), and a drag (on release, to two decimals).diffs-rs
Uses the new split ratio API from plannotator/diffs-rs#17 through a
[patch.crates-io]git entry on its branch. No version bump. The patch is to be dropped once diffs-rs is released.Tests
review/tests/settings_flow.rs:[review];review/tests/split_drag.rs:(/);config/review.rs: compat table, roundtrip, errors.review/settings/state.rs: lenient reading, merge-on-write, Reset, atomic write and failure.review/header.rs: arrangement at every width.keys/tests.rs: older configs that bound,,(,).cargo fmt,cargo clippy --all-targets -- -D warningsandcargo test --workspacepass.ui::drag::on_screenfilter as every other mouse report.the_line_dragged_past_the_diffs_edges_or_off_the_screen_never_scrollspins both.