From e6d294643a12f4ac5745e0c3b3315463d84ffc65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Olav=20Torvik?= <50993453+Haakooto@users.noreply.github.com> Date: Tue, 17 Nov 2026 10:45:15 +0100 Subject: [PATCH 1/2] feat(ui): hide quota columns and the AI column for hidden agents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The quota pane drops columns for agents in hidden_agents. The sessions table drops the AI column when every session is a plain Claude CLI session. 🤖 Generated with Claude Code Co-Authored-By: Claude --- src/app.rs | 3 +++ src/ui/quota.rs | 12 ++++++++++-- src/ui/sessions.rs | 38 ++++++++++++++++++++++++++++++++------ 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/src/app.rs b/src/app.rs index e47408b2..51590e86 100644 --- a/src/app.rs +++ b/src/app.rs @@ -114,6 +114,8 @@ pub struct App { /// Kill confirmation: (selected_index, timestamp). Expires after 2s. kill_confirm: Option<(usize, Instant)>, pub theme: Theme, + /// Agent CLIs hidden by config; their quota columns are hidden too. + pub hidden_agents: Vec, pub show_context: bool, pub show_quota: bool, pub show_tokens: bool, @@ -190,6 +192,7 @@ impl App { status_msg: None, kill_confirm: None, theme, + hidden_agents: hidden_agents.to_vec(), show_context: panels.context, show_quota: panels.quota, show_tokens: panels.tokens, diff --git a/src/ui/quota.rs b/src/ui/quota.rs index 1c65813e..5b165ba7 100644 --- a/src/ui/quota.rs +++ b/src/ui/quota.rs @@ -48,11 +48,19 @@ pub(crate) fn draw_quota_panel_active( // Split into side-by-side columns: one per known source (CLAUDE | CODEX). // Columns are always rendered so the panel layout stays stable even when a // source has no data yet. - let num_sources = SOURCES.len() as u16; + let mut sources: Vec<&str> = SOURCES + .iter() + .copied() + .filter(|s| !app.hidden_agents.iter().any(|h| h.eq_ignore_ascii_case(s))) + .collect(); + if sources.is_empty() { + sources = SOURCES.to_vec(); + } + let num_sources = sources.len() as u16; let col_w = inner.width / num_sources; let content_h = inner.height.saturating_sub(1); // reserve last row for totals - for (i, source) in SOURCES.iter().enumerate() { + for (i, source) in sources.iter().enumerate() { let col_x = inner.x + (i as u16) * col_w; let this_w = if i as u16 == num_sources - 1 { inner.width - (i as u16) * col_w diff --git a/src/ui/sessions.rs b/src/ui/sessions.rs index ce25f39b..0a2a29c3 100644 --- a/src/ui/sessions.rs +++ b/src/ui/sessions.rs @@ -91,6 +91,11 @@ pub(crate) fn draw_sessions_panel_active( let show_tokens = w >= 86; let show_memory = w >= 110; let show_turn = w >= 110; + // The AI column only tells sessions apart when more than plain Claude CLI runs. + let show_agent = app + .sessions + .iter() + .any(|s| s.agent_cli != "claude" || !s.launch_surface.label_suffix().is_empty()); let project_w: u16 = if w >= 120 { 14 @@ -255,11 +260,19 @@ pub(crate) fn draw_sessions_panel_active( ))); } + if !show_agent { + cells.remove(1); + } rows.push(Row::new(cells).style(row_style).height(1)); // 2nd line: task text in Summary column - let summary_idx = 3 + show_pid as usize + show_session_id as usize + show_config as usize; - let total_cols = 6 + let summary_idx = 2 + + show_agent as usize + + show_pid as usize + + show_session_id as usize + + show_config as usize; + let total_cols = 5 + + show_agent as usize + show_pid as usize + show_session_id as usize + show_config as usize @@ -308,8 +321,16 @@ pub(crate) fn draw_sessions_panel_active( if show_pid { sa_cells.push(Cell::from("")); } + if !show_agent { + sa_cells.remove(1); + } + let sa_name = if show_agent { + sa.name.clone() + } else { + format!("{prefix}{}", sa.name) + }; sa_cells.push(Cell::from(Span::styled( - truncate_str(&sa.name, project_w as usize), + truncate_str(&sa_name, project_w as usize), Style::default().fg(theme.graph_text), ))); if show_session_id { @@ -377,6 +398,9 @@ pub(crate) fn draw_sessions_panel_active( if show_turn { header_cells.push(Cell::from(Span::styled(t("col.turn"), header_style))); } + if !show_agent { + header_cells.remove(1); + } let header = Row::new(header_cells).height(1); let mut widths_vec: Vec = vec![ @@ -408,6 +432,9 @@ pub(crate) fn draw_sessions_panel_active( if show_turn { widths_vec.push(Constraint::Length(4)); // turn } + if !show_agent { + widths_vec.remove(1); + } // Scroll: rows vary per session in tree view; use the built row list as the source of truth. let visible_sessions = app.visible_indices(); @@ -1377,10 +1404,9 @@ mod tests { let cli_text = render(LaunchSurface::Cli); assert!( - cli_text.contains("*CC "), - "plain CLI session should render the unsuffixed label\n{cli_text}" + !cli_text.contains("*CC") && !cli_text.contains(" AI "), + "only plain Claude CLI sessions should hide the AI column\n{cli_text}" ); - assert!(!cli_text.contains("*CCa") && !cli_text.contains("*CCi")); let app_text = render(LaunchSurface::App); assert!( From b88afd8332789daaa6589521a22afe2a1c928cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Olav=20Torvik?= <50993453+Haakooto@users.noreply.github.com> Date: Tue, 17 Nov 2026 10:56:24 +0100 Subject: [PATCH 2/2] feat(ui): hide the AI column for any single agent CLI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The AI column hid only for Claude-only sessions. It now hides whenever all sessions come from one agent CLI and none is an App/IDE session. 🤖 Generated with Claude Code Co-Authored-By: Claude --- src/ui/sessions.rs | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/ui/sessions.rs b/src/ui/sessions.rs index 0a2a29c3..f9fdb9f6 100644 --- a/src/ui/sessions.rs +++ b/src/ui/sessions.rs @@ -91,11 +91,10 @@ pub(crate) fn draw_sessions_panel_active( let show_tokens = w >= 86; let show_memory = w >= 110; let show_turn = w >= 110; - // The AI column only tells sessions apart when more than plain Claude CLI runs. - let show_agent = app - .sessions - .iter() - .any(|s| s.agent_cli != "claude" || !s.launch_surface.label_suffix().is_empty()); + // The AI column only tells sessions apart when more than one agent, or an App/IDE session, runs. + let show_agent = app.sessions.iter().any(|s| { + s.agent_cli != app.sessions[0].agent_cli || !s.launch_surface.label_suffix().is_empty() + }); let project_w: u16 = if w >= 120 { 14 @@ -1405,7 +1404,7 @@ mod tests { let cli_text = render(LaunchSurface::Cli); assert!( !cli_text.contains("*CC") && !cli_text.contains(" AI "), - "only plain Claude CLI sessions should hide the AI column\n{cli_text}" + "sessions from one agent CLI should hide the AI column\n{cli_text}" ); let app_text = render(LaunchSurface::App); @@ -1421,6 +1420,35 @@ mod tests { ); } + #[test] + fn agent_column_shows_only_for_mixed_agent_clis() { + let render = |agents: &[&'static str]| { + let mut app = App::new_with_config(Theme::default(), &[], PanelVisibility::default()); + for (i, agent) in agents.iter().enumerate() { + let mut session = test_session(&format!("sid{i}"), "proj"); + session.agent_cli = agent; + app.sessions.push(session); + } + let mut terminal = Terminal::new(TestBackend::new(120, 20)).unwrap(); + terminal + .draw(|f| draw_sessions_panel(f, &app, Rect::new(0, 0, 120, 20), &app.theme)) + .unwrap(); + format!("{}", terminal.backend()) + }; + + let codex_only = render(&["codex", "codex"]); + assert!( + !codex_only.contains(">CD"), + "codex-only sessions should hide the AI column\n{codex_only}" + ); + + let mixed = render(&["claude", "codex"]); + assert!( + mixed.contains("*CC") && mixed.contains(">CD"), + "mixed agent CLIs should show the AI column\n{mixed}" + ); + } + #[test] fn task_row_text_respects_terminal_display_width() { assert_eq!(task_row_text("ABCD", 6), "└─ A…");