Skip to content

feat: wrap long text and add scroll in the TUI's content screens - #43

Merged
Etoile-Bleu merged 1 commit into
mainfrom
tui-wrap-long-text
Jul 16, 2026
Merged

feat: wrap long text and add scroll in the TUI's content screens#43
Etoile-Bleu merged 1 commit into
mainfrom
tui-wrap-long-text

Conversation

@Etoile-Bleu

Copy link
Copy Markdown
Owner

Summary

  • 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 Wrap { trim: false } on every Paragraph that renders variable-length text: results, drug info, and the shared message screen used for errors/no-match.
  • Add Up/Down (one line) and PageUp/PageDown (PAGE_SCROLL_LINES = 10) scrolling for content taller than the terminal, on any of those content screens.
  • Scroll resets to zero whenever the screen changes (App::set_screen), so a long result never leaves the next screen scrolled past its own content.

Test plan

  • cargo build --release -p mensung-client
  • cargo test -p mensung-client (43 passed, including 4 new scroll tests)
  • cargo clippy -p mensung-client --release -- -D warnings (clean)
  • cargo fmt --check
  • Verified interactively in a narrow tmux pane: long boxed-warning text now wraps instead of running off the box, and Up/Down/PageUp/PageDown scroll through it correctly in both directions

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.
@Etoile-Bleu
Etoile-Bleu merged commit 6366c1e into main Jul 16, 2026
6 checks passed
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