tui: fix scroll by using Paragraph::line_count()
Replace homegrown wrapping math (wrapped_height, wrapped_height_line, auto_scroll, force_scroll, wrapped_line_count) with ratatui's own Paragraph::line_count() which exactly matches its rendering. The old approach used ceiling division that didn't account for word wrapping, causing bottom content to be clipped. Also add terminal.clear() on resize to force full redraw — fixes the TUI rendering at old canvas size after terminal resize. Requires the unstable-rendered-line-info feature flag on ratatui. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6d22f70192
commit
f45f663dc0
3 changed files with 30 additions and 65 deletions
|
|
@ -17,7 +17,7 @@ reqwest = { version = "0.12", features = ["json"] }
|
|||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
ratatui = "0.30"
|
||||
ratatui = { version = "0.30", features = ["unstable-rendered-line-info"] }
|
||||
crossterm = { version = "0.29", features = ["event-stream"] }
|
||||
walkdir = "2"
|
||||
glob = "0.3"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue