From 64b3eea3cddde1c94f710bfa07702334cf4c0829 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Wed, 26 Mar 2025 09:10:40 -0300 Subject: [PATCH] assistant2: Fix tool label overflowing on card header (#27489) ### Before ### After Now, you can horizontally scroll when the header holds an overflowing label. https://github.com/user-attachments/assets/6cb90de3-1db5-4a30-8f23-22221098a233 Release Notes: - N/A --- crates/assistant2/src/active_thread.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/crates/assistant2/src/active_thread.rs b/crates/assistant2/src/active_thread.rs index 72a678d085763355b25203f14ebdbad54173a710..b2e16db1a75a5b7914e3412bb14ebe942a671cbe 100644 --- a/crates/assistant2/src/active_thread.rs +++ b/crates/assistant2/src/active_thread.rs @@ -1325,6 +1325,7 @@ impl ActiveThread { .child( h_flex() .group("disclosure-header") + .gap_1p5() .justify_between() .py_1() .px_2() @@ -1339,22 +1340,19 @@ impl ActiveThread { .border_color(lighter_border) .child( h_flex() + .id("tool-label-container") + .relative() .gap_1p5() + .max_w_full() + .overflow_x_scroll() .child( Icon::new(tool_use.icon) .size(IconSize::XSmall) .color(Color::Muted), ) - .child( - div() - .text_ui_sm(cx) - .children( - self.rendered_tool_use_labels - .get(&tool_use.id) - .cloned(), - ) - .truncate(), - ), + .child(h_flex().text_ui_sm(cx).children( + self.rendered_tool_use_labels.get(&tool_use.id).cloned(), + )), ) .child( h_flex()