From 02d0e725a8883adfea25f83e88f59cd250937f9c Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Tue, 8 Jul 2025 01:19:00 -0300 Subject: [PATCH] agent: Allow clicking on the whole edit file row to trigger review (#34041) Just a small quality-of-life type of PR that makes clicking anywhere until the "Review" button trigger the action that that button triggers (i.e., opens the review multibuffer). Release Notes: - agent: Added the ability to click the whole file row in the edits bar to trigger the review multibuffer. --- crates/agent_ui/src/message_editor.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/agent_ui/src/message_editor.rs b/crates/agent_ui/src/message_editor.rs index 70d2b6e066..38065b828a 100644 --- a/crates/agent_ui/src/message_editor.rs +++ b/crates/agent_ui/src/message_editor.rs @@ -1160,7 +1160,7 @@ impl MessageEditor { }) .child( h_flex() - .id("file-name") + .id(("file-name", index)) .pr_8() .gap_1p5() .max_w_full() @@ -1171,9 +1171,16 @@ impl MessageEditor { .gap_0p5() .children(file_name) .children(file_path), - ), // TODO: Implement line diff - // .child(Label::new("+").color(Color::Created)) - // .child(Label::new("-").color(Color::Deleted)), + ) + .on_click({ + let buffer = buffer.clone(); + cx.listener(move |this, _, window, cx| { + this.handle_file_click(buffer.clone(), window, cx); + }) + }), // TODO: Implement line diff + // .child(Label::new("+").color(Color::Created)) + // .child(Label::new("-").color(Color::Deleted)), + // ) .child( h_flex()