From 68724ea99edbb38a476206f805b3dfb4e8e33de9 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Wed, 28 May 2025 15:29:52 -0300 Subject: [PATCH] agent: Make clicking on the backdrop to dismiss message editing more reliable (#31614) Previously, the click on the backdrop to dismiss the message editing was unreliable. You would click on it and sometimes it would work and others it wouldn't. This PR fixes that now. Release Notes: - agent: Fixes the previous message dismissal by clicking on the backdrop --- crates/agent/src/active_thread.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/agent/src/active_thread.rs b/crates/agent/src/active_thread.rs index de8553e1cc..71fd524ead 100644 --- a/crates/agent/src/active_thread.rs +++ b/crates/agent/src/active_thread.rs @@ -1831,6 +1831,7 @@ impl ActiveThread { let colors = cx.theme().colors(); let editor_bg_color = colors.editor_background; + let panel_bg = colors.panel_background; let open_as_markdown = IconButton::new(("open-as-markdown", ix), IconName::DocumentText) .icon_size(IconSize::XSmall) @@ -1851,7 +1852,6 @@ impl ActiveThread { const RESPONSE_PADDING_X: Pixels = px(19.); let show_feedback = thread.is_turn_end(ix); - let feedback_container = h_flex() .group("feedback_container") .mt_1() @@ -2148,16 +2148,14 @@ impl ActiveThread { message_id > *editing_message_id }); - let panel_background = cx.theme().colors().panel_background; - let backdrop = div() - .id("backdrop") - .stop_mouse_events_except_scroll() + .id(("backdrop", ix)) + .size_full() .absolute() .inset_0() - .size_full() - .bg(panel_background) + .bg(panel_bg) .opacity(0.8) + .stop_mouse_events_except_scroll() .on_click(cx.listener(Self::handle_cancel_click)); v_flex()