From 03cf79c56509127924805cf56792273612eccec9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 20:06:59 -0800 Subject: [PATCH] Command Palette: a press on a Recent Commands row runs it instead of closing the palette The Recent Commands list draws on its own layer, so a press on one of its rows counted as a press outside the popup and closed the palette before the click ran the row. Presses on the list's layer now count as inside. --- crates/ui-egui/src/palette.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index 6d822a645f..ede05a4f0b 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -718,9 +718,9 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { } }); }); - // A press of any pointer button that the popup's layer does not get closes it: a press on the - // backdrop, or on a window above it, which also gets the press, even where that window lies - // over the popup. + // A press of any pointer button that neither the popup's layer nor its Recent Commands list's + // layer gets closes it: a press on the backdrop, or on a window above it, which also gets the + // press, even where that window lies over the popup. let presses: Vec = ctx.input(|i| { i.events .iter() @@ -731,7 +731,8 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { .collect() }); let popup = egui::LayerId::new(egui::Order::Foreground, egui::Id::unique("palette")); - let outside = presses.into_iter().any(|p| ctx.layer_id_at(p) != Some(popup)); + let list = egui::LayerId::new(egui::Order::Foreground, recent_list_id()); + let outside = presses.into_iter().any(|p| !ctx.layer_id_at(p).is_some_and(|l| l == popup || l == list)); // The pointer or a scroll moved the highlight after the rows were drawn: the next frame draws // it where it now is. if sel != drawn {