Use neutral labels for nonzero exits in compact TUI output (#54433)

## What changed

- Show `Exited (status N)` instead of `Failed (exit N)` for compact command output, and remove the red bullet styling.
- Label compact exploration counts as `nonzero exit` or `nonzero exits` instead of `failed`, and remove the red styling from the count.

## Testing

Update snapshots for compact command output and exploration summaries to reflect the new labels and styling.

GitOrigin-RevId: 043593720cc3837ca530d1c008565695abcd5af1
This commit is contained in:
Benjamin Carlsson
2026-10-15 22:31:50 +00:00
committed by copyberry
parent 1c5ca2a979
commit 98fd26206d
4 changed files with 16 additions and 11 deletions
@@ -3,7 +3,7 @@ source: tui/src/chatwidget/tests/exec_flow.rs
assertion_line: 175
expression: "chat.transcript.active_cell.as_ref().unwrap().compact_hyperlink_lines(24).iter().map(|line|\nline.line.to_string()).collect::<Vec<_>>().join(\"\\n\")"
---
• Explored · 4 failed
• Explored · 4 nonzero …
└ Read first.txt
Read missing.txt (e…
1)
+5 -5
View File
@@ -77,9 +77,9 @@ impl ExecCell {
{
return Vec::new();
}
let failed = call.output.as_ref().filter(|output| output.exit_code != 0);
let marker = if failed.is_some() {
"•".red().bold()
let nonzero_exit = call.output.as_ref().filter(|output| output.exit_code != 0);
let marker = if nonzero_exit.is_some() {
"•".bold()
} else if self.is_active() {
activity_indicator(
call.start_time,
@@ -90,8 +90,8 @@ impl ExecCell {
} else {
"•".green().bold()
};
let title = if let Some(output) = failed {
format!("Failed (exit {})", output.exit_code)
let title = if let Some(output) = nonzero_exit {
format!("Exited (status {})", output.exit_code)
} else if self.is_active() {
"Running".to_owned()
} else if call.is_unified_exec_interaction() {
+8 -3
View File
@@ -241,7 +241,7 @@ impl HistoryCell for ExecCell {
if self.is_exploring_cell() {
let mut lines = self.exploring_display_lines(width);
lines.truncate(1 + crate::history_cell::activity_preview::DETAIL_PREVIEW_LINES);
let failures = self
let nonzero_exits = self
.group
.calls
.iter()
@@ -251,12 +251,17 @@ impl HistoryCell for ExecCell {
.is_some_and(|output| output.exit_code != 0)
})
.count();
if failures > 0
if nonzero_exits > 0
&& let Some(header) = lines.first_mut()
{
let exit_label = if nonzero_exits == 1 {
"nonzero exit"
} else {
"nonzero exits"
};
header
.line
.push_span(format!(" · {failures} failed").red().bold());
.push_span(format!(" · {nonzero_exits} {exit_label}").bold());
}
lines
.into_iter()
@@ -26,9 +26,9 @@ expression: "(preview, compact, transcript)"
],
[
Line::from_iter([
Span::from("•").red().bold(),
Span::from("•").bold(),
Span::from(" "),
Span::from("Failed (exit 1)").bold(),
Span::from("Exited (status 1)").bold(),
Span::from(" "),
Span::from("echo").fg(Color::Rgb(137, 180, 250)),
Span::from(" output").fg(Color::Rgb(205, 214, 244)),