From d1b8b3007bdf0b937502c0825dd0c622da16838d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 20:16:01 -0800 Subject: [PATCH] Command Palette: a panel pick in Presentation Mode changes nothing As `window.panel` does, a pick of a panel's result in Presentation Mode now leaves the panels as they are and the status line says panels can't be shown in that mode. Before, the pick moved the panel to the front of its group and showed the dock once the mode ended. --- crates/ui-egui/src/palette.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index 9928837ebf..150c782f96 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -389,8 +389,11 @@ pub(crate) fn run_pick(app: &mut VectorcraftApp, id: &str) { app.select_tool(tool); } else if let Some(panel) = id.strip_prefix("panel:") { // A panel that can be seen stays as it is, where `window.panel` would put an open flyout or - // a floating panel away. - if let Err(e) = crate::panel_docking::reveal_panel(app, panel) { + // a floating panel away. In Presentation Mode the pick fails and changes nothing, as + // `window.panel` does. + if app.ui.screen_mode >= 3 { + app.status("panels can't be shown in Presentation Mode"); + } else if let Err(e) = crate::panel_docking::reveal_panel(app, panel) { app.status(e); } } else if id.starts_with("plugin:") || id.starts_with("effect:") { @@ -1778,6 +1781,20 @@ mod tests { } } + /// In Presentation Mode a panel's pick fails as `window.panel` does: the status line says why, + /// and the panel does not show when the mode ends. + #[test] + fn a_panel_pick_in_presentation_mode_changes_nothing() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default()); + let (open_panel, dock) = (app.ui.open_panel.clone(), app.ui.dock); + app.ui.screen_mode = 3; + run_pick(&mut app, "panel:swatches"); + assert_eq!(app.ui.status, "panels can't be shown in Presentation Mode"); + assert_eq!((app.ui.open_panel.clone(), app.ui.dock), (open_panel, dock)); + app.ui.screen_mode = 0; + assert!(!crate::panel_docking::showing(&app.ui, "swatches"), "the pick did not place the panel"); + } + /// Each Effect menu item is a result under its menu path, with its shortcut. With a document /// open and an object selected, a pick of Drop Shadow… opens its dialog, as the menu item /// does, and changes nothing until the dialog is confirmed.