From 0c064ca7d3fd909eb10033fe77eb6fbb8dad4a7e Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 12 Nov 2026 11:44:18 +0000 Subject: [PATCH] ListRow: a row's ideal width counts its optional items A content-sized row asks for room for its optional trailing items, so a content-fitted box (the CommandPalette) shows each row's path with its label whole. A row given less than its ideal width still drops them first; its least width is unchanged. --- crates/ui-widgets/src/list/row.rs | 6 +++-- crates/ui-widgets/src/list/row/placement.rs | 6 +++-- crates/ui-widgets/tests/it/list.rs | 28 +++++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/crates/ui-widgets/src/list/row.rs b/crates/ui-widgets/src/list/row.rs index 69287e658..92cff578d 100644 --- a/crates/ui-widgets/src/list/row.rs +++ b/crates/ui-widgets/src/list/row.rs @@ -464,7 +464,8 @@ impl<'a> ListRow<'a> { self } - /// A text at the trailing end that drops out when the label would get narrower than its least width with it. + /// A text at the trailing end that drops out when the label would get narrower than its least width with it. A row + /// sized to its content makes room for it. #[must_use] pub fn optional(mut self, text: impl Into