Editor's Path Properties has a 'Density' slider (0-1) but no 'Spacing' input (in mm) — embroidery software typically shows density as mm-spacing (e.g., 0.4mm), not as a 0-1 ratio, the units are unfamiliar to embroidery users #317

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

Finding

src/components/editor/EditorRightPanel.tsx's Path Properties section has a Density slider with values 0.0-1.0 (per the snippet earlier). The unit is unitless.

grep -n 'spacing\|mm.*spacing' src/components/editor/ returns 0. No mm-spacing input.

Embroidery convention is:

  • Density in stitches per mm (e.g., 4 stitches/mm for a satin column)
  • Spacing in mm (e.g., 0.4mm between stitches in a fill)
  • Coverage: the ratio (e.g., 0.4 = 40% covered)

The editor's "density" 0-1 maps to "spacing" mm, but the unit shown is unfamiliar. A user trained in embroidery sees "0.4" and thinks "what does that mean?"

The fix is to show the density in mm-spacing (e.g., "0.4mm" instead of "0.4"), or to add a unit toggle.

Where

  • Density slider: src/components/editor/EditorRightPanel.tsx (per the snippet)
  • No mm-spacing: grep -rn 'spacing' src/components/editor/ returns 0
  • PathDefaultsSection: src/components/workspace/PathDefaultsSection.tsx (also has density 0-1)

Suggested fix shape

  1. UI: change the density slider's label and value display:
<SliderField
  label="Stitch spacing"
  value={1 - density}  // 0.0 density = 1.0 mm spacing
  onChange={(v) => onChangeDensity(1 - v)}
  min={0.1}
  max={1.0}
  step={0.05}
  unit="mm"
/>

density (0-1) maps to spacing (mm) via: spacing = 1 - density + 0.1 (e.g., 0.4 density = 0.7mm spacing; 0.8 density = 0.3mm spacing).

  1. OR: keep the 0-1 density but add a "Show in mm" toggle that displays the equivalent mm spacing.

  2. Help text: a small "0.4 = 0.7mm spacing" tooltip on the slider.

  3. Default: the default of 0.4 maps to 0.7mm spacing, which is a reasonable satin spacing.

Severity

Low. The user can learn the unit. Power users with embroidery experience notice.

Discovered by

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

  • #314 (open) — Satin width. Same path properties; both are embroidery-specific parameters.
  • The PathDefaultsSection (per #198) is in the same boat; the units are unfamiliar.
  • Wilcom/Hatch use mm-spacing; the editor's 0-1 ratio is the abstraction.
## Finding `src/components/editor/EditorRightPanel.tsx`'s Path Properties section has a Density slider with values 0.0-1.0 (per the snippet earlier). The unit is unitless. `grep -n 'spacing\|mm.*spacing' src/components/editor/` returns 0. No mm-spacing input. Embroidery convention is: - Density in stitches per mm (e.g., 4 stitches/mm for a satin column) - Spacing in mm (e.g., 0.4mm between stitches in a fill) - Coverage: the ratio (e.g., 0.4 = 40% covered) The editor's "density" 0-1 maps to "spacing" mm, but the unit shown is unfamiliar. A user trained in embroidery sees "0.4" and thinks "what does that mean?" The fix is to show the density in mm-spacing (e.g., "0.4mm" instead of "0.4"), or to add a unit toggle. ## Where - Density slider: `src/components/editor/EditorRightPanel.tsx` (per the snippet) - No mm-spacing: `grep -rn 'spacing' src/components/editor/` returns 0 - PathDefaultsSection: `src/components/workspace/PathDefaultsSection.tsx` (also has density 0-1) ## Suggested fix shape 1. **UI**: change the density slider's label and value display: ```tsx <SliderField label="Stitch spacing" value={1 - density} // 0.0 density = 1.0 mm spacing onChange={(v) => onChangeDensity(1 - v)} min={0.1} max={1.0} step={0.05} unit="mm" /> ``` `density` (0-1) maps to `spacing` (mm) via: `spacing = 1 - density + 0.1` (e.g., 0.4 density = 0.7mm spacing; 0.8 density = 0.3mm spacing). 2. **OR**: keep the 0-1 density but add a "Show in mm" toggle that displays the equivalent mm spacing. 3. **Help text**: a small "0.4 = 0.7mm spacing" tooltip on the slider. 4. **Default**: the default of 0.4 maps to 0.7mm spacing, which is a reasonable satin spacing. ## Severity Low. The user can learn the unit. Power users with embroidery experience notice. ## Discovered by Gap analysis (2026-10-02) of editor path properties. ## Related - #314 (open) — Satin width. Same path properties; both are embroidery-specific parameters. - The PathDefaultsSection (per #198) is in the same boat; the units are unfamiliar. - Wilcom/Hatch use mm-spacing; the editor's 0-1 ratio is the abstraction.
Author
Owner

Closed by fix commit 88743fc on main — Path Properties density row is now labelled "Stitch spacing" with the value suffixed by mm (e.g. Stitch spacing: 0.40mm), plus a tooltip explaining the convention and a screen-reader aria-label that names the unit. Same change applied to the Settings modal's Path Defaults row (Default stitch spacing: 0.40mm).

The underlying data shape (density 0.10..1.00 used as spacing_mm in estimateThreadUsageMeters / estimateStitchTimeMinutes) is unchanged — only the user-visible label, the tooltip, and the aria-label were touched. Persisted JSON shape (PathDefaults.defaultDensity) is also unchanged.

Tests:

  • src/components/editor/issue-317.test.tsx (new) — pins the new label, aria-label, and Mixed (primary 0.30mm) placeholder for the right-panel slider.
  • src/components/workspace/issue-317-path-defaults.test.tsx (new) — pins the same shape for the Settings modal Path Defaults row.
  • src/components/editor/EditorRightPanel.test.tsx — two assertions updated to match the new label/aria-label wording.

Full suite: 1921 passed / 3 pre-existing failures (issue-275 testid collisions with Color Simplification Preview's subtitle; unrelated to this fix).

Closed by fix commit 88743fc on `main` — Path Properties density row is now labelled "Stitch spacing" with the value suffixed by `mm` (e.g. `Stitch spacing: 0.40mm`), plus a tooltip explaining the convention and a screen-reader aria-label that names the unit. Same change applied to the Settings modal's Path Defaults row (`Default stitch spacing: 0.40mm`). The underlying data shape (density 0.10..1.00 used as spacing_mm in `estimateThreadUsageMeters` / `estimateStitchTimeMinutes`) is unchanged — only the user-visible label, the tooltip, and the aria-label were touched. Persisted JSON shape (`PathDefaults.defaultDensity`) is also unchanged. Tests: - `src/components/editor/issue-317.test.tsx` (new) — pins the new label, aria-label, and `Mixed (primary 0.30mm)` placeholder for the right-panel slider. - `src/components/workspace/issue-317-path-defaults.test.tsx` (new) — pins the same shape for the Settings modal Path Defaults row. - `src/components/editor/EditorRightPanel.test.tsx` — two assertions updated to match the new label/aria-label wording. Full suite: 1921 passed / 3 pre-existing failures (issue-275 testid collisions with Color Simplification Preview's subtitle; unrelated to this fix).
Mark closed this issue 2026-10-04 23:35:15 +00:00
Sign in to join this conversation.
No description provided.