tatami_fill stitch type is collapsed to fill and original type is lost in export — digitize-adapters.ts:222 comment promises originalServiceStitchType but it's never set anywhere #157
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#157
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
mapServiceStitchTypeToWorkspaceatsrc/lib/digitize-adapters.ts:160-175collapsestatami_fill→fillfor the workspace's stitch type model. The comment at line 222 promises: "The caller can useoriginalServiceStitchType(stamped on the path) to recover the source type at export time."originalServiceStitchTypeis never set anywhere in the codebase.grep -rn 'originalServiceStitchType' src/returns 1 hit: the comment indigitize-adapters.ts:222. NoWorkspaceStitchObjectfield is set; no adapter writes it; no consumer reads it.When the user exports a design that originally had tatami-fill regions from the service, the export sees the workspace's
filltype and writes a regular fill stitch pattern. The original tatami differentiation is lost.For PES specifically, the difference is real: tatami fill is a multi-direction fill pattern that minimizes the "pull" effect on stretchy fabrics; a regular fill is single-direction. The export's choice between them affects the stitched result.
Where
src/lib/digitize-adapters.ts:160-175src/lib/digitize-adapters.ts:222src/lib/stitch-adapters.ts:toServiceStitchObjectsSuggested fix shape
Two changes:
Stamp the original type on the workspace's StitchObject. Extend the
StitchObjecttype insrc/components/workspace/types.tswith an optionaloriginalStitchType?: "satin" | "fill" | "running" | "tatami_fill" | "jump". InfromServiceStitchObjectatsrc/lib/digitize-adapters.ts:118-150, setoriginalStitchType: obj.typewhenever the type is folded. The user can then see the original in the Editor's right panel ("This path was originally tatami_fill, currently rendered as fill").Honor the original type at export. In
toServiceStitchObjectsatsrc/lib/stitch-adapters.ts, ifobj.originalStitchTypeis set, prefer it over the workspace'stypewhen sending to the service. The export will then correctly preserve the tatami distinction.Severity
Medium. The Help page documents "tatami_fill" as a real service stitch type (per #130's documentation), but the export silently drops it. The user's design loses fidelity.
Discovered by
Gap analysis (2026-10-02) of stitch type handling.
Related
jumpregions. Same family; the engine's stitch-type fidelity is a related concern.Fixed in commit
30e0dafonmain(Mark/Kimi_Agent_Brother_10_Digitizing_App@30e0daf).Implementation:
StitchObjectextended with optionaloriginalStitchType?: ServiceStitchType(src/components/workspace/types.ts).fromServiceStitchObjectnow stampsoriginalStitchType: obj.typeon every import (#157).toServiceStitchObjectsprefersoriginalStitchTypeoverTYPE_MAPwhen set and non-jump, so a tatami design round-trips through the editor and exports as tatami_fill.mapServiceStitchTypeToWorkspaceupdated (the originaloriginalServiceStitchTypepromise was misleading — there was no such field anywhere in the codebase, that was the bug).Verification:
npx vitest run— 653 tests pass across 64 files (4 new tests cover stamp-on-import + export-preserves-tatami + falls-back-to-TYPE_MAP).npx tsc -p tsconfig.json --noEmitclean.The fix preserves the tatami distinction that the editor folds for display; manual workspace edits have no
originalStitchTypeso they continue to useTYPE_MAP(cross-stitch → running, motif → running, zigzag → satin).