Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
agent_ui: Registry follow-ups (#50287)
Ben Brandtc5f83f570cf2
diff --git a/crates/agent_ui/src/agent_configuration.rs b/crates/agent_ui/src/agent_configuration.rsindex 9126d289c94..aa316ba7c5e 100644--- a/crates/agent_ui/src/agent_configuration.rs+++ b/crates/agent_ui/src/agent_configuration.rs@@ -1140,7 +1140,34 @@ impl AgentConfiguration {})),)}- ExternalAgentSource::Custom => None,+ ExternalAgentSource::Custom => {+ let fs = self.fs.clone();+ Some(+ IconButton::new(+ SharedString::from(format!("uninstall-{}", id)),+ IconName::Trash,+ )+ .icon_color(Color::Muted)+ .icon_size(IconSize::Small)+ .tooltip(Tooltip::text("Remove Custom Agent"))+ .on_click(cx.listener(move |_, _, _window, cx| {+ let agent_name = agent_server_name.clone();+ update_settings_file(fs.clone(), cx, move |settings, _| {+ let Some(agent_servers) = settings.agent_servers.as_mut() else {+ return;+ };+ if let Some(entry) = agent_servers.get(agent_name.0.as_ref())+ && matches!(+ entry,+ settings::CustomAgentServerSettings::Custom { .. }+ )+ {+ agent_servers.remove(agent_name.0.as_ref());+ }+ });+ })),+ )+ }};h_flex()diff --git a/crates/agent_ui/src/agent_registry_ui.rs b/crates/agent_ui/src/agent_registry_ui.rsindex 45361b9ee26..44d5bb20fb7 100644--- a/crates/agent_ui/src/agent_registry_ui.rs+++ b/crates/agent_ui/src/agent_registry_ui.rs@@ -24,10 +24,6 @@ use workspace::{item::{Item, ItemEvent},};-/// Registry IDs for built-in agents that Zed already provides first-class support for.-/// These are filtered out of the ACP Agent Registry UI to avoid showing duplicates.-const BUILT_IN_REGISTRY_IDS: [&str; 4] = ["claude-acp", "claude-code-acp", "codex-acp", "gemini"];-#[derive(Clone, Copy, Debug, PartialEq, Eq)]enum RegistryFilter {All,@@ -162,8 +158,14 @@ impl AgentRegistryPage {self.registry_agents.sort_by(|left, right| {left.name().as_ref()- .cmp(right.name().as_ref())- .then_with(|| left.id().as_ref().cmp(right.id().as_ref()))+ .to_lowercase()+ .cmp(&right.name().as_ref().to_lowercase())+ .then_with(|| {+ left.id()+ .as_ref()+ .to_lowercase()+ .cmp(&right.id().as_ref().to_lowercase())+ })});self.filter_registry_agents(cx);}@@ -215,12 +217,6 @@ impl AgentRegistryPage {.iter().enumerate().filter(|(_, agent)| {- // Filter out built-in agents since they already appear in the main- // agent configuration UI and don't need to be installed from the registry.- if BUILT_IN_REGISTRY_IDS.contains(&agent.id().as_ref()) {- return false;- }-let matches_search = search.as_ref().is_none_or(|query| {let query = query.as_str();agent.id().as_ref().to_lowercase().contains(query)