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

Closed
opened 2026-08-29 17:14:42 +01:00 by gronod · 0 comments
Owner

Description

During target measurement in Stage 3 (chartread), when ArgyllCMS encounters a warning (e.g. read strip L instead of A, patch delta / unexpected response warnings, or multi-sheet prompts), the user is unable to accept or override the warning in the UI, and the status prompt remains unchanged or stuck on previous states.

Observed Behavior

  1. When chartread outputs a warning:
    (Warning) Seem to have read strip pass L rather than A!
    Hit Return to use it anyway, any other key to retry, Esc or 'q' to give up:
    
    or:
    (Warning) There is at least one patch with an very unexpected response! (DeltaE 95.2)
    Hit Return to use it anyway, any other key to retry, Esc or 'q' to give up:
    
  2. The UI in ICCery remains stuck on State: AWAITING_STRIP / Ready to read strip pass A because the stdout listener does not parse warning prompts.
  3. The only available action buttons are ↻ Retry Strip (which sends " \n", forcing a rescan), ⏭ Skip Strip, and ✕ Cancel. There is no button to send "\n" (Return) to Accept / Use Anyway.

Root Cause

  1. Missing Accept/Override Button: src/index.html only provides btnRetry (sends " \n"), btnSkip (sends "s\n"), btnCancel, and btnCalibrate. In ArgyllCMS, accepting a warning prompt requires sending "\n" (Return/Enter).
  2. Narrow Regex / Substring Match in chartread.js: chartread.js only checks for narrow keywords (hit any key to continue, reading strip, error) and ignores (Warning), seem to have read strip pass, use it anyway, and multi-sheet prompts (place sheet X of Y on table, then hit return to continue).

Proposed Solution

1. Add btnAccept to Stage 3 Actions (src/index.html)

Add a new action button in .chartread-actions:

<button class="primary hidden" id="btnAccept">✓ Accept Strip</button>

2. Expand State Machine in src/js/chartread.js

Introduce new states:

  • STATE.WARNING: When a warning/override prompt is detected.
    • Displays the full warning message in #chartreadPrompt.
    • Shows ✓ Accept Strip (sends "\n" via send_stdin).
    • Shows ↻ Retry Strip (sends " \n" via send_stdin).
    • Shows ✕ Cancel (kills process).
  • STATE.PROMPT_CONTINUE: When multi-sheet prompts appear (place sheet X of Y).
    • Displays sheet change instruction in #chartreadPrompt.
    • Shows ✓ Continue (sends "\n" via send_stdin).
    • Shows ✕ Cancel.

3. Enhance Prompt Parsing (src/js/chartread.js)

  • Match (warning), seem to have read strip pass, use it anyway, and unexpected response to transition to STATE.WARNING.
  • Match place sheet, remove previous sheet, hit return to continue to transition to STATE.PROMPT_CONTINUE.
  • Match ready to read strip pass to clearly update the active row label in #chartreadPrompt.

Acceptance Criteria

  • Warning prompts from chartread (e.g. out-of-order row or high DeltaE) transition UI to a clear warning state with the exact warning message displayed.
  • User can click ✓ Accept Strip to accept the read strip and continue.
  • User can click ↻ Retry Strip to rescan the row.
  • Multi-sheet prompts (place sheet X of Y) allow user to click ✓ Continue to proceed to the next sheet.
### Description During target measurement in Stage 3 (`chartread`), when ArgyllCMS encounters a warning (e.g. read strip L instead of A, patch delta / unexpected response warnings, or multi-sheet prompts), the user is unable to accept or override the warning in the UI, and the status prompt remains unchanged or stuck on previous states. ### Observed Behavior 1. When `chartread` outputs a warning: ```text (Warning) Seem to have read strip pass L rather than A! Hit Return to use it anyway, any other key to retry, Esc or 'q' to give up: ``` or: ```text (Warning) There is at least one patch with an very unexpected response! (DeltaE 95.2) Hit Return to use it anyway, any other key to retry, Esc or 'q' to give up: ``` 2. The UI in ICCery remains stuck on `State: AWAITING_STRIP` / `Ready to read strip pass A` because the stdout listener does not parse warning prompts. 3. The only available action buttons are `↻ Retry Strip` (which sends `" \n"`, forcing a rescan), `⏭ Skip Strip`, and `✕ Cancel`. There is no button to send `"\n"` (Return) to **Accept / Use Anyway**. ### Root Cause 1. **Missing Accept/Override Button**: `src/index.html` only provides `btnRetry` (sends `" \n"`), `btnSkip` (sends `"s\n"`), `btnCancel`, and `btnCalibrate`. In ArgyllCMS, accepting a warning prompt requires sending `"\n"` (Return/Enter). 2. **Narrow Regex / Substring Match in `chartread.js`**: `chartread.js` only checks for narrow keywords (`hit any key to continue`, `reading strip`, `error`) and ignores `(Warning)`, `seem to have read strip pass`, `use it anyway`, and multi-sheet prompts (`place sheet X of Y on table, then hit return to continue`). --- ### Proposed Solution #### 1. Add `btnAccept` to Stage 3 Actions (`src/index.html`) Add a new action button in `.chartread-actions`: ```html <button class="primary hidden" id="btnAccept">✓ Accept Strip</button> ``` #### 2. Expand State Machine in `src/js/chartread.js` Introduce new states: * `STATE.WARNING`: When a warning/override prompt is detected. * Displays the full warning message in `#chartreadPrompt`. * Shows **`✓ Accept Strip`** (sends `"\n"` via `send_stdin`). * Shows **`↻ Retry Strip`** (sends `" \n"` via `send_stdin`). * Shows **`✕ Cancel`** (kills process). * `STATE.PROMPT_CONTINUE`: When multi-sheet prompts appear (`place sheet X of Y`). * Displays sheet change instruction in `#chartreadPrompt`. * Shows **`✓ Continue`** (sends `"\n"` via `send_stdin`). * Shows **`✕ Cancel`**. #### 3. Enhance Prompt Parsing (`src/js/chartread.js`) * Match `(warning)`, `seem to have read strip pass`, `use it anyway`, and `unexpected response` to transition to `STATE.WARNING`. * Match `place sheet`, `remove previous sheet`, `hit return to continue` to transition to `STATE.PROMPT_CONTINUE`. * Match `ready to read strip pass` to clearly update the active row label in `#chartreadPrompt`. --- ### Acceptance Criteria - [ ] Warning prompts from `chartread` (e.g. out-of-order row or high DeltaE) transition UI to a clear warning state with the exact warning message displayed. - [ ] User can click **`✓ Accept Strip`** to accept the read strip and continue. - [ ] User can click **`↻ Retry Strip`** to rescan the row. - [ ] Multi-sheet prompts (`place sheet X of Y`) allow user to click **`✓ Continue`** to proceed to the next sheet.
Sign in to join this conversation.