diff --git a/crates/assistant2/src/ui/context_pill.rs b/crates/assistant2/src/ui/context_pill.rs index e0b8ee2f9768b59f9516be86e89b6b5bb29ef6ec..00b3dba867183491c439473e13d142c1aa7ff219 100644 --- a/crates/assistant2/src/ui/context_pill.rs +++ b/crates/assistant2/src/ui/context_pill.rs @@ -126,7 +126,13 @@ impl RenderOnce for ContextPill { h_flex() .id("context-data") .gap_1() - .child(Label::new(context.name.clone()).size(LabelSize::Small)) + .child( + div().max_w_64().child( + Label::new(context.name.clone()) + .size(LabelSize::Small) + .truncate(), + ), + ) .when_some(context.parent.as_ref(), |element, parent_name| { if *dupe_name { element.child( @@ -174,21 +180,22 @@ impl RenderOnce for ContextPill { }) .hover(|style| style.bg(color.element_hover.opacity(0.5))) .child( - Label::new(name.clone()) - .size(LabelSize::Small) - .color(Color::Muted), + div().px_0p5().max_w_64().child( + Label::new(name.clone()) + .size(LabelSize::Small) + .color(Color::Muted) + .truncate(), + ), ) .child( - div().px_0p5().child( - Label::new(match kind { - ContextKind::File => "Active Tab", - ContextKind::Thread - | ContextKind::Directory - | ContextKind::FetchedUrl => "Active", - }) - .size(LabelSize::XSmall) - .color(Color::Muted), - ), + Label::new(match kind { + ContextKind::File => "Active Tab", + ContextKind::Thread | ContextKind::Directory | ContextKind::FetchedUrl => { + "Active" + } + }) + .size(LabelSize::XSmall) + .color(Color::Muted), ) .child( Icon::new(IconName::Plus)