feat: wrap long text and add scroll in the TUI's content screens - #43
Merged
Conversation
Long interaction descriptions and drug facts (e.g. Warfarin's boxed warning) previously ran off the right edge of the bordered box instead of wrapping. Enable word wrapping on every Paragraph that renders variable-length text (results, drug info, and the shared message screen used for errors and no-match), and add Up/Down/PageUp/PageDown scrolling so content taller than the terminal is still reachable.
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.
Summary
Wrap { trim: false }on everyParagraphthat renders variable-length text: results, drug info, and the shared message screen used for errors/no-match.PAGE_SCROLL_LINES = 10) scrolling for content taller than the terminal, on any of those content screens.App::set_screen), so a long result never leaves the next screen scrolled past its own content.Test plan
cargo build --release -p mensung-clientcargo test -p mensung-client(43 passed, including 4 new scroll tests)cargo clippy -p mensung-client --release -- -D warnings(clean)cargo fmt --check