From 944ec6e2143d6e5c46f32965de2e4f92a10dd377 Mon Sep 17 00:00:00 2001 From: JoseVelazcoH Date: Mon, 6 Jul 2026 10:10:31 -0600 Subject: [PATCH] fix(tui): show full command in preview instead of truncating The preview pane truncated the command to a single line with an ellipsis; let the existing paragraph wrap render it in full across lines. --- src/tui/render.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/tui/render.rs b/src/tui/render.rs index 17da4b0..92038f9 100644 --- a/src/tui/render.rs +++ b/src/tui/render.rs @@ -251,7 +251,7 @@ fn render_preview(frame: &mut Frame, area: ratatui::layout::Rect, app: &App, now let lines = vec![ Line::from(vec![Span::styled( - truncate(&display_command(&row.command), inner.width as usize), + display_command(&row.command), cmd_style, )]), Line::from(vec![ @@ -1108,6 +1108,25 @@ mod tests { app } + #[test] + fn preview_shows_full_long_command_wrapped() { + // A command longer than the preview pane width must appear in full, + // wrapped across lines, not truncated with an ellipsis. + let long_cmd = "git fetch origin main && git checkout 76-feat-hooks-make-the-finder-keybinding-configurable"; + let mut app = App::new(); + app.all_rows = vec![make_row(long_cmd, TEST_NOW - 60, 0, "Thoth")]; + app.recompute(); + app.selected = 0; + + let text = render_app(&app); + // The tail of the command (which used to be cut off with an ellipsis) + // must now be visible, wrapped onto later lines. + assert!( + text.contains("keybinding-configurable"), + "preview must show the full command, got:\n{text}" + ); + } + #[test] fn tab_bar_shows_both_labels() { let app = app_with_rows();