From 19f5c7aa6ca4cb15e640b40333309c5abebe1a37 Mon Sep 17 00:00:00 2001 From: Hunter B Date: Fri, 5 Jun 2026 10:23:06 -0700 Subject: [PATCH] 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. --- crates/tui/src/tui/sidebar.rs | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/crates/tui/src/tui/sidebar.rs b/crates/tui/src/tui/sidebar.rs index 09617081..680b8ad3 100644 --- a/crates/tui/src/tui/sidebar.rs +++ b/crates/tui/src/tui/sidebar.rs @@ -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]