bug : Stage 3 cannot complete #175

Closed
opened 2026-09-02 00:19:28 +01:00 by gronod · 3 comments
Owner

After measuring the target, chartread expects "d" to denote done before saving the .ti3 and allowing to move to step 4, however it is never signalled that scanning is complete.

After measuring the target, chartread expects "d" to denote done before saving the .ti3 and allowing to move to step 4, however it is never signalled that scanning is complete.
gronod added the Kind/Bug
Reviewed
Confirmed
1
Priority
Critical
1
labels 2026-09-02 00:19:29 +01:00
Author
Owner

Detailed Diagnosis & Technical Findings

1. Root Cause

ArgyllCMS chartread operates an interactive terminal loop where:

  • After reading each strip, or once all strips/patches in a target sheet are measured, chartread prompts:
    Ready to read strip X (or 'd' if done, 's' to skip, 'u' to undo): or Hit 'd' when done:
  • chartread deliberately blocks on standard input (stdin) waiting for the user to send the character 'd' to serialize and write the canonical .ti3 measurement file to disk and exit with code 0.
  • In ICCery's Stage 3 UI (src/index.html & src/js/chartread.js), the only available action buttons were:
    • ✓ Calibrate (" \n")
    • ✓ Accept Strip ("\n")
    • ↻ Retry Strip (" \n")
    • ⏭ Skip Strip ("s\n")
    • ✕ Cancel (process kill)
  • There was no Done / Save button sending "d\n", and no detection mechanism for the completion prompt. Because "d\n" was never sent to chartread's stdin:
    1. chartread remained blocked indefinitely waiting for input.
    2. The process never exited with code 0.
    3. process:exit never triggered snapshot_ti3.
    4. Stage 4 remained locked.

2. Proposed Solution

  1. Add Done & Save .ti3 Action Button (#btnDoneRead):
    • Add a primary button in src/index.html that invokes send_stdin({ id: currentProcessId, input: "d\n" }).
  2. Add Undo Last Strip Action Button (#btnUndo):
    • Add an undo button sending "u\n" to allow rescanning the previous strip if misread.
  3. Add Completion State & Visual Guidance:
    • In src/js/chartread.js and src/js/swatch_grid.js, detect when row_index + 1 === total_rows or when stdout matches completion tokens ('d' if done, 'd' when done, all strips read, all patches read, etc.).
    • Transition state to ALL_STRIPS_READ and display a clear prompt: "🎉 All strips measured! Click 'Done & Save .ti3' to write measurements and advance."
    • Ensure #btnDoneRead is also accessible in AWAITING_STRIP so users can finish anytime.
### Detailed Diagnosis & Technical Findings #### 1. Root Cause ArgyllCMS `chartread` operates an interactive terminal loop where: - After reading each strip, or once all strips/patches in a target sheet are measured, `chartread` prompts: `Ready to read strip X (or 'd' if done, 's' to skip, 'u' to undo):` or `Hit 'd' when done:` - `chartread` deliberately **blocks on standard input (`stdin`)** waiting for the user to send the character `'d'` to serialize and write the canonical `.ti3` measurement file to disk and exit with code 0. - In ICCery's Stage 3 UI (`src/index.html` & `src/js/chartread.js`), the only available action buttons were: - `✓ Calibrate` (`" \n"`) - `✓ Accept Strip` (`"\n"`) - `↻ Retry Strip` (`" \n"`) - `⏭ Skip Strip` (`"s\n"`) - `✕ Cancel` (process kill) - **There was no `Done / Save` button sending `"d\n"`, and no detection mechanism for the completion prompt.** Because `"d\n"` was never sent to `chartread`'s stdin: 1. `chartread` remained blocked indefinitely waiting for input. 2. The process never exited with code 0. 3. `process:exit` never triggered `snapshot_ti3`. 4. Stage 4 remained locked. #### 2. Proposed Solution 1. **Add `Done & Save .ti3` Action Button (`#btnDoneRead`)**: - Add a primary button in `src/index.html` that invokes `send_stdin({ id: currentProcessId, input: "d\n" })`. 2. **Add `Undo Last Strip` Action Button (`#btnUndo`)**: - Add an undo button sending `"u\n"` to allow rescanning the previous strip if misread. 3. **Add Completion State & Visual Guidance**: - In `src/js/chartread.js` and `src/js/swatch_grid.js`, detect when `row_index + 1 === total_rows` or when stdout matches completion tokens (`'d' if done`, `'d' when done`, `all strips read`, `all patches read`, etc.). - Transition state to `ALL_STRIPS_READ` and display a clear prompt: `"🎉 All strips measured! Click 'Done & Save .ti3' to write measurements and advance."` - Ensure `#btnDoneRead` is also accessible in `AWAITING_STRIP` so users can finish anytime.
Author
Owner

Not resolved - error Measurement finished but pass snapshot failed: invalid args passIndex for command snapshot_ti3: command snapshot_ti3 missing required key passIndex when clicking done.

Not resolved - error Measurement finished but pass snapshot failed: invalid args `passIndex` for command `snapshot_ti3`: command snapshot_ti3 missing required key passIndex when clicking done.
gronod reopened this issue 2026-09-02 00:35:13 +01:00
Author
Owner

Fix Applied: IPC Argument Key Correction (v0.6.8)

  • Cause: Tauri v2 automatically expects camelCase argument names when invoking Rust commands (snapshot_ti3(cwd, basename, pass_index) maps to { cwd, basename, passIndex }). Passing pass_index in JS caused Tauri's deserializer to fail with missing required key passIndex.
  • Resolution: Updated src/js/chartread.js line 449 to pass passIndex: passIndex.
  • Published as point release v0.6.8.
### Fix Applied: IPC Argument Key Correction (`v0.6.8`) - **Cause**: Tauri v2 automatically expects camelCase argument names when invoking Rust commands (`snapshot_ti3(cwd, basename, pass_index)` maps to `{ cwd, basename, passIndex }`). Passing `pass_index` in JS caused Tauri's deserializer to fail with `missing required key passIndex`. - **Resolution**: Updated `src/js/chartread.js` line 449 to pass `passIndex: passIndex`. - Published as point release **[`v0.6.8`](https://git.i3omb.com/gronod/ICCery/releases/tag/v0.6.8)**.
Sign in to join this conversation.