From 2c8a86460e00af7639b0a31cde268c0a0ed54389 Mon Sep 17 00:00:00 2001 From: Martin Ball Date: Wed, 18 Nov 2026 21:18:51 +0000 Subject: [PATCH] A collection's layout reads its own exiting keyed presences, so a departing ribbon tab keeps its slot and fades there The layout hook scopes the StyleCx it hands to item_layout to the collection's id and motion policy; StyleCx::exiting returned nothing before, so the tab strip reserved no slot and painted no fading tab. --- crates/ui-contract/src/contract/items/hooks.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-contract/src/contract/items/hooks.rs b/crates/ui-contract/src/contract/items/hooks.rs index 19d5c1153..d6fcd677f 100644 --- a/crates/ui-contract/src/contract/items/hooks.rs +++ b/crates/ui-contract/src/contract/items/hooks.rs @@ -175,10 +175,12 @@ impl ShapeHooks for ItemsHooks<'_, '_, C> { ShowAt::Rect(rect) => rect.size(), ShowAt::Flow => crate::layout::flow_room(ui), }; - let scx = &scx.measured_by(ui); + let env = Env::of(ui); + // The layout reads the component's own motion memory (`StyleCx::exiting`): an item leaving its source keeps + // its room until its exit ends. + let scx = &scx.measured_by(ui).owned_by(id, env.motion); self.room = room; self.indent_step = scx.control().icon; - let env = Env::of(ui); let room = Self::inner_room(comp, &env.tokens, room); // Where the enclosing body does not give the width, the collection takes its width from its content, whether // it fills or fills the width, as a container does. Held in a content-sized column it measures so, and shows