From 3090c995be4e45c8a87276a8f62dfc0c2fa82f76 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 23 Nov 2026 04:04:17 +0700 Subject: [PATCH] The context menu keeps No Suggestions, a heading alone in its group, out of the menu tidy that drops such headings --- crates/ui-egui/src/menus/context.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/menus/context.rs b/crates/ui-egui/src/menus/context.rs index f0be29ac80..9ff6f3c9c0 100644 --- a/crates/ui-egui/src/menus/context.rs +++ b/crates/ui-egui/src/menus/context.rs @@ -14,8 +14,9 @@ pub fn context_items(app: &VectorcraftApp) -> Vec { let roots: Vec<&vectorcraft_doc::Node> = st.selection.objects.iter().filter_map(|id| st.doc.node(*id)).collect(); let any = |f: fn(&NodeKind) -> bool| roots.iter().any(|n| f(&n.kind)); let several = roots.len() >= 2; - let mut v = spelling_items(app); - v.extend([c("Undo", "edit.undo"), c("Redo", "edit.redo"), Sep]); + // The spelling rows stay out of `prune`: tidy drops a heading with no item after it, and No Suggestions is alone. + let spelling = spelling_items(app); + let mut v = vec![c("Undo", "edit.undo"), c("Redo", "edit.redo"), Sep]; if st.isolation.is_some() { v.extend([c("Exit Isolation Mode", "object.exitIsolation"), Sep]); } @@ -128,7 +129,7 @@ pub fn context_items(app: &VectorcraftApp) -> Vec { c("Export Selection…", "file.exportSelection"), ]); } - prune(app, v) + [spelling, prune(app, v)].concat() } /// A right-click on a word Auto Spell Check underlined ([`crate::state::UiState::context_spelling`]):