fix: add ellipsis for truncated status indicator (#12540)

#### What

- Add ellipsis truncation of the status indicator, similar to equivalent
truncation done in the footer.
- Extract truncation helpers into separate file



https://github.com/user-attachments/assets/a2d5f22f-8adc-456e-8059-97359194c25c


#### Tests
Updated relevant snapshot tests
This commit is contained in:
sayan-oai
2026-02-23 11:45:46 -08:00
committed by GitHub
parent 7f75e74201
commit bfe622f495
10 changed files with 113 additions and 98 deletions

View File

@@ -23,6 +23,7 @@ use crate::app_event::AppEvent;
use crate::app_event_sender::AppEventSender;
use crate::exec_cell::spinner;
use crate::key_hint;
use crate::line_truncation::truncate_line_with_ellipsis_if_overflow;
use crate::render::renderable::Renderable;
use crate::shimmer::shimmer_spans;
use crate::text_formatting::capitalize_first;
@@ -253,7 +254,10 @@ impl Renderable for StatusIndicatorWidget {
}
let mut lines = Vec::new();
lines.push(Line::from(spans));
lines.push(truncate_line_with_ellipsis_if_overflow(
Line::from(spans),
usize::from(area.width),
));
if area.height > 1 {
// If there is enough space, add the details lines below the header.
let details = self.wrapped_details_lines(area.width);