Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
agent_ui: Improve UI for the feedback container (#43195)
Danilo Leal6adb0f4d0372
diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rsindex 784fef0b9f3..f3565356cf5 100644--- a/crates/agent_ui/src/acp/thread_view.rs+++ b/crates/agent_ui/src/acp/thread_view.rs@@ -5024,15 +5024,12 @@ impl AcpThreadView {}));let mut container = h_flex()- .id("thread-controls-container")- .group("thread-controls-container").w_full().py_2().px_5().gap_px().opacity(0.6)- .hover(|style| style.opacity(1.))- .flex_wrap()+ .hover(|s| s.opacity(1.)).justify_end();if AgentSettings::get_global(cx).enable_feedback@@ -5042,23 +5039,13 @@ impl AcpThreadView {{let feedback = self.thread_feedback.feedback;- container = container- .child(- div().visible_on_hover("thread-controls-container").child(- Label::new(match feedback {- Some(ThreadFeedback::Positive) => "Thanks for your feedback!",- Some(ThreadFeedback::Negative) => {- "We appreciate your feedback and will use it to improve."- }- None => {- "Rating the thread sends all of your current conversation to the Zed team."- }- })- .color(Color::Muted)- .size(LabelSize::XSmall)- .truncate(),- ),+ let tooltip_meta = || {+ SharedString::new(+ "Rating the thread sends all of your current conversation to the Zed team.",)+ };++ container = container.child(IconButton::new("feedback-thumbs-up", IconName::ThumbsUp).shape(ui::IconButtonShape::Square)@@ -5067,7 +5054,12 @@ impl AcpThreadView {Some(ThreadFeedback::Positive) => Color::Accent,_ => Color::Ignored,})- .tooltip(Tooltip::text("Helpful Response"))+ .tooltip(move |window, cx| match feedback {+ Some(ThreadFeedback::Positive) => {+ Tooltip::text("Thanks for your feedback!")(window, cx)+ }+ _ => Tooltip::with_meta("Helpful Response", None, tooltip_meta(), cx),+ }).on_click(cx.listener(move |this, _, window, cx| {this.handle_feedback_click(ThreadFeedback::Positive, window, cx);})),@@ -5080,7 +5072,16 @@ impl AcpThreadView {Some(ThreadFeedback::Negative) => Color::Accent,_ => Color::Ignored,})- .tooltip(Tooltip::text("Not Helpful"))+ .tooltip(move |window, cx| match feedback {+ Some(ThreadFeedback::Negative) => {+ Tooltip::text(+ "We appreciate your feedback and will use it to improve in the future.",+ )(window, cx)+ }+ _ => {+ Tooltip::with_meta("Not Helpful Response", None, tooltip_meta(), cx)+ }+ }).on_click(cx.listener(move |this, _, window, cx| {this.handle_feedback_click(ThreadFeedback::Negative, window, cx);})),