From fbb1f0f9119bf18dea3443c3e0d589508d96fe67 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 20 Nov 2026 11:56:02 +0000 Subject: [PATCH] story-render: walk the gallery's kept story states through Cells::states_mut --- crates/story-render/src/main.rs | 2 +- crates/ui-gallery/src/viewer/picks.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/story-render/src/main.rs b/crates/story-render/src/main.rs index 2af9566eb..1325d5b49 100644 --- a/crates/story-render/src/main.rs +++ b/crates/story-render/src/main.rs @@ -291,7 +291,7 @@ fn card(frames: &mut Frames, spec: &Spec, options: &Options) -> (Option, b }; settle(frames, options.width, &mut |ui| rect = show(ui, &mut cells)); let mut opened = false; - for state in cells.values_mut().filter(|state| state.dialog.hidden) { + for state in cells.states_mut().filter(|state| state.dialog.hidden) { state.show_dialog(); opened = true; } diff --git a/crates/ui-gallery/src/viewer/picks.rs b/crates/ui-gallery/src/viewer/picks.rs index 3a64525e5..0d8cde1bb 100644 --- a/crates/ui-gallery/src/viewer/picks.rs +++ b/crates/ui-gallery/src/viewer/picks.rs @@ -61,6 +61,11 @@ impl Cells { self.0.iter_mut().filter(|(index, _)| indices.contains(index)).map(|(index, state)| (*index, state)).collect() } + /// Every kept story's state, in index order. + pub fn states_mut(&mut self) -> impl Iterator { + self.0.values_mut() + } + /// Forgets every story's state. pub fn clear(&mut self) { self.0.clear();