From 6be061e60fce0ceb451b0e17f2292e30454047ec Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 09:36:32 -0800 Subject: [PATCH] Docking: drop the icon-column float workaround now that craft-libs expands it The craft-libs pin (186a229c8d) includes storytold/craft-libs#4138: a group or tab dragged out of a dock column collapsed to icons now floats or docks expanded in craft-libs itself, while a whole icon column that floats stays collapsed. The floated_from_icons pass added by #9964 expanded those windows a second time after each dock pass, so it is removed and the dock pass stores the area's workspace as it did before. The test from #9964, a_group_dragged_out_of_the_icon_column_floats_expanded_and_its_tabs_switch, is kept and passes on craft-libs alone. --- crates/ui-egui/src/panel_docking.rs | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/crates/ui-egui/src/panel_docking.rs b/crates/ui-egui/src/panel_docking.rs index 74a5586b04..0fd8936a45 100644 --- a/crates/ui-egui/src/panel_docking.rs +++ b/crates/ui-egui/src/panel_docking.rs @@ -521,22 +521,6 @@ fn flyout_tab(layout: &Layout, panel: &str) -> Option { .map(|front| front.to_string()) } -/// The actions that expand each floating window the pass made from part of a column collapsed to -/// icons, so a group or tab dragged out of an icon column floats as an expanded panel with its tabs -/// in the window. A whole icon column floated stays collapsed. -fn floated_from_icons(before: &Layout, after: &Layout) -> Vec> { - after - .floating - .iter() - .filter(|window| window.column.iconic && !before.floating.iter().any(|old| old.id == window.id)) - .filter_map(|window| { - let first = window.panels().next()?; - let (_, column) = column_of(before, first)?; - (column.iconic && column.panels().count() > window.panels().count()).then(|| Action::set_iconic(first.clone(), false)) - }) - .collect() -} - /// Show `panel` as `window.panel` does, but leave it be when it can be seen already ([`visible`]): /// a command that opens a panel to work in (Edit › Color Settings…) never puts it away. A flyout /// keeps the name of the icon that opened it after another of its tabs is clicked, so a panel whose @@ -1393,20 +1377,13 @@ pub(crate) fn show(app: &mut VectorcraftApp, ui: &mut egui::Ui, keeps_tools: boo app.dock_rt.rails = rails; // A workspace a command switched to or changed in this pass (`Workspace::replace`) stays; the // pass's edits were to the one it replaced. - let mut expand = Vec::new(); if app.ui.dock_workspace.revision() == revision { - let before = std::mem::replace(&mut app.ui.dock_workspace, workspace); - expand = floated_from_icons(before.layout(), layout_of(&app.ui)); + app.ui.dock_workspace = workspace; } // A command of this pass that opened or closed a flyout wins over the area's own change. if app.ui.open_panel == flyout_before { app.ui.open_panel = flyout; } - if !expand.is_empty() - && let Err(error) = apply(app, None, expand) - { - app.status(error); - } if output.error.is_some() { Arc::make_mut(&mut app.ui.dock_workspace).replace(default_workspace(&[])); app.status(tl!("Invalid panel layout; restored the default dock").to_string());