From 97835f9a5f653a5e432dae0070e332cc2203ce5a Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Mon, 9 Feb 2026 11:36:11 +0100 Subject: [PATCH] agent_ui: Fix panic when resizing panel (#48772) - [X] Code Reviewed - [X] Manual QA Release Notes: - N/A --- crates/agent_ui/src/agent_panel.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/agent_ui/src/agent_panel.rs b/crates/agent_ui/src/agent_panel.rs index ba3b9943713db2e0f26b464da21a26237dc13d6e..d5602b0d0913e4f22e0955b7561c7806c5f181bf 100644 --- a/crates/agent_ui/src/agent_panel.rs +++ b/crates/agent_ui/src/agent_panel.rs @@ -485,7 +485,7 @@ pub struct AgentPanel { } impl AgentPanel { - fn serialize(&mut self, cx: &mut Context) { + fn serialize(&mut self, cx: &mut App) { let workspace_id = self .workspace .read_with(cx, |workspace, _| workspace.database_id()) @@ -1894,7 +1894,14 @@ impl Panel for AgentPanel { DockPosition::Left | DockPosition::Right => self.width = size, DockPosition::Bottom => self.height = size, } - self.serialize(cx); + let this = cx.weak_entity(); + cx.defer(move |cx| { + if let Some(this) = this.upgrade() { + this.update(cx, |this, cx| { + this.serialize(cx); + }); + } + }); cx.notify(); }