From 9909b59bd03388b5e99e4ddc2de3b7409ab667ed Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Sun, 2 Nov 2025 14:56:23 -0300 Subject: [PATCH] agent_ui: Improve the "go to file" affordance in the edit bar (#41762) This PR makes it clearer that you can click on the file path to open the corresponding file in the agent panel's "edit bar", which is the element that shows up in the panel as soon as agent-made edits happen. Release Notes: - agent panel: Improved the "go to file" affordance in the edit bar. --- crates/agent_ui/src/acp/thread_view.rs | 34 +++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index a4b3106fa9d9ded053ff2f33b720ec3b10512d01..5c575de401daf26bd7815bc49d923072243ee980 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -3631,6 +3631,7 @@ impl AcpThreadView { .child( h_flex() .id("edits-container") + .cursor_pointer() .gap_1() .child(Disclosure::new("edits-disclosure", expanded)) .map(|this| { @@ -3770,6 +3771,7 @@ impl AcpThreadView { Label::new(name.to_string()) .size(LabelSize::XSmall) .buffer_font(cx) + .ml_1p5() }); let file_icon = FileIcons::get_icon(path.as_std_path(), cx) @@ -3801,14 +3803,30 @@ impl AcpThreadView { }) .child( h_flex() + .id(("file-name-row", index)) .relative() - .id(("file-name", index)) .pr_8() - .gap_1p5() .w_full() .overflow_x_scroll() - .child(file_icon) - .child(h_flex().gap_0p5().children(file_name).children(file_path)) + .child( + h_flex() + .id(("file-name-path", index)) + .cursor_pointer() + .pr_0p5() + .gap_0p5() + .hover(|s| s.bg(cx.theme().colors().element_hover)) + .rounded_xs() + .child(file_icon) + .children(file_name) + .children(file_path) + .tooltip(Tooltip::text("Go to File")) + .on_click({ + let buffer = buffer.clone(); + cx.listener(move |this, _, window, cx| { + this.open_edited_buffer(&buffer, window, cx); + }) + }), + ) .child( div() .absolute() @@ -3818,13 +3836,7 @@ impl AcpThreadView { .bottom_0() .right_0() .bg(overlay_gradient), - ) - .on_click({ - let buffer = buffer.clone(); - cx.listener(move |this, _, window, cx| { - this.open_edited_buffer(&buffer, window, cx); - }) - }), + ), ) .child( h_flex()