From 70d5149ba6775fac3b0adf33a9b1898314c96e0f Mon Sep 17 00:00:00 2001 From: aiongg Date: Sat, 24 Oct 2026 19:54:13 +0000 Subject: [PATCH] =?UTF-8?q?Docking:=20Preflight=20Panel=E2=80=A6=20keeps?= =?UTF-8?q?=20an=20open=20Preflight=20flyout;=20search=20leaves=20out=20un?= =?UTF-8?q?available=20and=20alias=20docking=20commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/ui-egui/src/chrome.rs | 6 ++++-- crates/ui-egui/src/menus.rs | 30 +++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index cbcfb13cd..a46ad2558 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -1095,9 +1095,11 @@ pub fn doc_tabs(app: &mut DesignApp, ui: &mut egui::Ui) { } } -/// Show the Preflight panel. +/// Show the Preflight panel. An open Preflight flyout stays: `window.panel` would close it. fn show_preflight(app: &mut DesignApp) { - if let Err(e) = app.run("window.panel", json!({"panel": "preflight"})) { + if app.ui.docking_flyout.as_deref() != Some("preflight") + && let Err(e) = app.run("window.panel", json!({"panel": "preflight"})) + { app.status(e); } } diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 0d4f0a78d..fee463311 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -3408,9 +3408,23 @@ fn quick_commands() -> impl Iterator bool { query_lower.is_empty() || texts.iter().any(|t| t.to_lowercase().contains(query_lower)) @@ -6162,6 +6176,20 @@ mod tests { assert!(app.ui.dialog.is_some(), "clicking the empty end of the Preferences… row must choose it"); } + /// Quick Apply and the menu search list no unavailable docking command and no label twice + /// among the UI commands. + #[test] + fn searched_ui_commands_are_available_and_named_once() { + let ui_ids: Vec<&str> = UI_COMMANDS.iter().map(|c| c.0).collect(); + let searched: Vec<(&str, &str)> = quick_commands().filter(|c| ui_ids.contains(&c.0)).map(|c| (c.0, c.1)).collect(); + assert!(!searched.iter().any(|c| matches!(c.0, "window.panel.window" | "window.workspace.lock")), "{searched:?}"); + let mut labels: Vec<&str> = searched.iter().map(|c| c.1).collect(); + labels.sort_unstable(); + let before = labels.len(); + labels.dedup(); + assert_eq!(labels.len(), before, "a label twice: {searched:?}"); + } + /// Keys a floating panel's own OS window left over run the main window's tool shortcuts, /// Escape and the active tool's keys. #[test]