assistant2: Fix tool label overflowing on card header (#27489)

### Before

<img
src="https://github.com/user-attachments/assets/f56211d8-d60d-4e6c-9c40-af2523f71431"
width="600" />

### 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
This commit is contained in:
Danilo Leal 2025-03-26 09:10:40 -03:00 committed by GitHub
parent 72318df4b5
commit 64b3eea3cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1325,6 +1325,7 @@ impl ActiveThread {
.child( .child(
h_flex() h_flex()
.group("disclosure-header") .group("disclosure-header")
.gap_1p5()
.justify_between() .justify_between()
.py_1() .py_1()
.px_2() .px_2()
@ -1339,22 +1340,19 @@ impl ActiveThread {
.border_color(lighter_border) .border_color(lighter_border)
.child( .child(
h_flex() h_flex()
.id("tool-label-container")
.relative()
.gap_1p5() .gap_1p5()
.max_w_full()
.overflow_x_scroll()
.child( .child(
Icon::new(tool_use.icon) Icon::new(tool_use.icon)
.size(IconSize::XSmall) .size(IconSize::XSmall)
.color(Color::Muted), .color(Color::Muted),
) )
.child( .child(h_flex().text_ui_sm(cx).children(
div() self.rendered_tool_use_labels.get(&tool_use.id).cloned(),
.text_ui_sm(cx) )),
.children(
self.rendered_tool_use_labels
.get(&tool_use.id)
.cloned(),
)
.truncate(),
),
) )
.child( .child(
h_flex() h_flex()