Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent: Allow clicking on the whole edit file row to trigger review (#34041)

Danilo Leal02d0e725a888
diff --git a/crates/agent_ui/src/message_editor.rs b/crates/agent_ui/src/message_editor.rs
index 70d2b6e0661..38065b828ac 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()