mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
Add a button to remove the plan UI (#52360)
## Context This PR adds a button to remove the plan UI, if the user wants. ## Self-Review Checklist <!-- Check before requesting review: --> - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
This commit is contained in:
parent
6aaf08de09
commit
b95542410c
2 changed files with 16 additions and 1 deletions
|
|
@ -2072,6 +2072,11 @@ impl AcpThread {
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
pub fn clear_plan(&mut self, cx: &mut Context<Self>) {
|
||||
self.plan.entries.clear();
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn send_raw(
|
||||
&mut self,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue