feat(chartread): Add Accept/Override button and improve prompt handling for warnings and multi-sheet reads (resolves #137) #138

Merged
gronod merged 1 commits from feat/137-chartread-accept-override-prompts into development 2026-08-29 17:22:56 +01:00
Owner

Resolves #137

Summary of Changes

  1. Added btnAccept in Stage 3 (src/index.html):

    • Added <button class="primary hidden" id="btnAccept">✓ Accept Strip</button> inside .chartread-actions.
  2. Expanded State Machine (src/js/chartread.js):

    • Added STATE.WARNING and STATE.PROMPT_CONTINUE.
    • Updated setState(newState):
      • STATE.WARNING: displays ✓ Accept Strip (sends \n), ↻ Retry Strip (sends \n), and ✕ Cancel.
      • STATE.PROMPT_CONTINUE: displays ✓ Continue (sends \n) and ✕ Cancel.
    • Wired click event listener on btnAccept to send newline ("\n") via send_stdin.
  3. Enhanced Stdout Parsing (src/js/chartread.js):

    • Matches Argyll warning prompts ((warning), seem to have read strip pass, use it anyway, unexpected response, hit return to use it anyway) to transition to STATE.WARNING.
    • Preserves multi-line context when warning explanations and continuation prompts are emitted sequentially.
    • Matches multi-sheet prompts (place sheet, remove previous sheet, hit return to continue) to transition to STATE.PROMPT_CONTINUE.
  4. Preserved Multi-Line Prompt Formatting (src/styles/main.css):

    • Added white-space: pre-line to .status-prompt.
Resolves #137 ### Summary of Changes 1. **Added `btnAccept` in Stage 3 (`src/index.html`)**: - Added `<button class="primary hidden" id="btnAccept">✓ Accept Strip</button>` inside `.chartread-actions`. 2. **Expanded State Machine (`src/js/chartread.js`)**: - Added `STATE.WARNING` and `STATE.PROMPT_CONTINUE`. - Updated `setState(newState)`: - `STATE.WARNING`: displays `✓ Accept Strip` (sends `\n`), `↻ Retry Strip` (sends ` \n`), and `✕ Cancel`. - `STATE.PROMPT_CONTINUE`: displays `✓ Continue` (sends `\n`) and `✕ Cancel`. - Wired click event listener on `btnAccept` to send newline (`"\n"`) via `send_stdin`. 3. **Enhanced Stdout Parsing (`src/js/chartread.js`)**: - Matches Argyll warning prompts (`(warning)`, `seem to have read strip pass`, `use it anyway`, `unexpected response`, `hit return to use it anyway`) to transition to `STATE.WARNING`. - Preserves multi-line context when warning explanations and continuation prompts are emitted sequentially. - Matches multi-sheet prompts (`place sheet`, `remove previous sheet`, `hit return to continue`) to transition to `STATE.PROMPT_CONTINUE`. 4. **Preserved Multi-Line Prompt Formatting (`src/styles/main.css`)**: - Added `white-space: pre-line` to `.status-prompt`.
gronod added 1 commit 2026-08-29 17:22:03 +01:00
gronod merged commit f6b27aa108 into development 2026-08-29 17:22:56 +01:00
Sign in to join this conversation.