mirror of
https://github.com/openai/codex.git
synced 2026-05-01 03:42:05 +03:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user