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]