From 26249504720b04a2f84f3b229c66763c5a21f4b0 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:17:56 -0300 Subject: [PATCH] agent: Fix text wrapping in the provider set up list items (#33063) Release Notes: - agent: Fixed text wrapping in the provider set up list items in the settings view. --- .../src/ui/instruction_list_item.rs | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/crates/language_models/src/ui/instruction_list_item.rs b/crates/language_models/src/ui/instruction_list_item.rs index af744b0ae3b5785cbbda5a4ed64f500d19502682..794a85b400aca3d7dadd201ac76a3f07fd0a97f0 100644 --- a/crates/language_models/src/ui/instruction_list_item.rs +++ b/crates/language_models/src/ui/instruction_list_item.rs @@ -40,29 +40,30 @@ impl IntoElement for InstructionListItem { let link = button_link.clone(); let unique_id = SharedString::from(format!("{}-button", self.label)); - h_flex().flex_wrap().child(Label::new(self.label)).child( - Button::new(unique_id, button_label) - .style(ButtonStyle::Subtle) - .icon(IconName::ArrowUpRight) - .icon_size(IconSize::XSmall) - .icon_color(Color::Muted) - .on_click(move |_, _window, cx| cx.open_url(&link)), - ) + h_flex() + .flex_wrap() + .child(Label::new(self.label)) + .child( + Button::new(unique_id, button_label) + .style(ButtonStyle::Subtle) + .icon(IconName::ArrowUpRight) + .icon_size(IconSize::XSmall) + .icon_color(Color::Muted) + .on_click(move |_, _window, cx| cx.open_url(&link)), + ) + .into_any_element() } else { - div().child(Label::new(self.label)) + Label::new(self.label).into_any_element() }; - div() - .child( - ListItem::new("list-item") - .selectable(false) - .start_slot( - Icon::new(IconName::Dash) - .size(IconSize::XSmall) - .color(Color::Hidden), - ) - .child(item_content), + ListItem::new("list-item") + .selectable(false) + .start_slot( + Icon::new(IconName::Dash) + .size(IconSize::XSmall) + .color(Color::Hidden), ) - .into_any() + .child(div().w_full().child(item_content)) + .into_any_element() } }