Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
agent: Allow dismissing previous message by clicking on the backdrop (#30822)
Danilo Leal6bec76cd5d32
diff --git a/crates/agent/src/active_thread.rs b/crates/agent/src/active_thread.rsindex 3b7e8b3ee4a..827a3f1fcb6 100644--- a/crates/agent/src/active_thread.rs+++ b/crates/agent/src/active_thread.rs@@ -2028,9 +2028,6 @@ impl ActiveThread {)}),)- .when(editing_message_state.is_none(), |this| {- this.tooltip(Tooltip::text("Click To Edit"))- }).on_click(cx.listener({let message_segments = message.segments.clone();move |this, _, window, cx| {@@ -2071,6 +2068,16 @@ impl ActiveThread {let panel_background = cx.theme().colors().panel_background;+ let backdrop = div()+ .id("backdrop")+ .stop_mouse_events_except_scroll()+ .absolute()+ .inset_0()+ .size_full()+ .bg(panel_background)+ .opacity(0.8)+ .on_click(cx.listener(Self::handle_cancel_click));+v_flex().w_full().map(|parent| {@@ -2240,15 +2247,7 @@ impl ActiveThread {}).when(after_editing_message, |parent| {// Backdrop to dim out the whole thread below the editing user message- parent.relative().child(- div()- .stop_mouse_events_except_scroll()- .absolute()- .inset_0()- .size_full()- .bg(panel_background)- .opacity(0.8),- )+ parent.relative().child(backdrop)}).into_any()}