From 415d4823952bea6fe0a51fd0b9b4a58e6f006c93 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Tue, 10 Jun 2025 11:34:21 -0300 Subject: [PATCH] agent: Only show the MCP configuration modal in the active window (#32450) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were previously displaying this modal in all open Zed windows if triggered. That was a bit annoying because I had to go to each window individually to close it, which meant doing it multiple times. 😅 Release Notes: - agent: Fixed the MCP configuration modal to show only in the active window. --- .../agent/src/context_server_configuration.rs | 4 ++++ crates/extensions_ui/src/extensions_ui.rs | 22 +++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/crates/agent/src/context_server_configuration.rs b/crates/agent/src/context_server_configuration.rs index 363d2ef047..49effbdc0f 100644 --- a/crates/agent/src/context_server_configuration.rs +++ b/crates/agent/src/context_server_configuration.rs @@ -71,6 +71,10 @@ fn show_configure_mcp_modal( window: &mut Window, cx: &mut Context<'_, Workspace>, ) { + if !window.is_window_active() { + return; + } + let context_server_store = workspace.project().read(cx).context_server_store(); let repository: Option = manifest.repository.as_ref().map(|s| s.clone().into()); diff --git a/crates/extensions_ui/src/extensions_ui.rs b/crates/extensions_ui/src/extensions_ui.rs index 72547fbe75..db13de95b1 100644 --- a/crates/extensions_ui/src/extensions_ui.rs +++ b/crates/extensions_ui/src/extensions_ui.rs @@ -554,13 +554,15 @@ impl ExtensionsPage { ) .child( h_flex() - .gap_2() + .gap_1() .justify_between() .child( Button::new( SharedString::from(format!("rebuild-{}", extension.id)), "Rebuild", ) + .color(Color::Accent) + .disabled(matches!(status, ExtensionStatus::Upgrading)) .on_click({ let extension_id = extension.id.clone(); move |_, _, cx| { @@ -568,12 +570,12 @@ impl ExtensionsPage { store.rebuild_dev_extension(extension_id.clone(), cx) }); } - }) - .color(Color::Accent) - .disabled(matches!(status, ExtensionStatus::Upgrading)), + }), ) .child( Button::new(SharedString::from(extension.id.clone()), "Uninstall") + .color(Color::Accent) + .disabled(matches!(status, ExtensionStatus::Removing)) .on_click({ let extension_id = extension.id.clone(); move |_, _, cx| { @@ -581,9 +583,7 @@ impl ExtensionsPage { store.uninstall_extension(extension_id.clone(), cx) }); } - }) - .color(Color::Accent) - .disabled(matches!(status, ExtensionStatus::Removing)), + }), ) .when(can_configure, |this| { this.child( @@ -591,8 +591,8 @@ impl ExtensionsPage { SharedString::from(format!("configure-{}", extension.id)), "Configure", ) - - + .color(Color::Accent) + .disabled(matches!(status, ExtensionStatus::Installing)) .on_click({ let manifest = Arc::new(extension.clone()); move |_, _, cx| { @@ -609,9 +609,7 @@ impl ExtensionsPage { }); } } - }) - .color(Color::Accent) - .disabled(matches!(status, ExtensionStatus::Installing)), + }), ) }), ),