refactor(cli): adopt flex-width rendering, remove data-layer truncation

Replace hardcoded truncation widths across CLI commands with
render::flex_width() calls that adapt to terminal size. Remove
server-side truncate_to_chars() in timeline collect/seed stages so
full text is preserved through the pipeline — truncation now happens
only at the presentation layer where terminal width is known.

Affected commands: explain, file-history, list (issues/mrs/notes),
me, timeline, who (active/expert/workload).
This commit is contained in:
teernisse
2026-03-13 11:01:17 -04:00
parent ef8a316372
commit 6d85474052
15 changed files with 59 additions and 66 deletions

View File

@@ -217,7 +217,7 @@ pub(super) fn print_workload_human(r: &WorkloadResult) {
println!(
" {} {} {}",
Theme::info().render(&item.ref_),
render::truncate(&item.title, 40),
render::truncate(&item.title, render::flex_width(25, 20)),
Theme::dim().render(&render::format_relative_time(item.updated_at)),
);
}
@@ -239,7 +239,7 @@ pub(super) fn print_workload_human(r: &WorkloadResult) {
println!(
" {} {}{} {}",
Theme::info().render(&mr.ref_),
render::truncate(&mr.title, 35),
render::truncate(&mr.title, render::flex_width(33, 20)),
Theme::dim().render(draft),
Theme::dim().render(&render::format_relative_time(mr.updated_at)),
);
@@ -266,7 +266,7 @@ pub(super) fn print_workload_human(r: &WorkloadResult) {
println!(
" {} {}{} {}",
Theme::info().render(&mr.ref_),
render::truncate(&mr.title, 30),
render::truncate(&mr.title, render::flex_width(40, 20)),
Theme::dim().render(&author),
Theme::dim().render(&render::format_relative_time(mr.updated_at)),
);
@@ -292,7 +292,7 @@ pub(super) fn print_workload_human(r: &WorkloadResult) {
" {} {} {} {}",
Theme::dim().render(&disc.entity_type),
Theme::info().render(&disc.ref_),
render::truncate(&disc.entity_title, 35),
render::truncate(&disc.entity_title, render::flex_width(30, 20)),
Theme::dim().render(&render::format_relative_time(disc.last_note_at)),
);
}