From 435708b6154a825f4c639808bf660fb550ef93f7 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:08:49 -0300 Subject: [PATCH] assistant: Fine-tune crease feedback design (#20395) Closes https://github.com/zed-industries/zed/issues/13414 Just polishing up how some of these look. Ever since the issue was opened, we added the "Error" label to the button, as well as automatically popping open the toast error whenever that happens. Lastly, there's a tooltip in there as well indicating that you can click on it to see the details of the error. Screenshot 2024-11-08 at 00 26 27 Release Notes: - N/A --- crates/assistant/src/assistant_panel.rs | 33 +++++++++---------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 52139fce8c..6900a536e9 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -2760,7 +2760,7 @@ impl ContextEditor { .h_11() .w_full() .relative() - .gap_1() + .gap_1p5() .child(sender) .children(match &message.cache { Some(cache) if cache.is_final_anchor => match cache.status { @@ -2774,7 +2774,7 @@ impl ContextEditor { ) .tooltip(|cx| { Tooltip::with_meta( - "Context cached", + "Context Cached", None, "Large messages cached to optimize performance", cx, @@ -2802,16 +2802,9 @@ impl ContextEditor { .selected_icon_color(Color::Error) .icon(IconName::XCircle) .icon_color(Color::Error) - .icon_size(IconSize::Small) + .icon_size(IconSize::XSmall) .icon_position(IconPosition::Start) - .tooltip(move |cx| { - Tooltip::with_meta( - "Error interacting with language model", - None, - "Click for more details", - cx, - ) - }) + .tooltip(move |cx| Tooltip::text("View Details", cx)) .on_click({ let context = context.clone(); let error = error.clone(); @@ -2826,21 +2819,19 @@ impl ContextEditor { .into_any_element(), ), MessageStatus::Canceled => Some( - ButtonLike::new("canceled") - .child(Icon::new(IconName::XCircle).color(Color::Disabled)) + h_flex() + .gap_1() + .items_center() + .child( + Icon::new(IconName::XCircle) + .color(Color::Disabled) + .size(IconSize::XSmall), + ) .child( Label::new("Canceled") .size(LabelSize::Small) .color(Color::Disabled), ) - .tooltip(move |cx| { - Tooltip::with_meta( - "Canceled", - None, - "Interaction with the assistant was canceled", - cx, - ) - }) .into_any_element(), ), _ => None,