From 96091494a52fcb94e892226e9b1fa1ab3faf68bb Mon Sep 17 00:00:00 2001 From: MarekSpodBiedry <73122968+MarekSpodBiedry@users.noreply.github.com> Date: Sat, 17 Oct 2026 15:03:28 +0200 Subject: [PATCH] M8: Keyboard shortcuts panel closes on the home screen (#548) --- crates/ui-egui/src/lib.rs | 2 ++ crates/ui-egui/src/shortcuts_tests.rs | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 360955a3..6d867abf 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1414,6 +1414,8 @@ impl FigApp { return; } if !self.has_files() || self.ui.home { + // The shortcuts panel belongs to the canvas; it doesn't hang over the home screen. + self.ui.shortcuts_panel = false; tabs::tab_bar(self, ui); home::show(self, ui); dialogs::keys(self, &ctx); diff --git a/crates/ui-egui/src/shortcuts_tests.rs b/crates/ui-egui/src/shortcuts_tests.rs index cd0f0ea5..5c1e06fa 100644 --- a/crates/ui-egui/src/shortcuts_tests.rs +++ b/crates/ui-egui/src/shortcuts_tests.rs @@ -188,3 +188,12 @@ fn shortcuts_panel_opens_switches_tabs_and_searches() { u.app.run("help.shortcuts", json!({})); assert!(!u.app.ui.shortcuts_panel, "the command toggles it"); } + +#[test] +fn shortcuts_panel_does_not_show_on_the_home_screen() { + let mut u = Ui::new(Session::empty()); + u.app.ui.home = true; + u.app.ui.shortcuts_panel = true; + u.frame(vec![]); + assert!(!u.app.ui.shortcuts_panel, "the panel closes on the home screen"); +}