agent: Only show the MCP configuration modal in the active window (#32450)
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.
This commit is contained in:
parent
a9d0eee2a9
commit
415d482395
2 changed files with 14 additions and 12 deletions
|
@ -71,6 +71,10 @@ fn show_configure_mcp_modal(
|
||||||
window: &mut Window,
|
window: &mut Window,
|
||||||
cx: &mut Context<'_, Workspace>,
|
cx: &mut Context<'_, Workspace>,
|
||||||
) {
|
) {
|
||||||
|
if !window.is_window_active() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let context_server_store = workspace.project().read(cx).context_server_store();
|
let context_server_store = workspace.project().read(cx).context_server_store();
|
||||||
let repository: Option<SharedString> = manifest.repository.as_ref().map(|s| s.clone().into());
|
let repository: Option<SharedString> = manifest.repository.as_ref().map(|s| s.clone().into());
|
||||||
|
|
||||||
|
|
|
@ -554,13 +554,15 @@ impl ExtensionsPage {
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_2()
|
.gap_1()
|
||||||
.justify_between()
|
.justify_between()
|
||||||
.child(
|
.child(
|
||||||
Button::new(
|
Button::new(
|
||||||
SharedString::from(format!("rebuild-{}", extension.id)),
|
SharedString::from(format!("rebuild-{}", extension.id)),
|
||||||
"Rebuild",
|
"Rebuild",
|
||||||
)
|
)
|
||||||
|
.color(Color::Accent)
|
||||||
|
.disabled(matches!(status, ExtensionStatus::Upgrading))
|
||||||
.on_click({
|
.on_click({
|
||||||
let extension_id = extension.id.clone();
|
let extension_id = extension.id.clone();
|
||||||
move |_, _, cx| {
|
move |_, _, cx| {
|
||||||
|
@ -568,12 +570,12 @@ impl ExtensionsPage {
|
||||||
store.rebuild_dev_extension(extension_id.clone(), cx)
|
store.rebuild_dev_extension(extension_id.clone(), cx)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
.color(Color::Accent)
|
|
||||||
.disabled(matches!(status, ExtensionStatus::Upgrading)),
|
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Button::new(SharedString::from(extension.id.clone()), "Uninstall")
|
Button::new(SharedString::from(extension.id.clone()), "Uninstall")
|
||||||
|
.color(Color::Accent)
|
||||||
|
.disabled(matches!(status, ExtensionStatus::Removing))
|
||||||
.on_click({
|
.on_click({
|
||||||
let extension_id = extension.id.clone();
|
let extension_id = extension.id.clone();
|
||||||
move |_, _, cx| {
|
move |_, _, cx| {
|
||||||
|
@ -581,9 +583,7 @@ impl ExtensionsPage {
|
||||||
store.uninstall_extension(extension_id.clone(), cx)
|
store.uninstall_extension(extension_id.clone(), cx)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
.color(Color::Accent)
|
|
||||||
.disabled(matches!(status, ExtensionStatus::Removing)),
|
|
||||||
)
|
)
|
||||||
.when(can_configure, |this| {
|
.when(can_configure, |this| {
|
||||||
this.child(
|
this.child(
|
||||||
|
@ -591,8 +591,8 @@ impl ExtensionsPage {
|
||||||
SharedString::from(format!("configure-{}", extension.id)),
|
SharedString::from(format!("configure-{}", extension.id)),
|
||||||
"Configure",
|
"Configure",
|
||||||
)
|
)
|
||||||
|
.color(Color::Accent)
|
||||||
|
.disabled(matches!(status, ExtensionStatus::Installing))
|
||||||
.on_click({
|
.on_click({
|
||||||
let manifest = Arc::new(extension.clone());
|
let manifest = Arc::new(extension.clone());
|
||||||
move |_, _, cx| {
|
move |_, _, cx| {
|
||||||
|
@ -609,9 +609,7 @@ impl ExtensionsPage {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
.color(Color::Accent)
|
|
||||||
.disabled(matches!(status, ExtensionStatus::Installing)),
|
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue