From 4bc9f70f5e6b57c71c9212b3f90e14dc7eddab45 Mon Sep 17 00:00:00 2001 From: Pratik Rai Date: Sun, 3 May 2026 15:02:23 +0530 Subject: [PATCH 1/3] fix(ui): Correct context chip styling during active CLI agent sessions (Fixes Bug 3 from #9958) --- app/src/context_chips/display_chip.rs | 46 +++++++++++++++++---------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/app/src/context_chips/display_chip.rs b/app/src/context_chips/display_chip.rs index 72cdec32c..e4e14a702 100644 --- a/app/src/context_chips/display_chip.rs +++ b/app/src/context_chips/display_chip.rs @@ -999,14 +999,17 @@ impl DisplayChip { app: &AppContext, ) -> Box { let appearance = Appearance::as_ref(app); - let font_color = if self.is_in_agent_view { + let is_cli_agent_active = self.is_cli_agent_session_active(app); + + let font_color = if is_cli_agent_active { + internal_colors::neutral_6(appearance.theme()) + } else if self.is_in_agent_view { agent_view_chip_color(appearance) } else { appearance.theme().ansi_fg_green() }; - let is_interactive = - !self.is_shared_session_viewer && !self.is_cli_agent_session_active(app); + let is_interactive = !self.is_shared_session_viewer && !is_cli_agent_active; let is_in_agent_view = self.is_in_agent_view; let chip_text = self.text.clone(); let hover = Hoverable::new(self.mouse_state.clone(), move |state| { @@ -1280,18 +1283,20 @@ impl DisplayChip { } else { // Non-interactive chip (either show_menu is false or in active ambient agent) let font_color = if self.is_in_agent_view { - // Use disabled text color when in active ambient agent - if is_in_active_ambient_agent { + // Use disabled text color when in active ambient agent or CLI agent session + if is_in_active_ambient_agent || is_cli_agent_active { theme .disabled_text_color(blended_colors::neutral_1(theme).into()) .into_solid() } else { - // In agent view but the chip is non-interactive for reasons other than an active - // ambient agent session. Keep the normal agent-view subtext styling (not disabled). agent_view_chip_color(appearance) } } else { - theme.ansi_fg_cyan() + if is_cli_agent_active { + internal_colors::neutral_6(theme) + } else { + theme.ansi_fg_cyan() + } }; let chip_text = self.text.clone(); @@ -1414,28 +1419,37 @@ impl DisplayChip { app: &AppContext, ) -> Box { let appearance = Appearance::as_ref(app); + let is_cli_agent_active = self.is_cli_agent_session_active(app); let chip_text = self.text.clone(); let is_in_agent_view = self.is_in_agent_view; let hoverable = Hoverable::new(self.mouse_state.clone(), move |state| { - let color = if is_in_agent_view { + let color = if is_cli_agent_active { + internal_colors::neutral_6(appearance.theme()) + } else if is_in_agent_view { agent_view_chip_color(appearance) } else { appearance.theme().ansi_fg_green() }; - let hovered = state.is_hovered() && !popup_open; + let hovered = state.is_hovered() && !popup_open && !is_cli_agent_active; let mut config = UdiChipConfig::new_with_icon(Icon::NodeJS, color, chip_text.clone()) .with_hovered(hovered); if is_in_agent_view { config = config.for_agent_view(); } render_udi_chip(config, appearance) - }) - .on_click(|ctx, _app, _pos| { - ctx.dispatch_typed_action(DisplayChipAction::ToggleMenu); - }) - .with_cursor(Cursor::PointingHand) - .finish(); + }); + + let hoverable = if is_cli_agent_active { + hoverable.finish() + } else { + hoverable + .on_click(|ctx, _app, _pos| { + ctx.dispatch_typed_action(DisplayChipAction::ToggleMenu); + }) + .with_cursor(Cursor::PointingHand) + .finish() + }; let mut stack = Stack::new().with_child(hoverable); if popup_open { From 87acd2cfd44a79544d517a077f8587a5dc3e33d6 Mon Sep 17 00:00:00 2001 From: Pratik Rai Date: Sun, 3 May 2026 15:16:23 +0530 Subject: [PATCH 2/3] fix(ui): close Node version popup when CLI agent session becomes active --- app/src/context_chips/display_chip.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/context_chips/display_chip.rs b/app/src/context_chips/display_chip.rs index e4e14a702..216ee2a38 100644 --- a/app/src/context_chips/display_chip.rs +++ b/app/src/context_chips/display_chip.rs @@ -1452,7 +1452,7 @@ impl DisplayChip { }; let mut stack = Stack::new().with_child(hoverable); - if popup_open { + if popup_open && !is_cli_agent_active { let positioning = self.menu_positioning_provider.menu_position(app); let (parent_anchor, child_anchor) = Self::positioning_to_anchors(positioning); let offset = match positioning { From 4e876f431135a09f7ce7a0186e32c53a002fd455 Mon Sep 17 00:00:00 2001 From: Pratik Rai Date: Sun, 3 May 2026 16:50:40 +0530 Subject: [PATCH 3/3] fix(ui): separate CLI agent styling and suppress menus in agent view --- app/src/context_chips/display_chip.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/context_chips/display_chip.rs b/app/src/context_chips/display_chip.rs index 216ee2a38..981963fce 100644 --- a/app/src/context_chips/display_chip.rs +++ b/app/src/context_chips/display_chip.rs @@ -1047,7 +1047,7 @@ impl DisplayChip { let mut stack = Stack::new().with_child(hover); - if menu_open { + if menu_open && !is_cli_agent_active { let positioning = self.menu_positioning_provider.menu_position(app); let (parent_anchor, child_anchor) = Self::positioning_to_anchors(positioning); let offset = match positioning { @@ -1283,8 +1283,9 @@ impl DisplayChip { } else { // Non-interactive chip (either show_menu is false or in active ambient agent) let font_color = if self.is_in_agent_view { - // Use disabled text color when in active ambient agent or CLI agent session - if is_in_active_ambient_agent || is_cli_agent_active { + if is_cli_agent_active { + internal_colors::neutral_6(theme) + } else if is_in_active_ambient_agent { theme .disabled_text_color(blended_colors::neutral_1(theme).into()) .into_solid() @@ -1330,7 +1331,7 @@ impl DisplayChip { stack.add_child(button); - if menu_open { + if menu_open && !is_cli_agent_active { let positioning = self.menu_positioning_provider.menu_position(app); let (parent_anchor, child_anchor) = Self::positioning_to_anchors(positioning);