fix(tui): keep agent progress visible in sidebar

Prioritize running progress detail before branch and duration metadata so narrow sidebars keep the active step visible while still showing branch context at wider widths.
This commit is contained in:
Hunter B
2026-06-05 10:23:06 -07:00
parent e03f2ab225
commit 19f5c7aa6c
+21 -10
View File
@@ -1970,17 +1970,17 @@ pub fn subagent_panel_lines(
if row.steps_taken > 0 {
detail_parts.push(format!("{} step(s)", row.steps_taken));
}
if let Some(progress) = row.progress.as_deref()
&& !progress.trim().is_empty()
{
detail_parts.push(summarize_tool_output(progress));
}
if let Some(branch) = row.git_branch.as_deref() {
detail_parts.push(format!("branch {branch}"));
}
if let Some(duration) = row.duration_ms {
detail_parts.push(format_duration_ms(duration));
}
if let Some(progress) = row.progress.as_deref()
&& !progress.trim().is_empty()
{
detail_parts.push(summarize_tool_output(progress));
}
lines.push(Line::from(Span::styled(
format!(
" {}",
@@ -2066,17 +2066,17 @@ fn subagent_panel_hover_texts(
if row.steps_taken > 0 {
detail_parts.push(format!("{} step(s)", row.steps_taken));
}
if let Some(progress) = row.progress.as_deref()
&& !progress.trim().is_empty()
{
detail_parts.push(summarize_tool_output(progress));
}
if let Some(branch) = row.git_branch.as_deref() {
detail_parts.push(format!("branch {branch}"));
}
if let Some(duration) = row.duration_ms {
detail_parts.push(format_duration_ms(duration));
}
if let Some(progress) = row.progress.as_deref()
&& !progress.trim().is_empty()
{
detail_parts.push(summarize_tool_output(progress));
}
texts.push(format!(" {}", detail_parts.join(" · ")));
}
@@ -3264,6 +3264,17 @@ mod tests {
text.iter().any(|l| l.contains("step 2/3")),
"progress detail missing: {text:?}",
);
let wide_text = lines_to_text(&subagent_panel_lines(
&summary,
&rows,
96,
12,
&palette::UI_THEME,
));
assert!(
wide_text.iter().any(|l| l.contains("branch feature/docs")),
"branch detail missing at wide width: {wide_text:?}",
);
}
#[test]