From a2d2549df47358d567937bfcacb5984eedb953a6 Mon Sep 17 00:00:00 2001 From: Owen Qwen Date: Thu, 25 Jun 2026 18:54:24 -0500 Subject: [PATCH] Fix transcript bottom scroll --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/ui/render.rs | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0793c15..a2427ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -226,7 +226,7 @@ checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" [[package]] name = "cassady" -version = "0.3.0" +version = "0.3.1" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 5a070e1..ff89e2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cassady" -version = "0.3.0" +version = "0.3.1" edition = "2021" description = "Cassady/Cass minimal terminal coding agent" license = "MIT" diff --git a/src/ui/render.rs b/src/ui/render.rs index 52a3bf7..5a351e8 100644 --- a/src/ui/render.rs +++ b/src/ui/render.rs @@ -600,9 +600,6 @@ fn ratatui_wrapped_row_count(line: &str, content_width: usize) -> usize { non_whitespace_previous = !is_whitespace; } - if !pending_line_has_symbols && word_symbols == 0 && whitespace_symbols > 0 { - rows = rows.saturating_add(1); - } if whitespace_symbols > 0 || word_symbols > 0 { pending_line_has_symbols = true; } @@ -993,6 +990,11 @@ mod tests { assert_eq!(max_transcript_scroll(&transcript, false, false, area), 0); } + #[test] + fn whitespace_only_line_counts_as_one_wrapped_row() { + assert_eq!(ratatui_wrapped_row_count(" ", 80), 1); + } + #[test] fn input_height_wraps_long_line() { // A single long line with no newlines should occupy more than 1 row