From 63ab092576a8d2e52ad565f281d25ea74378cd13 Mon Sep 17 00:00:00 2001 From: aiongg Date: Sat, 24 Oct 2026 23:37:41 +0000 Subject: [PATCH] View: F8 on a right panel that isn't showing brings it forward in its mode When the right panel is open but minimized or behind another tab, F8 keeps its mode instead of switching to the one it last hid, and view.rightPanel reveals Tools. Test: F8 on a minimized floating Tools window in Crop opens the window and stays in Crop. --- crates/ui-egui/src/docking.rs | 1 + crates/ui-egui/src/menus.rs | 4 +++- crates/ui-egui/src/shortcuts.rs | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/docking.rs b/crates/ui-egui/src/docking.rs index 017ffe842..2fc69e0da 100644 --- a/crates/ui-egui/src/docking.rs +++ b/crates/ui-egui/src/docking.rs @@ -229,6 +229,7 @@ pub(crate) fn reveal_command(app: &mut crate::LightcraftApp, id: &str) -> Result // the sidebar it scrolls, also when it is a tab behind another panel Some(Panel::Library) } else if (id.starts_with("panel.") && id != "panel.close" && id != "panel.presets" + || id == "view.rightPanel" || id.starts_with("section.") || id.starts_with("tool.") && id != "tool.none") && app.ui.right != crate::state::RightPanel::None diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index a162e6ca6..baf3d4514 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -865,7 +865,7 @@ pub fn run_ui_command(app: &mut LightcraftApp, id: &str, p: &Value) -> Option RightPanel::Edit, p => p, @@ -878,6 +878,8 @@ pub fn run_ui_command(app: &mut LightcraftApp, id: &str, p: &Value) -> Option { diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 032548f6a..435936190 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -863,6 +863,24 @@ mod tests { assert_eq!(h.app.ui.right, RightPanel::Edit); } + /// F8 on a minimized Tools window opens it again in the mode it had. + #[test] + fn classic_f8_shows_a_minimized_tools_window_and_keeps_its_mode() { + use crate::{docking::Panel, state::RightPanel}; + let mut h = library(); + h.app.ui.view = crate::state::ViewMode::Detail; + h.app.ui.right = RightPanel::Edit; + h.settle(std::time::Duration::from_secs(10)); + h.app.run("ui.dock", json!({"operation": "float", "panel": "tools", "rect": [400, 100, 320, 500]})).unwrap(); + h.app.run("ui.dock", json!({"action": {"SetMinimized": {"panel": "tools", "minimized": true}}})).unwrap(); + h.app.ui.right = RightPanel::Crop; + h.step(); + assert!(!crate::docking::exposed(&h.app, Panel::Tools)); + key(&mut h, "F8", false); + assert_eq!(h.app.ui.right, RightPanel::Crop); + assert!(crate::docking::exposed(&h.app, Panel::Tools), "the window opens"); + } + #[test] fn shift_culling_keys_advance_exactly_once() { use lightcraft_catalog::{ColorLabel, Flag, PhotoId};