From dc26fa507016bfd923d600fcf04e4f77c1e85b51 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Thu, 25 Jun 2026 00:36:38 +0200 Subject: [PATCH] Add Pause to the browser client's Sud controls Mirrors client/brewpi_gui.py's actionPause: btn-sud-pause sends {"Sud": {"Pause": true}} and is only enabled while actually running (not idle, not already paused), matching update_sud_actions()'s enabled/disabled logic - Start already doubles as Resume while paused, so no separate Resume control is needed. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_0189FkmyJkY77HqsNomr1DwV --- README.md | 7 +++---- web/TODO.md | 12 ++++++------ web/app.js | 4 ++++ web/index.html | 1 + 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index aea8d68..5db79ae 100644 --- a/README.md +++ b/README.md @@ -540,11 +540,10 @@ unresolved - every step still needs `default.step` merged in), and the `StepPlate`/`_update_step_plates()`/`update_status_step_label()` logic behind the Progress tab and status line. New/Load/Save (a plain ``/`FileReader` and a `Blob`/`` standing in -for the desktop app's native file dialogs), Start/Stop, and Confirm (a -plain `` pops with the step's message on `WAIT_USER` and sends +for the desktop app's native file dialogs), Start/Pause/Stop, and Confirm +(a plain `` pops with the step's message on `WAIT_USER` and sends Confirm when dismissed) are all wired up too - see `web/TODO.md` for -what's still missing (Pause, and more). Deliberately deferred rather than -stubbed: the +what's still missing. Deliberately deferred rather than stubbed: the Automatic tab's forecast-vs-actual plot and the live Plot tab's strip charts - both need a charting approach, revisit once Manual + Progress are validated. diff --git a/web/TODO.md b/web/TODO.md index 66acb5e..4466156 100644 --- a/web/TODO.md +++ b/web/TODO.md @@ -7,12 +7,12 @@ flagged as deferred in the plan, or only noticed once the port was done and checked against the Qt source side by side. - [x] **No way to actually run a brew.** ~~There's no Start/Pause/Stop/ - Confirm anywhere in `web/index.html`~~ Start/Stop/Confirm are now wired - up (`btn-sud-start`/`btn-sud-stop` in `app.js`, gated by - `updateSudActions()` mirroring `update_sud_actions()`'s - enabled/disabled logic; Confirm via the `#sud-message-dialog` below). - Still missing: Pause - trivial to add the same way as Start/Stop - whenever it's actually needed. + Confirm anywhere in `web/index.html`~~ Start/Pause/Stop/Confirm are all + wired up (`btn-sud-start`/`btn-sud-pause`/`btn-sud-stop` in `app.js`, + gated by `updateSudActions()` mirroring `update_sud_actions()`'s + enabled/disabled logic - Pause only enabled while actually running, + same as the desktop client's `actionPause`; Confirm via the + `#sud-message-dialog` below). - [x] **`WAIT_USER` never surfaces to the user.** `showUserMessage()` pops `#sud-message-dialog` (a plain ``, no library) the instant diff --git a/web/app.js b/web/app.js index 33524c3..4b729ae 100644 --- a/web/app.js +++ b/web/app.js @@ -304,6 +304,7 @@ function updateSudActions() { const running = canRun && RUNNING_STATES.has(sudState); const paused = canRun && sudState === PAUSED_STATE; document.getElementById('btn-sud-start').disabled = !(canRun && !running); + document.getElementById('btn-sud-pause').disabled = !running; document.getElementById('btn-sud-stop').disabled = !(running || paused); } @@ -671,6 +672,9 @@ document.getElementById('btn-sud-save').addEventListener('click', () => { document.getElementById('btn-sud-start').addEventListener('click', () => { sendMsg('Sud', {Start: true}); }); +document.getElementById('btn-sud-pause').addEventListener('click', () => { + sendMsg('Sud', {Pause: true}); +}); document.getElementById('btn-sud-stop').addEventListener('click', () => { sendMsg('Sud', {Stop: true}); }); diff --git a/web/index.html b/web/index.html index 0176770..8161e8b 100644 --- a/web/index.html +++ b/web/index.html @@ -17,6 +17,7 @@ +