From 11c448d66ecc1fc771848329dabb9e049dda75bb Mon Sep 17 00:00:00 2001 From: Implementist <24910011+Implementist@users.noreply.github.com> Date: Wed, 3 Jun 2026 22:13:49 +0800 Subject: [PATCH] fix(plan_prompt): remove step truncation to allow content overflow into scroll region --- crates/tui/src/tui/plan_prompt.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/crates/tui/src/tui/plan_prompt.rs b/crates/tui/src/tui/plan_prompt.rs index 916555ad..217bd0f3 100644 --- a/crates/tui/src/tui/plan_prompt.rs +++ b/crates/tui/src/tui/plan_prompt.rs @@ -349,9 +349,8 @@ impl ModalView for PlanPromptView { crate::tools::plan::StepStatus::InProgress => "\u{25b6}", crate::tools::plan::StepStatus::Completed => "\u{2713}", }; - let step_text = truncate_step(&item.step, 60); lines.push(Line::from(Span::styled( - format!(" {status_mark} {}. {}", i + 1, step_text), + format!(" {status_mark} {}. {}", i + 1, &item.step), Style::default().fg(palette::TEXT_PRIMARY), ))); } @@ -466,22 +465,6 @@ impl ModalView for PlanPromptView { } } -/// Truncate a plan step description to `max_len` chars, breaking at a word -/// boundary and appending an ellipsis when truncation occurs. -fn truncate_step(text: &str, max_len: usize) -> String { - if text.chars().count() <= max_len { - return text.to_string(); - } - // Walk back from the cutoff to find a natural word boundary. - let cutoff = max_len.saturating_sub(3); // reserve room for "..." - let truncated: String = text.chars().take(cutoff).collect(); - if let Some(last_space) = truncated.rfind(' ') { - format!("{}...", &truncated[..last_space]) - } else { - format!("{truncated}...") - } -} - /// Wrap text into lines no wider than `width` characters. fn wrap_text(text: &str, width: usize) -> Vec { if width == 0 {