Editor has no way to add a Path Defaults section's defaults to a path that already exists — user changes the default stitch type in Settings, but existing paths keep their old type, no 'apply defaults to all' button #249

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

Finding

src/components/workspace/pathDefaults.ts:24 defines DEFAULT_PATH_DEFAULTS (defaultStitchType: 'satin', defaultDensity: 0.4). The usePathDefaults() hook (line 118) reads/writes this from localStorage. The editor's handleFinishPath reads it to determine the new path's stitch type and density.

But existing paths keep whatever stitch type they were created with. If the user:

  • Sets default to "fill"
  • Realizes all 8 existing satin paths should be fill
  • Has to click each path, change the stitch type, confirm
  • 8 separate operations

grep -n 'applyDefaults\|setAllToDefaults' src/ returns 0. No bulk apply.

Where

  • usePathDefaults: src/components/workspace/pathDefaults.ts:118
  • handleFinishPath: src/pages/Editor.tsx (reads defaults for new paths)
  • handleUpdateSelectedPathStitchType: src/pages/Editor.tsx (per-path, single path)
  • No bulk apply: grep -n 'applyDefaults' src/ returns 0

Suggested fix shape

Add a "Apply Defaults" button in the editor's Path List header (or in the Settings modal's PathDefaultsSection):

<button
  onClick={onApplyDefaults}
  data-testid="apply-defaults-to-all"
  title="Apply the current Path Defaults to all paths"
>
  <Sparkles size={12} />
  Apply Defaults to All
</button>

onApplyDefaults iterates all paths and sets stitchType and density to the current defaults. The user sees a toast: "Applied defaults to 8 paths." A confirmation modal (with undo) for designs with many paths.

The undoable variant: dispatch a single pushHistory(paths) before the bulk update, so a single Cmd+Z reverts all 8 changes.

Severity

Low. The user can change paths one at a time. Power users with many paths notice the friction.

Discovered by

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

  • The PathDefaultsSection in Settings (per #198) is the entry point. The "Apply to All" is the bulk action.
  • #212 (open) — Editor has no 'apply same settings to all paths'. Same family.
  • The bulk delete (per #188) is the parallel pattern: single history push, single undo.
## Finding `src/components/workspace/pathDefaults.ts:24` defines `DEFAULT_PATH_DEFAULTS` (`defaultStitchType: 'satin'`, `defaultDensity: 0.4`). The `usePathDefaults()` hook (line 118) reads/writes this from localStorage. The editor's `handleFinishPath` reads it to determine the new path's stitch type and density. But existing paths keep whatever stitch type they were created with. If the user: - Sets default to "fill" - Realizes all 8 existing satin paths should be fill - Has to click each path, change the stitch type, confirm - 8 separate operations `grep -n 'applyDefaults\|setAllToDefaults' src/` returns 0. No bulk apply. ## Where - usePathDefaults: `src/components/workspace/pathDefaults.ts:118` - handleFinishPath: `src/pages/Editor.tsx` (reads defaults for new paths) - handleUpdateSelectedPathStitchType: `src/pages/Editor.tsx` (per-path, single path) - No bulk apply: `grep -n 'applyDefaults' src/` returns 0 ## Suggested fix shape Add a "Apply Defaults" button in the editor's Path List header (or in the Settings modal's PathDefaultsSection): ```tsx <button onClick={onApplyDefaults} data-testid="apply-defaults-to-all" title="Apply the current Path Defaults to all paths" > <Sparkles size={12} /> Apply Defaults to All </button> ``` `onApplyDefaults` iterates all paths and sets `stitchType` and `density` to the current defaults. The user sees a toast: "Applied defaults to 8 paths." A confirmation modal (with undo) for designs with many paths. The undoable variant: dispatch a single `pushHistory(paths)` before the bulk update, so a single Cmd+Z reverts all 8 changes. ## Severity Low. The user can change paths one at a time. Power users with many paths notice the friction. ## Discovered by Gap analysis (2026-10-02) of editor path defaults. ## Related - The PathDefaultsSection in Settings (per #198) is the entry point. The "Apply to All" is the bulk action. - #212 (open) — Editor has no 'apply same settings to all paths'. Same family. - The bulk delete (per #188) is the parallel pattern: single history push, single undo.
Author
Owner

Shipped #249 — 'Apply Defaults to All Paths' affordance in the editor.

Adds a single 'Apply Defaults to All Paths' button to the editor's right-panel Path Properties section. Stamps the Settings modal's pathDefaults (defaultStitchType + defaultDensity) onto every existing path in one setPaths + one pushHistory dispatch — a single Ctrl+Z reverts the whole bulk stamp.

Distinct from the existing per-row apply-to-all buttons (#212), which broadcast the SELECTED path's value: this reads the user's persisted Settings preferences so a Settings tweak can be retroactively applied to existing paths without manual fan-out.

Commit: 8b28eba on origin/main
Files: src/pages/Editor.tsx, src/components/editor/EditorRightPanel.tsx, src/components/editor/issue-249.test.tsx
Tests: 7 new tests (visibility gates, label content, aria-label, atomicity). Full suite 2194/2194 (1 skipped). tsc + lint + build clean.

Behavior notes:

  • Skips work when every path already matches the defaults (no-op click doesn't create an undo entry).
  • Surfaces a success toast with the stamped values + count for feedback on large designs.
  • Hides the row entirely when the Editor didn't wire pathDefaults/onApplyPathDefaultsToAllPaths (older callers without #249 keep their pre-fix panel shape).
Shipped #249 — 'Apply Defaults to All Paths' affordance in the editor. Adds a single 'Apply Defaults to All Paths' button to the editor's right-panel Path Properties section. Stamps the Settings modal's pathDefaults (defaultStitchType + defaultDensity) onto every existing path in one setPaths + one pushHistory dispatch — a single Ctrl+Z reverts the whole bulk stamp. Distinct from the existing per-row apply-to-all buttons (#212), which broadcast the SELECTED path's value: this reads the user's persisted Settings preferences so a Settings tweak can be retroactively applied to existing paths without manual fan-out. Commit: 8b28eba on origin/main Files: src/pages/Editor.tsx, src/components/editor/EditorRightPanel.tsx, src/components/editor/issue-249.test.tsx Tests: 7 new tests (visibility gates, label content, aria-label, atomicity). Full suite 2194/2194 (1 skipped). tsc + lint + build clean. Behavior notes: - Skips work when every path already matches the defaults (no-op click doesn't create an undo entry). - Surfaces a success toast with the stamped values + count for feedback on large designs. - Hides the row entirely when the Editor didn't wire pathDefaults/onApplyPathDefaultsToAllPaths (older callers without #249 keep their pre-fix panel shape).
Mark closed this issue 2026-10-05 03:59:41 +00:00
Sign in to join this conversation.
No description provided.