From e54480bd2d596f31e2399f9fca2fa7f550ca7e92 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Wed, 4 Feb 2026 11:04:28 -0300 Subject: [PATCH] agent_ui: Fix regression that made edited files unclickable (#48362) There was a `when()` condition here looking at `hovered_edited_file_buttons`, which is never turned to true when hovering over the edited file button, and given we started to pass the hover styles, tooltip, and on_click handler inside the condition, they would never work. The solution here is to make these three things unconditional, so edited files are always clickable. Release Notes: - N/A --- crates/agent_ui/src/acp/thread_view.rs | 46 ++++++++++---------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 47afb7ddd99785f6a7c396adc9ededec2e6eb65b..a3f66d4fc73a16499e9a9a5df69df634a7d79e38 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -5764,7 +5764,6 @@ impl AcpServerView { }) }), ) - .child(Divider::vertical().color(DividerColor::BorderVariant)) .child( Button::new(("reject-file", index), "Reject") .label_size(LabelSize::Small) @@ -5919,34 +5918,23 @@ impl AcpServerView { ) .label_size(LabelSize::XSmall), ) - .when( - match self.as_active_thread() { - Some(thread) => { - thread.hovered_edited_file_buttons == Some(index) - } - None => false, - }, - |this| { - let full_path = full_path.clone(); - this.hover(|s| s.bg(cx.theme().colors().element_hover)) - .tooltip(move |_, cx| { - Tooltip::with_meta( - "Go to File", - None, - full_path.clone(), - cx, - ) - }) - .on_click({ - let buffer = buffer.clone(); - cx.listener(move |this, _, window, cx| { - this.open_edited_buffer( - &buffer, window, cx, - ); - }) - }) - }, - ), + .hover(|s| s.bg(cx.theme().colors().element_hover)) + .tooltip({ + move |_, cx| { + Tooltip::with_meta( + "Go to File", + None, + full_path.clone(), + cx, + ) + } + }) + .on_click({ + let buffer = buffer.clone(); + cx.listener(move |this, _, window, cx| { + this.open_edited_buffer(&buffer, window, cx); + }) + }), ) .child(buttons);