View toggles and Confirm/Reject controls hidden after digitize auto-advance (#28 regression) #43

Closed
opened 2026-07-26 15:14:02 +00:00 by Mark · 0 comments
Owner

Bug — Image/Stitches/Both view toggles and Accept/Reject controls hidden after #28 auto-advance

Severity: P2 (UX — digitize completes but user can't switch view or confirm/reject)

Root cause: #28 fix (8da6c17) auto-advances appState to 'digitized' on digitize success. But the view toggles (Image/Stitches/Both) and Accept/Reject controls (Adjust Settings / Confirm & Edit) are rendered inside {appState === 'digitizing' && (...)} at CanvasArea.tsx line 353. When appState advances to 'digitized', the outer AnimatePresence guard unmounts these controls before they ever render.

The inner conditions (processingStep >= 4 at line 421 and 454) are correct — they gate on the right step. But they're nested inside a parent that checks for appState === 'digitizing'. The #28 fix dispatches SET_STATE('digitized') right after SET_PROCESSING(step 4), so processingStep is 4 but appState is no longer 'digitizing'.

Repro (verified live, 2026-07-24):

  1. Upload any SVG
  2. Click Auto-Digitize FAB
  3. Digitize succeeds — toast shows "Auto-digitize complete"
  4. Bottom bar shows "Total: X stops | X.X yards"
  5. Right panel shows Stitch Parameters, Thread Colors, Object List
  6. But Image/Stitches/Both toggle and Adjust Settings/Confirm & Edit buttons never appear
  7. DOM tree walker confirms zero elements with text "Image", "Stitches", or "Both"

Expected: View toggles and controls should be visible when appState === 'digitized' as well as appState === 'digitizing'.

Fix: Change line 353 from {appState === 'digitizing' && ( to {(appState === 'digitizing' || appState === 'digitized') && (}. Or restructure to move the toggle/reject blocks outside the AnimatePresence and gate on appState !== 'image-uploaded'.

Related: #28 introduced this regression.

## Bug — Image/Stitches/Both view toggles and Accept/Reject controls hidden after #28 auto-advance **Severity**: P2 (UX — digitize completes but user can't switch view or confirm/reject) **Root cause**: #28 fix (`8da6c17`) auto-advances `appState` to `'digitized'` on digitize success. But the view toggles (Image/Stitches/Both) and Accept/Reject controls (Adjust Settings / Confirm & Edit) are rendered inside `{appState === 'digitizing' && (...)}` at CanvasArea.tsx line 353. When appState advances to `'digitized'`, the outer AnimatePresence guard unmounts these controls before they ever render. The inner conditions (`processingStep >= 4` at line 421 and 454) are correct — they gate on the right step. But they're nested inside a parent that checks for `appState === 'digitizing'`. The #28 fix dispatches `SET_STATE('digitized')` right after `SET_PROCESSING(step 4)`, so processingStep is 4 but appState is no longer 'digitizing'. **Repro** (verified live, 2026-07-24): 1. Upload any SVG 2. Click Auto-Digitize FAB 3. Digitize succeeds — toast shows "Auto-digitize complete" 4. Bottom bar shows "Total: X stops | X.X yards" 5. Right panel shows Stitch Parameters, Thread Colors, Object List 6. **But Image/Stitches/Both toggle and Adjust Settings/Confirm & Edit buttons never appear** 7. DOM tree walker confirms zero elements with text "Image", "Stitches", or "Both" **Expected**: View toggles and controls should be visible when `appState === 'digitized'` as well as `appState === 'digitizing'`. **Fix**: Change line 353 from `{appState === 'digitizing' && (` to `{(appState === 'digitizing' || appState === 'digitized') && (`}. Or restructure to move the toggle/reject blocks outside the AnimatePresence and gate on `appState !== 'image-uploaded'`. **Related**: #28 introduced this regression.
Mark 2026-07-31 04:56:28 +00:00
Sign in to join this conversation.
No description provided.