From 60c00eb914aa9102d39d00013fef54c062fb305a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Wed, 3 Jun 2026 18:44:41 +0200 Subject: [PATCH] dashboard: o/s shortcuts to open a script and save via a file dialog Two new dashboard keys, mirroring the existing x=export: 'o' opens a file picker to run a .essim script (-> source ), 's' opens a file picker to write a system snapshot (-> save , only when a system is loaded). Both use OpenFileDialog with a per-key persisted last directory; the global CatchEvent already yields to the file-dialog modal while it is open. Dashboard help hints updated. Co-Authored-By: Claude Opus 4.8 --- src/tui/screen_dashboard.cpp | 2 ++ src/tui/tui.cpp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/tui/screen_dashboard.cpp b/src/tui/screen_dashboard.cpp index 4c65a8c..f026128 100644 --- a/src/tui/screen_dashboard.cpp +++ b/src/tui/screen_dashboard.cpp @@ -309,6 +309,8 @@ Component Tui::BuildDashboardScreen() { {"a", "analyze (verify + groups)"}, {"h", "help screen"}, {"x", "export"}, + {"o", "open/run a script"}, + {"s", "save system"}, {"PgUp", "scroll up"}, {"PgDn", "scroll down"}, {"Home", "scroll top"}, diff --git a/src/tui/tui.cpp b/src/tui/tui.cpp index c8e130e..4fabcec 100644 --- a/src/tui/tui.cpp +++ b/src/tui/tui.cpp @@ -101,6 +101,23 @@ void Tui::Run() { if (e == Event::Character("a")) { screen_idx = 5; return true; } if (e == Event::Character("h")) { screen_idx = 6; return true; } if (e == Event::Character("x")) { Dispatch("export"); return true; } + if (e == Event::Character("o")) { // open / run a script + OpenFileDialog("Open script — run a .essim file", + "dashboard.source", "", {}, + [this](const std::string &path) { + Dispatch("source " + path); + }); + return true; + } + if (e == Event::Character("s")) { // save the system snapshot + if (sys) + OpenFileDialog("Save system snapshot", + "dashboard.save", "system.essim", {}, + [this](const std::string &path) { + Dispatch("save " + path); + }); + return true; + } return false; case 3: // explore