Workspace has no 'replace image' affordance — once an image is loaded and digitize has run, the user has to start a fresh session to use a different image; no way to swap images in place #229
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#229
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
src/components/workspace/useWorkspace.ts'suploadedImageis set byLOAD_DESIGN(loading a saved design) or by the file dropzone handler (loading from a file). Once set, the only way to clear it is to navigate away and come back.grep -n 'REPLACE_IMAGE\|replaceImage\|clearImage' src/components/workspace/useWorkspace.tsreturns 0 hits. There's no action to swap the loaded image for a different one.A user who:
grep -n 'onDrop\|onDragOver' src/components/workspace/CanvasArea.tsx— let me check the dropzone behavior.Where
src/components/workspace/useWorkspace.ts(set once)grep -n 'REPLACE_IMAGE' src/components/workspace/useWorkspace.tsreturns 0src/components/workspace/CanvasArea.tsx(need to verify if it adds or replaces)src/components/workspace/AppHeader.tsx(the upload button)Suggested fix shape
Add a
REPLACE_IMAGEaction to the workspace reducer:Plumb the action to the file dropzone and the toolbar's upload button:
LOAD_DESIGN(for.pes/.dstfiles) and probably has a separate path for image files. The image-file path should dispatchREPLACE_IMAGEinstead of "add image."The confirmation prevents accidental loss of the user's digitize work.
Severity
Medium. The user can navigate Gallery → Workspace to swap; the in-place replace is a polish improvement.
Discovered by
Gap analysis (2026-10-02) of workspace image affordances.
Related
Shipped in commit
cb25f59onmain.What landed
REPLACE_IMAGEreducer action: takes a freshUploadedImage, resets every artifact derived from the previous image (stitchObjects / colorRegions / threadStops / threadMatches / selectedIds / processingStep / loadedDesignId), preserves designSettings (hoop / fabric / stabilizer aren't image-specific), wrapped in pushHistory so undo round-trips the swap.useWorkspace.handleReplaceImage(file): same MIME/size validation + filename derivation ashandleFileUpload, but dispatchesREPLACE_IMAGEon success. Prompts viawindow.confirmwhen there's derived work (auto-digitize output or drawn regions), matching the editor's #184/#228 unsaved-changes guard pattern.ImageEditToolbar: new Replace button (refresh icon, sits left of the ×). Renders only whenonReplaceis wired.CanvasArea: corner "Replace image" button alongside "Adjust Settings" so the affordance is reachable from thedigitizing/digitizedstates too (the image-edit toolbar only renders inimage-uploaded). Dedicated hidden file input so the OS picker re-opens for same-file re-picks.Tests: 19 new cases in
src/components/workspace/issue-229.test.tsxcovering the reducer semantics, the confirm-prompt branches, the toolbar button, and the CanvasArea wiring. Full repo suite: 1152 passing, 1 skipped (was 1133 → 1152).Why a confirm prompt and not an undo-only solution: the user can always ⌘Z, but
window.confirmmakes the consequence of clicking the new affordance visible before the stitch work is destroyed — the editor's back-nav and Load Design dropdown already use this same shape.