Editor's save payload hardcodes fabricType: 'medium', stabilizer: 'cut-away', machineProfile: 'brother-pr1050x' — same problem as hoopSize, no way to override the saved defaults #239

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

Finding

src/pages/Editor.tsx's handleSave (line 832) and handleSaveAsNew (line 905) pass the same designSettings block with all four fields hardcoded:

designSettings: {
  fileName: filename,
  hoopSize: '4x4',          // see #238
  fabricType: 'medium',
  stabilizer: 'cut-away',
  machineProfile: 'brother-pr1050x',
},

The user has no way to override:

  • fabricType (light / medium / heavy / stretch / denim) — affects stitch tension
  • stabilizer (cut-away / tear-away / wash-away / none) — affects stabilizer recommendation
  • machineProfile (brother-pr1050x, brother-innovis, janome-mb-7, etc.) — affects the export format compatibility

The workspace's design settings panel has the form (the right panel shows the form for the current design). The editor's save path doesn't read it.

Where

  • Editor: src/pages/Editor.tsx:832 (handleSave), 905 (handleSaveAsNew)
  • Workspace settings form: src/components/workspace/RightPanel.tsx (the design settings section)

Suggested fix shape

Same as #238: read the values from state (either a useDesignSettings hook or local state in the editor) instead of hardcoding.

The cleanest pattern:

  1. Add designSettings to the Editor's state (initialized from the loaded design's settings, or from defaults).
  2. Add a "Design Settings" section to the editor's right panel (or to the gear-icon Settings modal) with the form.
  3. The save payload reads from this state.

The values should be inherited from the workspace when the user came from there (the LOAD_DESIGN_STORAGE_KEY payload can include the settings), or from a default when opening a new design.

Severity

Medium. Same as #238. The user can't configure the saved design's settings.

Discovered by

Code review (2026-10-02) of editor save flow.

  • #238 (open) — Editor hardcodes hoopSize. Same file, same save handlers.
  • #125 (open) — Settings modal: add Optional defaults sections. The settings form lives here.
  • The workspace's right panel already has the form; the editor's save should reuse it.
## Finding `src/pages/Editor.tsx`'s `handleSave` (line 832) and `handleSaveAsNew` (line 905) pass the same `designSettings` block with all four fields hardcoded: ```ts designSettings: { fileName: filename, hoopSize: '4x4', // see #238 fabricType: 'medium', stabilizer: 'cut-away', machineProfile: 'brother-pr1050x', }, ``` The user has no way to override: - `fabricType` (light / medium / heavy / stretch / denim) — affects stitch tension - `stabilizer` (cut-away / tear-away / wash-away / none) — affects stabilizer recommendation - `machineProfile` (brother-pr1050x, brother-innovis, janome-mb-7, etc.) — affects the export format compatibility The workspace's design settings panel has the form (the right panel shows the form for the current design). The editor's save path doesn't read it. ## Where - Editor: `src/pages/Editor.tsx:832` (handleSave), `905` (handleSaveAsNew) - Workspace settings form: `src/components/workspace/RightPanel.tsx` (the design settings section) ## Suggested fix shape Same as #238: read the values from state (either a `useDesignSettings` hook or local state in the editor) instead of hardcoding. The cleanest pattern: 1. Add `designSettings` to the Editor's state (initialized from the loaded design's settings, or from defaults). 2. Add a "Design Settings" section to the editor's right panel (or to the gear-icon Settings modal) with the form. 3. The save payload reads from this state. The values should be inherited from the workspace when the user came from there (the `LOAD_DESIGN_STORAGE_KEY` payload can include the settings), or from a default when opening a new design. ## Severity Medium. Same as #238. The user can't configure the saved design's settings. ## Discovered by Code review (2026-10-02) of editor save flow. ## Related - #238 (open) — Editor hardcodes hoopSize. Same file, same save handlers. - #125 (open) — Settings modal: add Optional defaults sections. The settings form lives here. - The workspace's right panel already has the form; the editor's save should reuse it.
Author
Owner

Shipped in ab05462. The Editor header now has Fabric / Stabilizer / Machine pickers next to the existing Hoop picker, defaults match the prior hard-coded literals so the migration is invisible, and every save / export / workspace-bridge path reads from the new state hooks. Round-trip hydration via tc_workspace_snapshot means a Workspace → Editor trip preserves the user-picked values. Full repo suite: 1228 passing, 1 skipped.

Refs #238.

Shipped in ab05462. The Editor header now has Fabric / Stabilizer / Machine pickers next to the existing Hoop picker, defaults match the prior hard-coded literals so the migration is invisible, and every save / export / workspace-bridge path reads from the new state hooks. Round-trip hydration via tc_workspace_snapshot means a Workspace → Editor trip preserves the user-picked values. Full repo suite: 1228 passing, 1 skipped. Refs #238.
Mark closed this issue 2026-10-04 08:44:27 +00:00
Sign in to join this conversation.
No description provided.