tui: show the Computing... progress as a real Modal (was invisible)

The Renderer-overlay approach to the global progress box didn't render. Use a
proper Modal like the palette / file dialog, driven by a plain bool
'computing_open' raised when a source starts and lowered when it ends or
aborts. The tick handler stays ahead of the modal guard, so the script keeps
running (and the screen behind it keeps updating) while the modal is shown;
computing_open is also added to the guard so stray keys are ignored mid-load.
The console screen's own Computing block was already removed, so no duplicate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 19:11:27 +02:00
parent 53eb79c760
commit ac2edd90c4
3 changed files with 19 additions and 15 deletions

View File

@@ -299,6 +299,7 @@ void Tui::Source(const std::string &filename) {
source_origin_screen = screen_idx; // a sourced line that leaves this screen aborts
in_source = true;
loading = true;
computing_open = true; // raise the global "Computing…" progress modal
if (!screen_ptr) {
// Headless fallback (e.g. tests): drain synchronously.
@@ -352,6 +353,7 @@ void Tui::ProcessNextSourceLine() {
+ " is interactive (would open a screen) — aborting.");
screen_idx = source_origin_screen;
loading.store(false);
computing_open = false;
tick_in_flight.store(false);
in_source = loading_prev_in_source;
return;
@@ -364,6 +366,7 @@ void Tui::ProcessNextSourceLine() {
Print("source: " + loading_filename
+ " (" + std::to_string(loading_executed) + " line(s))");
loading.store(false);
computing_open = false;
tick_in_flight.store(false);
in_source = loading_prev_in_source;
}