Workspace canvas: split-view toggle (Image/Stitches/Both) renders identical output when one layer is empty #54

Closed
opened 2026-09-02 01:51:15 +00:00 by Mark · 0 comments
Owner

Bug

In the Workspace canvas (src/components/workspace/CanvasArea.tsx), the split-view toggle buttons (Image / Stitches / Both) all produce visually identical output when one of the two layers has no data to draw. Toggling between them gives the user no feedback that anything happened.

Reproduction

  1. Open Workspace at http://127.0.0.1:5173/workspace in digitized state with no actual uploaded image (or with colorRegions/stitchObjects empty).
  2. Click the Image button — canvas updates.
  3. Click the Stitches button — canvas updates.
  4. Click the Both button — canvas updates slightly.
  5. Compare the three screenshots.

Observed

  • Image-only and Stitches-only screenshots are byte-identical PNGs (sha256 962d1273351db54d for both, observed 2026-09-01).
  • "Both" differs by only 699 pixels (~0.1% of canvas). It just darkens the image at alpha=0.4.
  • Pixel sampling shows ~67.6% of the canvas is linen background, no photo variation. The user has no way to know whether their toggle click did anything.

Root cause

src/components/workspace/canvasRenderer.ts lines 99 and 104:

if (uploadedImage && (... || splitView === 'image' || splitView === 'both')) {
  drawUploadedImage(...)
}

if ((appState === 'digitizing' || appState === 'digitized') && (splitView === 'stitches' || splitView === 'both')) {
  ... drawColorRegions(...) or drawStitchObjects(...)
}

When uploadedImage is null, the image branch silently draws nothing. When colorRegions/stitchObjects are empty, the stitches branch silently draws nothing. The toggle buttons give no visual indication that one of the layers is empty.

Expected

When one of the two layers has no data, the corresponding split-view button should be visually disabled (greyed out, non-clickable), and the canvas should show an empty-state placeholder for that layer ("No image uploaded" / "No stitches generated"). Currently the user has no way to distinguish "I toggled correctly" from "the toggle is broken."

Severity

Medium. Affects every Workspace session where the user reaches the post-digitize state without an image, or where the digitize produced empty regions.

## Bug In the Workspace canvas (`src/components/workspace/CanvasArea.tsx`), the split-view toggle buttons (Image / Stitches / Both) all produce visually identical output when one of the two layers has no data to draw. Toggling between them gives the user no feedback that anything happened. ## Reproduction 1. Open Workspace at http://127.0.0.1:5173/workspace in `digitized` state with no actual uploaded image (or with `colorRegions`/`stitchObjects` empty). 2. Click the **Image** button — canvas updates. 3. Click the **Stitches** button — canvas updates. 4. Click the **Both** button — canvas updates slightly. 5. Compare the three screenshots. ## Observed - Image-only and Stitches-only screenshots are **byte-identical** PNGs (sha256 `962d1273351db54d` for both, observed 2026-09-01). - "Both" differs by only 699 pixels (~0.1% of canvas). It just darkens the image at alpha=0.4. - Pixel sampling shows ~67.6% of the canvas is linen background, no photo variation. The user has no way to know whether their toggle click did anything. ## Root cause `src/components/workspace/canvasRenderer.ts` lines 99 and 104: ```ts if (uploadedImage && (... || splitView === 'image' || splitView === 'both')) { drawUploadedImage(...) } if ((appState === 'digitizing' || appState === 'digitized') && (splitView === 'stitches' || splitView === 'both')) { ... drawColorRegions(...) or drawStitchObjects(...) } ``` When `uploadedImage` is null, the image branch silently draws nothing. When `colorRegions`/`stitchObjects` are empty, the stitches branch silently draws nothing. The toggle buttons give no visual indication that one of the layers is empty. ## Expected When one of the two layers has no data, the corresponding split-view button should be visually disabled (greyed out, non-clickable), and the canvas should show an empty-state placeholder for that layer ("No image uploaded" / "No stitches generated"). Currently the user has no way to distinguish "I toggled correctly" from "the toggle is broken." ## Severity Medium. Affects every Workspace session where the user reaches the post-digitize state without an image, or where the digitize produced empty regions.
Mark 2026-09-05 07:52:43 +00:00
Sign in to join this conversation.
No description provided.