From 8a128b3859b8f398e162d3168ff328ab3199d307 Mon Sep 17 00:00:00 2001 From: historia Date: Sat, 29 Aug 2026 03:10:58 -0400 Subject: remove: pointless success flashes in tui for downloads --- app/tests/test_hub.py | 5 ++--- app/ui/hub.py | 29 +++++++++++++---------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/app/tests/test_hub.py b/app/tests/test_hub.py index 86dd9e3..39b8c5a 100644 --- a/app/tests/test_hub.py +++ b/app/tests/test_hub.py @@ -2978,8 +2978,7 @@ class ConfigureBackendsDispatchTests(unittest.TestCase): steps[0].work(emit, None) mk_install.assert_called_once_with( checkout, guidance, emit=emit, cancel=None) - self.assertEqual(len(flashes), 1) - self.assertEqual(flashes[0][1], "ok") + self.assertEqual(flashes, []) def test_download_models_action_flashes_error_when_no_checkout(self): patch_flash, flashes = self._capture_flashes() @@ -3034,7 +3033,7 @@ class ConfigureBackendsDispatchTests(unittest.TestCase): pass steps[1].work(emit, "CANCEL") self.assertEqual(calls, [("qwen", emit, "CANCEL")]) - self.assertEqual(flashes[-1][1], "ok") + self.assertEqual(flashes, []) def test_update_backends_action_flashes_error_when_something_failed(self): infos = [BackendInfo("qwen", "qwen-tts", lambda: None, lambda: 0, diff --git a/app/ui/hub.py b/app/ui/hub.py index 74b582f..24c779f 100644 --- a/app/ui/hub.py +++ b/app/ui/hub.py @@ -649,10 +649,12 @@ def _download_models_action(stdscr) -> None: Computes the missing models; when they map to install commands it runs the downloads in the task view (with real byte progress and cancellation) - and flashes a result — instead of dropping to the console. When the - checkout/server.json is missing, nothing is missing, or the models do not - map to an install command, it flashes an explanatory notice (the latter - explaining how to install each model by hand). + instead of dropping to the console — a successful run returns silently + (the view already shows [OK] and waits for a key), and only a cancelled + or failed run flashes. When the checkout/server.json is missing, nothing + is missing, or the models do not map to an install command, it flashes + an explanatory notice (the latter explaining how to install each model + by hand). """ checkout = audiocpp_backend.find_local_checkout() if checkout is None: @@ -683,13 +685,10 @@ def _download_models_action(stdscr) -> None: rc = taskview.run_steps(stdscr, "Download models", [taskview.TaskStep("Download missing models", run)]) - if rc == 0: - tui.flash(stdscr, "Model download finished. Any warnings were shown " - "in the log.", "ok") - elif rc == 130: + if rc == 130: tui.flash(stdscr, "Model download cancelled — re-run it any time.", "warn") - else: + elif rc: tui.flash(stdscr, "Some model downloads failed. Re-run 'Download " "Missing Models' or install them by hand (see the log).", "err") @@ -704,8 +703,9 @@ def _update_backends_action(stdscr) -> None: git fetch + hard reset for the checkouts, with audio.cpp's binary rebuilt when its checkout moved. A failing backend's step is marked [FAIL] and the remaining backends still update (the run's exit code - is the first failure). A flash summarizes the result; the status - table re-detects when the menu re-shows. + is the first failure). A successful run returns silently (the view + already shows [OK] and waits for a key); only a cancelled or failed + run flashes. The status table re-detects when the menu re-shows. """ statuses = detect_all() by_key = {st.key: st for st in statuses} @@ -722,13 +722,10 @@ def _update_backends_action(stdscr) -> None: steps = [taskview.TaskStep(f"Update {info.label}", make_work(info)) for info in targets] rc = taskview.run_steps(stdscr, "Update Backends", steps) - if rc == 0: - tui.flash(stdscr, "Every backend is up to date (or just " - "updated).", "ok") - elif rc == 130: + if rc == 130: tui.flash(stdscr, "Update cancelled — re-run 'Update Backends' " "any time.", "warn") - else: + elif rc: tui.flash(stdscr, "Some updates did not complete (failed or " "cancelled) — see the log above. Re-run 'Update " "Backends' to retry.", "err") -- cgit v1.2.3