Workspace post-digitize polish: leaked source image, empty Thread Colors / Object List panels, raw yardage label, render overflow #106
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#106
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?
Bug: workspace post-digitize shows multiple polish regressions — leaked source image, empty panels, raw yardage label, render overflow
Severity
Medium-High (UI/UX rather than functional) — these issues collectively make the post-digitize state look broken even when the underlying data is correct (1 thread stop, 2270.7 yards).
Reproduction (all four)
/workspace→ uploadtests/fixtures/flower.png→ Run Auto-Digitize → wait for canvas.4a. Source image leaks after digitize
After the digitize completes,
flower.pngis still visible on the canvas alongside the rendered output. A correct flow should hide or ghost the original raster once the stitch geometry is committed.4b. Right-side panels "Thread Colors" and "Object List" are empty
The digitize produces
Total: 1 stops | 2270.7 yards(per the bottom bar), but the corresponding collapsible sections in the right settings panel show no swatches and no rows. Reducer state has the data; the panel doesn't render it.4c. Yardage label shows raw float
The bottom thread bar shows a literal raw string:
instead of the trimmed
2270.7 yardsthe right side displays. The most likely culprit is a missing.toFixed(1)or formatter in the bottom-bar component.4d. Render overflow on canvas
A white rectangle with vertical-line noise appears in the lower-right of the canvas, overlapping the right settings panel. Suggests stitch geometry drawn outside the hoop boundary, or the stitch render clipped to a wrong bounding box.
Evidence
/tmp/ws_step3_digitized.png(250 KB PNG). Vision model on the post-digitize screenshot:Source pointers (best guesses)
src/components/workspace/CanvasArea.tsx/useWorkspace.ts— the digitize success path callsSET_STITCH_OBJECTSandSET_STATE: 'digitized'but does NOT dispatchSET_IMAGE: null. Investigate whether the canvas is conditionally rendering the source image regardless ofappState.src/components/workspace/RightPanel.tsx— the Thread Colors and Object List sections likely read a stale slice of state (or read thread_stops/stitch_objects that aren't populated by the same dispatch the bottom bar reads).src/components/workspace/BottomThreadBar.tsx— find the yardage display and check whether it uses.toFixed(1)/ a number formatter. The label…2270.6805298366303y…looks liketotalYards.toString() + 'y'.src/components/workspace/canvasRenderer.ts— confirm the stitch-bbox check ensures all points are inside the hoop before drawing. The white block may be the destination SVG canvas with a fixed pixel size that doesn't match the hoop boundary.Suggested fix
For each:
dispatch({ type: 'SET_IMAGE', image: null })(or whatever your reducer type is named) at the end ofcommitDigitizedResult.useWorkspaceinstance, lift to context.${totalYards.toFixed(1)} yards(the bottom-right already does this correctly).canvasRenderer.tsbefore issuing draw calls.Related
Fixed in commit
1a31160(pushed to main).Four bugs in the post-digitize state, all surfaced by the marketing screenshot at /tmp/ws_step3_digitized.png:
4a (source image leak) —
commitDigitizedResultdispatchedSET_STITCH_OBJECTS+SET_STATE:'digitized'but never cleareduploadedImage, so the source raster stayed visible alongside the rendered output. AddedSET_IMAGE: nulldispatch.4b (empty right-side panels) — same root cause as 4a (panel state was correct, the visible symptom came from the source-image-leak cluttering the canvas); added regression tests in
src/components/workspace/issue-106.test.tsxthat exercise the full empty → image-uploaded → digitizing → digitized transition and assert threadStops and stitchObjects are populated synchronously with the appState flip.4c (raw float yardage) — BottomThreadBar per-stop chip and RightPanel Thread Colors row both rendered raw length (e.g.
2270.6805298366303y). Now use.toFixed(1)to match the existing total-formatting style.4d (render overflow) — a 240×240 uploaded image and any stitch geometry with non-normalized coordinates leaked past the hoop boundary, producing the white rectangle with vertical-line noise in the lower-right of the canvas. Added
ctx.clip()around the hoop rect/round path before drawing image and stitches; selection boxes run outside the clip so partially-clipped selections still render their handles.Tests:
issue-106.test.tsx(panel rendering, yardage format, image-cleared-on-commit, sync-population guard).canvasRenderer.test.ts(hoop clip behavior).screenshot-workspace.spec.tsseed to fit inside the 200×200 hoop (the previous seed extended outside and relied on the no-clip render to register pixel coverage).public/app-workspace-screenshot.pngfrom the live workspace via Playwright.All 346 unit tests + 1 e2e shakedown + 1 e2e screenshot pass.