From d0f89b9ae8c76e00427df94efea4ed1c7ecfa281 Mon Sep 17 00:00:00 2001 From: donglovejava <211940267+donglovejava@users.noreply.github.com> Date: Mon, 25 May 2026 11:22:06 +0800 Subject: [PATCH] fix(sidebar): auto-collapse completed sub-agents --- crates/tui/src/tui/sidebar.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/tui/src/tui/sidebar.rs b/crates/tui/src/tui/sidebar.rs index bff5c51a0..821ed8b6c 100644 --- a/crates/tui/src/tui/sidebar.rs +++ b/crates/tui/src/tui/sidebar.rs @@ -1595,6 +1595,7 @@ pub fn subagent_panel_lines( if lines.len() >= max_rows { break; } + let is_completed = !matches!(row.status.as_str(), "running"); let (marker, color) = agent_status_marker(row.status.as_str()); let label = format!("{marker} {} {}", row.role, row.name); lines.push(Line::from(Span::styled( @@ -1602,6 +1603,10 @@ pub fn subagent_panel_lines( Style::default().fg(color), ))); + if is_completed { + continue; + } + if lines.len() >= max_rows { break; }