From 1cac3e3e4041752b2620758f686e5aac3ae6edff Mon Sep 17 00:00:00 2001
From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Date: Tue, 30 Sep 2025 19:39:12 -0300
Subject: [PATCH] agent: Only show profile manage list item selection
keybinding on the focused item (#39242)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Small update here that makes the UI simpler; there's no need to see the
keybinding in all the items you're not focused in.
| Before | After |
|--------|--------|
|
|
|
Release Notes:
- N/A
---
.../manage_profiles_modal.rs | 36 ++++++++++---------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs b/crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs
index cb9aabab9250b2f6175912c0a73242bc7f331dc6..9a7f0ed602a52d3b27dde565383453f2c5c325fb 100644
--- a/crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs
+++ b/crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs
@@ -317,6 +317,8 @@ impl ManageProfilesModal {
window: &mut Window,
cx: &mut Context,
) -> impl IntoElement + use<> {
+ let is_focused = profile.navigation.focus_handle.contains_focused(window, cx);
+
div()
.id(SharedString::from(format!("profile-{}", profile.id)))
.track_focus(&profile.navigation.focus_handle)
@@ -328,25 +330,27 @@ impl ManageProfilesModal {
})
.child(
ListItem::new(SharedString::from(format!("profile-{}", profile.id)))
- .toggle_state(profile.navigation.focus_handle.contains_focused(window, cx))
+ .toggle_state(is_focused)
.inset(true)
.spacing(ListItemSpacing::Sparse)
.child(Label::new(profile.name.clone()))
- .end_slot(
- h_flex()
- .gap_1()
- .child(
- Label::new("Customize")
- .size(LabelSize::Small)
- .color(Color::Muted),
- )
- .children(KeyBinding::for_action_in(
- &menu::Confirm,
- &self.focus_handle,
- window,
- cx,
- )),
- )
+ .when(is_focused, |this| {
+ this.end_slot(
+ h_flex()
+ .gap_1()
+ .child(
+ Label::new("Customize")
+ .size(LabelSize::Small)
+ .color(Color::Muted),
+ )
+ .children(KeyBinding::for_action_in(
+ &menu::Confirm,
+ &self.focus_handle,
+ window,
+ cx,
+ )),
+ )
+ })
.on_click({
let profile_id = profile.id.clone();
cx.listener(move |this, _, window, cx| {