Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent: Dismiss the agent panel notification if window is closed (#34230)

Danilo Leal9d2b7c80336f
diff --git a/crates/agent_ui/src/active_thread.rs b/crates/agent_ui/src/active_thread.rs
index e8651e0c5f6..383729017a1 100644
--- a/crates/agent_ui/src/active_thread.rs
+++ b/crates/agent_ui/src/active_thread.rs
@@ -787,6 +787,15 @@ impl ActiveThread {
.unwrap()
}
});
+
+ let workspace_subscription = if let Some(workspace) = workspace.upgrade() {
+ Some(cx.observe_release(&workspace, |this, _, cx| {
+ this.dismiss_notifications(cx);
+ }))
+ } else {
+ None
+ };
+
let mut this = Self {
language_registry,
thread_store,
@@ -834,6 +843,10 @@ impl ActiveThread {
}
}
+ if let Some(subscription) = workspace_subscription {
+ this._subscriptions.push(subscription);
+ }
+
this
}