mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
tui: use middle-dot ellipsis (···) and enforce one space after left border in run output previews
This commit is contained in:
@@ -1123,6 +1123,13 @@ fn build_preview_lines(text: &str, include_left_pipe: bool) -> Vec<Line<'static>
|
|||||||
.add_modifier(Modifier::DIM)
|
.add_modifier(Modifier::DIM)
|
||||||
.fg(crate::colors::text_dim()),
|
.fg(crate::colors::text_dim()),
|
||||||
),
|
),
|
||||||
|
// Ensure a single space between the border and content
|
||||||
|
Span::styled(
|
||||||
|
" ",
|
||||||
|
Style::default()
|
||||||
|
.add_modifier(Modifier::DIM)
|
||||||
|
.fg(crate::colors::text_dim()),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
let escaped = ansi_escape_line(line);
|
let escaped = ansi_escape_line(line);
|
||||||
spans.extend(escaped.spans);
|
spans.extend(escaped.spans);
|
||||||
@@ -1131,7 +1138,29 @@ fn build_preview_lines(text: &str, include_left_pipe: bool) -> Vec<Line<'static>
|
|||||||
out.push(ansi_escape_line(line));
|
out.push(ansi_escape_line(line));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Seg::Ellipsis => out.push(Line::from("…".dim())),
|
Seg::Ellipsis => {
|
||||||
|
if include_left_pipe {
|
||||||
|
out.push(Line::from(vec![
|
||||||
|
Span::styled(
|
||||||
|
"│",
|
||||||
|
Style::default()
|
||||||
|
.add_modifier(Modifier::DIM)
|
||||||
|
.fg(crate::colors::text_dim()),
|
||||||
|
),
|
||||||
|
// Maintain one space padding inside the border
|
||||||
|
Span::styled(
|
||||||
|
" ",
|
||||||
|
Style::default()
|
||||||
|
.add_modifier(Modifier::DIM)
|
||||||
|
.fg(crate::colors::text_dim()),
|
||||||
|
),
|
||||||
|
// Use centered middle-dots for truncation marker
|
||||||
|
Span::from("···").dim(),
|
||||||
|
]));
|
||||||
|
} else {
|
||||||
|
out.push(Line::from("···".dim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out
|
out
|
||||||
|
|||||||
Reference in New Issue
Block a user