From 5ca114be249a59a323f1a7102a7799bfb6bc180e Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Wed, 7 May 2025 12:43:46 -0300 Subject: [PATCH] agent: Make feedback buttons more minimal (#30133) Also swapped out the svgs for `ThumbsDown` and `ThumbsUp`, and added `DocumentText`. Release Notes: - N/A --- assets/icons/document_text.svg | 3 +++ assets/icons/thumbs_down.svg | 4 +++- assets/icons/thumbs_up.svg | 4 +++- crates/agent/src/active_thread.rs | 20 +++++++------------- crates/icons/src/icons.rs | 1 + 5 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 assets/icons/document_text.svg diff --git a/assets/icons/document_text.svg b/assets/icons/document_text.svg new file mode 100644 index 0000000000..78c08d92f9 --- /dev/null +++ b/assets/icons/document_text.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/thumbs_down.svg b/assets/icons/thumbs_down.svg index 816273e970..2edc09acd1 100644 --- a/assets/icons/thumbs_down.svg +++ b/assets/icons/thumbs_down.svg @@ -1 +1,3 @@ - + + + diff --git a/assets/icons/thumbs_up.svg b/assets/icons/thumbs_up.svg index 01fae76fe7..ff4406034d 100644 --- a/assets/icons/thumbs_up.svg +++ b/assets/icons/thumbs_up.svg @@ -1 +1,3 @@ - + + + diff --git a/crates/agent/src/active_thread.rs b/crates/agent/src/active_thread.rs index 9004127d8f..8e5cc146bb 100644 --- a/crates/agent/src/active_thread.rs +++ b/crates/agent/src/active_thread.rs @@ -1780,8 +1780,7 @@ impl ActiveThread { let colors = cx.theme().colors(); let editor_bg_color = colors.editor_background; - let open_as_markdown = IconButton::new(("open-as-markdown", ix), IconName::FileCode) - .shape(ui::IconButtonShape::Square) + let open_as_markdown = IconButton::new(("open-as-markdown", ix), IconName::DocumentText) .icon_size(IconSize::XSmall) .icon_color(Color::Ignored) .tooltip(Tooltip::text("Open Thread as Markdown")) @@ -1806,13 +1805,16 @@ impl ActiveThread { .mt_1() .py_2() .px(RESPONSE_PADDING_X) - .gap_1() + .mr_1() + .opacity(0.4) + .hover(|style| style.opacity(1.)) + .gap_1p5() .flex_wrap() .justify_end(); let feedback_items = match self.thread.read(cx).message_feedback(message_id) { Some(feedback) => feedback_container .child( - div().mr_1().visible_on_hover("feedback_container").child( + div().visible_on_hover("feedback_container").child( Label::new(match feedback { ThreadFeedback::Positive => "Thanks for your feedback!", ThreadFeedback::Negative => { @@ -1825,11 +1827,8 @@ impl ActiveThread { ) .child( h_flex() - .pr_1() - .gap_1() .child( IconButton::new(("feedback-thumbs-up", ix), IconName::ThumbsUp) - .shape(ui::IconButtonShape::Square) .icon_size(IconSize::XSmall) .icon_color(match feedback { ThreadFeedback::Positive => Color::Accent, @@ -1847,7 +1846,6 @@ impl ActiveThread { ) .child( IconButton::new(("feedback-thumbs-down", ix), IconName::ThumbsDown) - .shape(ui::IconButtonShape::Square) .icon_size(IconSize::XSmall) .icon_color(match feedback { ThreadFeedback::Positive => Color::Ignored, @@ -1868,7 +1866,7 @@ impl ActiveThread { .into_any_element(), None => feedback_container .child( - div().mr_1().visible_on_hover("feedback_container").child( + div().visible_on_hover("feedback_container").child( Label::new( "Rating the thread sends all of your current conversation to the Zed team.", ) @@ -1878,13 +1876,10 @@ impl ActiveThread { ) .child( h_flex() - .pr_1() - .gap_1() .child( IconButton::new(("feedback-thumbs-up", ix), IconName::ThumbsUp) .icon_size(IconSize::XSmall) .icon_color(Color::Ignored) - .shape(ui::IconButtonShape::Square) .tooltip(Tooltip::text("Helpful Response")) .on_click(cx.listener(move |this, _, window, cx| { this.handle_feedback_click( @@ -1899,7 +1894,6 @@ impl ActiveThread { IconButton::new(("feedback-thumbs-down", ix), IconName::ThumbsDown) .icon_size(IconSize::XSmall) .icon_color(Color::Ignored) - .shape(ui::IconButtonShape::Square) .tooltip(Tooltip::text("Not Helpful")) .on_click(cx.listener(move |this, _, window, cx| { this.handle_feedback_click( diff --git a/crates/icons/src/icons.rs b/crates/icons/src/icons.rs index 3ee48e0e1b..48ab648900 100644 --- a/crates/icons/src/icons.rs +++ b/crates/icons/src/icons.rs @@ -94,6 +94,7 @@ pub enum IconName { Delete, Diff, Disconnected, + DocumentText, Download, Ellipsis, EllipsisVertical,