From 975ccce6c813cc9b8fcd260013e08d3d589c3dd6 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 23:24:47 -0500 Subject: [PATCH] fw sync: ui-panels compiles: one Dialog::least_width (the container prop), story commands on CommandStates, tracked rail slots in a trial --- crates/ui-panels/src/dialog/modal.rs | 8 -------- crates/ui-panels/src/dialog/recovery.rs | 2 +- crates/ui-panels/src/docking/iconic/stories.rs | 11 +++++------ crates/ui-panels/tests/it/rails/drawer.rs | 4 ++-- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/crates/ui-panels/src/dialog/modal.rs b/crates/ui-panels/src/dialog/modal.rs index fea0823e0..6e7c91fe5 100644 --- a/crates/ui-panels/src/dialog/modal.rs +++ b/crates/ui-panels/src/dialog/modal.rs @@ -271,14 +271,6 @@ impl<'a> Dialog<'a> { self } - /// The least width of the dialog's content from the size role `least`, in place of `size.dialog.least`: a wide - /// dialog (`LeastWidth::WideDialog`) whose tabs hold tables. - #[must_use] - pub fn least_width(mut self, least: crate::contract::LeastWidth) -> Self { - self.props = self.props.least_width(least); - self - } - /// The dialog reports the alert-dialog role instead of the dialog role. #[must_use] pub(super) fn alert(mut self) -> Self { diff --git a/crates/ui-panels/src/dialog/recovery.rs b/crates/ui-panels/src/dialog/recovery.rs index 9ed6ae668..a1a864c07 100644 --- a/crates/ui-panels/src/dialog/recovery.rs +++ b/crates/ui-panels/src/dialog/recovery.rs @@ -5,7 +5,7 @@ use super::host::{DialogResult, StackDialog}; use super::prompt::{Prompt, Reply, apply_to_all, buttons}; use super::stack::{DialogId, DialogStack, dialog_id}; use super::words::DialogWords; -use crate::contract::{Bind, NoValue, Outcome, Props as _, Show as _}; +use crate::contract::{Bind, NoValue, Outcome}; use crate::runtime::env::{Env, Label}; use crate::runtime::overlay::CloseReason; use crate::sections::DialogRole; diff --git a/crates/ui-panels/src/docking/iconic/stories.rs b/crates/ui-panels/src/docking/iconic/stories.rs index 3505e8a49..7d79e2699 100644 --- a/crates/ui-panels/src/docking/iconic/stories.rs +++ b/crates/ui-panels/src/docking/iconic/stories.rs @@ -5,7 +5,7 @@ use crate::buttons::Button; use crate::contract::ShowContainer as _; use crate::contract::{Bind, BodyCx, Show as _, Validity}; use crate::docking::{ColumnBar, GroupAt, IconicColumn, IconicColumnOutput, IconicMode, PanelSpec}; -use crate::runtime::commands::{CommandInput, CommandState}; +use crate::runtime::commands::{CommandState, CommandStates}; use crate::runtime::env::{Env, Message}; use crate::sections::Panel; use crate::testing::memory::global; @@ -44,11 +44,10 @@ fn toggled(panel: &u8) -> PanelSpec { /// Brushes has something to show while it is closed, so its cell carries the marker; Swatches has something to show /// but is open, so its cell carries none; History has nothing to show. -fn marked_states(input: CommandInput) -> CommandInput { - input - .state(PanelToggles::Brushes, CommandState::new().checked(false).marked(true).hint("3 new brushes")) - .state(PanelToggles::Swatches, CommandState::new().checked(true).marked(true).hint("2 new swatches")) - .state(PanelToggles::History, CommandState::new().checked(false)) +fn marked_states(states: &mut CommandStates) { + states.set(PanelToggles::Brushes, CommandState::new().checked(false).marked(true).hint("3 new brushes")); + states.set(PanelToggles::Swatches, CommandState::new().checked(true).marked(true).hint("2 new swatches")); + states.set(PanelToggles::History, CommandState::new().checked(false)); } /// Shows `column` as a dock shows it: at the end edge of a stage, as wide as the rail, its flyouts opening over the diff --git a/crates/ui-panels/tests/it/rails/drawer.rs b/crates/ui-panels/tests/it/rails/drawer.rs index 2f8351a1f..60e5cc39f 100644 --- a/crates/ui-panels/tests/it/rails/drawer.rs +++ b/crates/ui-panels/tests/it/rails/drawer.rs @@ -176,9 +176,9 @@ fn the_drawer_opens_on_the_side_it_is_given() { #[trial] fn the_edit_toolbar_button_takes_the_apps_icon() { use craft_ui::rails::{LastUsed, ToolRail}; + let slots = Tracked::new(vec![slot(0, &[UNDO])]); + let last = Tracked::new(LastUsed::default()); let mut fixture = Fixture::new(move |ui| { - let slots = [slot(0, &[UNDO])]; - let last = LastUsed::default(); let _ = ToolRail::new("Tools", &slots, &UNDO, &last) .edit_toolbar("Customize") .edit_icon(craft_behavior::IconId::new("settings"))