diff --git a/crates/acp_thread/src/acp_thread.rs b/crates/acp_thread/src/acp_thread.rs index 2195f9e73ef085bdbaf91aaec6e42383f533ee8f..df59c67bb4576e34f76539df34147fb4606bb9f3 100644 --- a/crates/acp_thread/src/acp_thread.rs +++ b/crates/acp_thread/src/acp_thread.rs @@ -2072,6 +2072,11 @@ impl AcpThread { cx.notify(); } + pub fn clear_plan(&mut self, cx: &mut Context) { + self.plan.entries.clear(); + cx.notify(); + } + #[cfg(any(test, feature = "test-support"))] pub fn send_raw( &mut self, diff --git a/crates/agent_ui/src/conversation_view/thread_view.rs b/crates/agent_ui/src/conversation_view/thread_view.rs index ad7efa94324e910ed6f5bc63efe1cdf1b26bdc9e..1ad07efd52ddcffe29bd3d50e382d85813c3c994 100644 --- a/crates/agent_ui/src/conversation_view/thread_view.rs +++ b/crates/agent_ui/src/conversation_view/thread_view.rs @@ -2540,7 +2540,17 @@ impl ThreadView { this.border_b_1().border_color(cx.theme().colors().border) }) .child(Disclosure::new("plan_disclosure", plan_expanded)) - .child(title) + .child(title.flex_1()) + .child( + IconButton::new("dismiss-plan", IconName::Close) + .icon_size(IconSize::XSmall) + .shape(ui::IconButtonShape::Square) + .tooltip(Tooltip::text("Clear plan")) + .on_click(cx.listener(|this, _, _, cx| { + this.thread.update(cx, |thread, cx| thread.clear_plan(cx)); + cx.stop_propagation(); + })), + ) .on_click(cx.listener(|this, _, _, cx| { this.plan_expanded = !this.plan_expanded; cx.notify();