Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
agent: Only show profile manage list item selection keybinding on the focused item (#39242)
Danilo Leal1cac3e3e4041
diff --git a/crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs b/crates/agent_ui/src/agent_configuration/manage_profiles_modal.rsindex cb9aabab925..9a7f0ed602a 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<Self>,) -> 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| {