From 58664206cf34fc9a46c9935e28a63b534635f6a1 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 8 Jan 2024 10:51:20 -0500 Subject: [PATCH 1/2] Use info color for assistant role indicator --- crates/assistant/src/assistant_panel.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 6e2ab02cad603e297d1392e89af65dc4fe516970..0a5b30002ed271f0b50b35b65d26745c75d0da61 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -2300,9 +2300,7 @@ impl ConversationEditor { let sender = ButtonLike::new("role") .child(match message.role { Role::User => Label::new("You").color(Color::Default), - Role::Assistant => { - Label::new("Assistant").color(Color::Modified) - } + Role::Assistant => Label::new("Assistant").color(Color::Info), Role::System => Label::new("System").color(Color::Warning), }) .tooltip(|cx| { From 42bd9ffa7e1026abce9a6c2009c4ade0b10b603e Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 8 Jan 2024 10:52:12 -0500 Subject: [PATCH 2/2] Use filled button style for role indicator in assistant panel This fixes the left side of the button getting clipped on hover. --- crates/assistant/src/assistant_panel.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 0a5b30002ed271f0b50b35b65d26745c75d0da61..f53343531af09083999e04f1d3dce92eafe34850 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -2298,6 +2298,7 @@ impl ConversationEditor { move |_cx| { let message_id = message.id; let sender = ButtonLike::new("role") + .style(ButtonStyle::Filled) .child(match message.role { Role::User => Label::new("You").color(Color::Default), Role::Assistant => Label::new("Assistant").color(Color::Info), @@ -2329,10 +2330,7 @@ impl ConversationEditor { .h_11() .relative() .gap_1() - // Sender is a button with a padding of 1, but only has a background on hover, - // so we shift it left by the same amount to align the text with the content - // in the un-hovered state. - .child(div().child(sender).relative().neg_left_1()) + .child(sender) // TODO: Only show this if the message if the message has been sent .child( Label::new(