Editor's Path Properties has 'Stitch type' but no 'stitch direction' per path — user with a fill path wanting to control the stitching direction (e.g., always top-to-bottom) has no UI #374

Closed
opened 2026-10-04 03:59:16 +00:00 by Mark · 1 comment
Owner

Finding

grep -rn 'stitchDirection\|stitchSequence' src/components/editor/ returns 0. The editor has no per-path stitch direction.

Stitch direction affects:

  • The visual grain of the fill
  • The "lay" of the thread (how it catches the light)
  • Production order (which direction the machine stitches)

A user with a fill path:

  • Wants the stitches to go top-to-bottom (instead of left-to-right)
  • No UI to set this

The fix is a stitch direction selector.

Where

  • Path Properties: src/components/editor/EditorRightPanel.tsx
  • No direction: grep -rn 'stitchDirection' src/components/editor/ returns 0

Suggested fix shape

  1. Type: add stitchDirection: 'auto' | 'horizontal' | 'vertical' | 'diagonal-45' | 'diagonal-135' | 'radial' | 'contour' to the StitchPath type.

  2. UI: a SelectField in the Path Properties section when stitch type is 'fill':

<SelectField
  label="Stitch direction"
  value={p.stitchDirection ?? 'auto'}
  options={[
    { value: 'auto', label: 'Auto' },
    { value: 'horizontal', label: 'Horizontal' },
    { value: 'vertical', label: 'Vertical' },
    { value: 'diagonal-45', label: 'Diagonal (45°)' },
    { value: 'diagonal-135', label: 'Diagonal (135°)' },
    { value: 'radial', label: 'Radial (from center)' },
    { value: 'contour', label: 'Contour (follow shape)' },
  ]}
  onChange={(v) => onUpdateStitchDirection(p.id, v)}
/>
  1. Visual: the stitch direction is shown in the canvas as a faint pattern preview.

  2. Use cases:

  • Quilt designs (horizontal vs vertical)
  • Logos (radial fills)
  • Decorative designs (contour fills)
  1. History: single undoable action.

Severity**

Medium. Stitch direction is critical for production embroidery. Power users notice.

Discovered by

Gap analysis (2026-10-02) of editor path properties.

  • #373 (open) — Fill angle. Same family; the angle is one parameter of the direction.
  • The fill parameters (per the prior issue) are the family.
  • Wilcom/Hatch have stitch direction. The editor's gap is the parallel.
## Finding `grep -rn 'stitchDirection\|stitchSequence' src/components/editor/` returns 0. The editor has no per-path stitch direction. Stitch direction affects: - The visual grain of the fill - The "lay" of the thread (how it catches the light) - Production order (which direction the machine stitches) A user with a fill path: - Wants the stitches to go top-to-bottom (instead of left-to-right) - No UI to set this The fix is a stitch direction selector. ## Where - Path Properties: `src/components/editor/EditorRightPanel.tsx` - No direction: `grep -rn 'stitchDirection' src/components/editor/` returns 0 ## Suggested fix shape 1. **Type**: add `stitchDirection: 'auto' | 'horizontal' | 'vertical' | 'diagonal-45' | 'diagonal-135' | 'radial' | 'contour'` to the StitchPath type. 2. **UI**: a SelectField in the Path Properties section when stitch type is 'fill': ```tsx <SelectField label="Stitch direction" value={p.stitchDirection ?? 'auto'} options={[ { value: 'auto', label: 'Auto' }, { value: 'horizontal', label: 'Horizontal' }, { value: 'vertical', label: 'Vertical' }, { value: 'diagonal-45', label: 'Diagonal (45°)' }, { value: 'diagonal-135', label: 'Diagonal (135°)' }, { value: 'radial', label: 'Radial (from center)' }, { value: 'contour', label: 'Contour (follow shape)' }, ]} onChange={(v) => onUpdateStitchDirection(p.id, v)} /> ``` 3. **Visual**: the stitch direction is shown in the canvas as a faint pattern preview. 4. **Use cases**: - Quilt designs (horizontal vs vertical) - Logos (radial fills) - Decorative designs (contour fills) 5. **History**: single undoable action. ## Severity** Medium. Stitch direction is critical for production embroidery. Power users notice. ## Discovered by Gap analysis (2026-10-02) of editor path properties. ## Related** - #373 (open) — Fill angle. Same family; the angle is one parameter of the direction. - The fill parameters (per the prior issue) are the family. - Wilcom/Hatch have stitch direction. The editor's gap is the parallel.
Author
Owner

Shipped per-path stitch direction (7-value categorical enum) in editor Path Properties.

Closes #374. Commit 219df4a on origin/main.

What lands:

  • stitchDirection?: StitchDirection on StitchPath (optional, defaults to auto via coerceStitchDirection).
  • STITCH_DIRECTIONS catalog in pathDefaults.ts (auto, horizontal, vertical, diagonal-45, diagonal-135, radial, contour) + STITCH_DIRECTION_LABELS for human-readable labels.
  • EditorRightPanel: Stitch direction <select> + apply-to-all button, rendered only when stitchType === "fill". Hidden for satin / running / cross-stitch / zigzag / motif (value has no effect on those).
  • Editor.tsx: handleUpdateSelectedPathStitchDirection + handleApplyToAllPathsStitchDirection (single setPaths + one pushHistory per change).
  • Tests: 9 tests in issue-374.test.tsx covering fill/satin gate, legacy auto fallback, handler firing, apply-to-all bulk stamp, seven-option catalog order, back-compat with omitted handler.

Categorical companion to #373 (numeric fill angle + spacing). The two are orthogonal: #373 rotates the rows, #374 picks the family of walk pattern (linear vs radial vs contour). Both are editor-only metadata on StitchPath — the engine does not consume either today.

Shipped per-path stitch direction (7-value categorical enum) in editor Path Properties. Closes #374. Commit 219df4a on origin/main. What lands: - `stitchDirection?: StitchDirection` on StitchPath (optional, defaults to auto via `coerceStitchDirection`). - STITCH_DIRECTIONS catalog in pathDefaults.ts (auto, horizontal, vertical, diagonal-45, diagonal-135, radial, contour) + STITCH_DIRECTION_LABELS for human-readable labels. - EditorRightPanel: Stitch direction `<select>` + apply-to-all button, rendered only when `stitchType === "fill"`. Hidden for satin / running / cross-stitch / zigzag / motif (value has no effect on those). - Editor.tsx: `handleUpdateSelectedPathStitchDirection` + `handleApplyToAllPathsStitchDirection` (single setPaths + one pushHistory per change). - Tests: 9 tests in issue-374.test.tsx covering fill/satin gate, legacy auto fallback, handler firing, apply-to-all bulk stamp, seven-option catalog order, back-compat with omitted handler. Categorical companion to #373 (numeric fill angle + spacing). The two are orthogonal: #373 rotates the rows, #374 picks the family of walk pattern (linear vs radial vs contour). Both are editor-only metadata on StitchPath — the engine does not consume either today.
Mark closed this issue 2026-10-05 16:32:21 +00:00
Sign in to join this conversation.
No description provided.