From cd9aca69f6668c445e5afe50fc823359768337f9 Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Thu, 18 Dec 2025 13:51:33 -0300 Subject: [PATCH] Iterate on the UI --- crates/ui/src/components/ai/tool_call.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/crates/ui/src/components/ai/tool_call.rs b/crates/ui/src/components/ai/tool_call.rs index 05c8cfc6857aea5cd32caf74f72f4f25e9f78296..590072b4970ecac068e6f1f88cd372e3f3f6d027 100644 --- a/crates/ui/src/components/ai/tool_call.rs +++ b/crates/ui/src/components/ai/tool_call.rs @@ -6,8 +6,8 @@ pub struct ToolCall { icon: IconName, title: SharedString, actions_slot: Option, - use_card_layout: bool, content: Option, + use_card_layout: bool, } impl ToolCall { @@ -26,11 +26,6 @@ impl ToolCall { self } - pub fn use_card_layout(mut self, use_card_layout: bool) -> Self { - self.use_card_layout = use_card_layout; - self - } - pub fn actions_slot(mut self, action: impl IntoElement) -> Self { self.actions_slot = Some(action.into_any_element()); self @@ -40,6 +35,11 @@ impl ToolCall { self.content = Some(content.into_any_element()); self } + + pub fn use_card_layout(mut self, use_card_layout: bool) -> Self { + self.use_card_layout = use_card_layout; + self + } } impl RenderOnce for ToolCall { @@ -56,12 +56,15 @@ impl RenderOnce for ToolCall { .gap_1() .justify_between() .when(self.use_card_layout, |this| { - this.p_1() + this.px_2() + .py_1() .bg(cx.theme().colors().element_background.opacity(0.2)) }) .child( h_flex() + .hover(|s| s.bg(cx.theme().colors().element_hover.opacity(0.5))) .gap_1p5() + .rounded_xs() .child( Icon::new(self.icon) .size(IconSize::Small) @@ -79,7 +82,8 @@ impl RenderOnce for ToolCall { this.child( div() .when(self.use_card_layout, |this| { - this.border_t_1() + this.p_2() + .border_t_1() .border_color(cx.theme().colors().border) .bg(cx.theme().colors().editor_background) })