Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/tui/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![
Expand Down Expand Up @@ -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();
Expand Down