aboutsummaryrefslogtreecommitdiff
path: root/src/ui/sidebar.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-18 04:24:24 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-19 14:27:41 +0300
commitb04c4ca3dab872b3e9dfe05f1af767e5b6af1127 (patch)
tree4ada71a7ae58c2a5862b81c1f6d2db9a56f42cf4 /src/ui/sidebar.rs
parentd616bcd6b86742762fec5f0696a5c13701fe717c (diff)
fix: show agent names in sidebar
refs #145
Diffstat (limited to 'src/ui/sidebar.rs')
-rw-r--r--src/ui/sidebar.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ui/sidebar.rs b/src/ui/sidebar.rs
index 3d51cc51..116010d1 100644
--- a/src/ui/sidebar.rs
+++ b/src/ui/sidebar.rs
@@ -938,6 +938,34 @@ mod tests {
}
#[test]
+ fn all_workspaces_agent_panel_entries_prefer_agent_names_for_agent_identity() {
+ let mut app = crate::app::state::AppState::test_new();
+ let workspace = Workspace::test_new("bridge");
+ let first_pane = workspace.tabs[0].root_pane;
+
+ app.workspaces = vec![workspace];
+ app.ensure_test_terminals();
+ let first_terminal_id = app.workspaces[0].tabs[0].panes[&first_pane]
+ .attached_terminal_id
+ .clone();
+ app.terminals
+ .get_mut(&first_terminal_id)
+ .unwrap()
+ .detected_agent = Some(Agent::Pi);
+ app.terminals
+ .get_mut(&first_terminal_id)
+ .unwrap()
+ .set_agent_name("planner".into());
+ app.active = Some(0);
+ app.selected = 0;
+ app.agent_panel_scope = AgentPanelScope::AllWorkspaces;
+
+ let entries = agent_panel_entries(&app);
+ assert_eq!(entries[0].primary_label, "bridge");
+ assert_eq!(entries[0].agent_label.as_deref(), Some("planner"));
+ }
+
+ #[test]
fn all_workspaces_primary_label_truncates_workspace_and_tab() {
let entry = AgentPanelEntry {
ws_idx: 0,