Export dialog doesn't warn when the selected format isn't compatible with the chosen machine profile (e.g. PR-680W persona, JEF format is a Janome format) #173

Closed
opened 2026-10-03 17:33:48 +00:00 by Mark · 1 comment
Owner

Finding

The Export dialog (src/components/workspace/ExportDialog.tsx) lets the user pick any of 4 formats (PES, DST, EXP, JEF) and the machine profile is selected independently in the Design Settings. The two are not cross-checked.

src/lib/easystitch-client.ts:35-78 defines the machine profiles with their target PES versions and thread systems. The help text at FORMAT_DESCRIPTIONS (line 47-52) maps formats to machine families:

  • PES → Brother / Babylock
  • DST → Tajima (most machines)
  • EXP → Melco / Bernina
  • JEF → Janome / Elna / New Home

A Brother Entrepreneur (any of the 6 profiles) selecting JEF for export is the wrong choice — JEF is a Janome format, and Brother machines can't load it. The dialog still lets the user click Export, the service returns a valid blob (the service doesn't validate against the user's machine), and the user gets a .jef file they can't load.

The reverse is also true: a Janome user with a hypothetical Janome profile (not currently supported) choosing PES gets a file Brother-only embroidery software might not load.

Where

src/components/workspace/ExportDialog.tsx:288-308 (format grid) and :84-85 (the exportRequest builds with designSettings.machineProfile).

Suggested fix shape

Two options:

  1. Warn the user. When the format isn't compatible with the selected machine profile, render an inline warning in the dialog (similar to inlineError):

    const formatCompatible = (format, profile) => {
      const profileName = MACHINE_PROFILES[profile].name.toLowerCase();
      if (format === 'JEF' && (profileName.includes('janome') || profileName.includes('elna'))) return true;
      if (format === 'PES' && (profileName.includes('brother') || profileName.includes('babylock'))) return true;
      if (format === 'EXP' && (profileName.includes('melco') || profileName.includes('bernina'))) return true;
      if (format === 'DST') return true; // DST is universal interchange
      return false;
    };
    

    Render: "PES is optimized for Brother / Babylock machines. Your selected profile is the Janome X, but the file will still be generated. Continue anyway?"

  2. Or: add machine-profile-driven format filtering. Grey out incompatible formats; the user can still click them but sees a warning.

Option 1 is the smaller change. Option 2 is the right product move (matches the hoop size filtering by machine profile from #136).

Severity

Medium. A user gets a file they can't use, with no warning. The help text in the format grid (FORMAT_DESCRIPTIONS) is informational; the user has to read it AND match it against their machine profile.

Discovered by

Gap analysis (2026-10-02) of export pipeline.

  • #136 (closed) — machine profile selector. The hoops filter by profile; the formats should follow the same pattern.
  • #129 (closed) — added 4 formats to the export dialog. The format-vs-profile cross-check is the missing piece.
## Finding The Export dialog (`src/components/workspace/ExportDialog.tsx`) lets the user pick any of 4 formats (PES, DST, EXP, JEF) and the machine profile is selected independently in the Design Settings. The two are not cross-checked. `src/lib/easystitch-client.ts:35-78` defines the machine profiles with their target PES versions and thread systems. The help text at `FORMAT_DESCRIPTIONS` (line 47-52) maps formats to machine families: - PES → Brother / Babylock - DST → Tajima (most machines) - EXP → Melco / Bernina - JEF → Janome / Elna / New Home A Brother Entrepreneur (any of the 6 profiles) selecting JEF for export is the wrong choice — JEF is a Janome format, and Brother machines can't load it. The dialog still lets the user click Export, the service returns a valid blob (the service doesn't validate against the user's machine), and the user gets a `.jef` file they can't load. The reverse is also true: a Janome user with a hypothetical Janome profile (not currently supported) choosing PES gets a file Brother-only embroidery software might not load. ## Where `src/components/workspace/ExportDialog.tsx:288-308` (format grid) and `:84-85` (the exportRequest builds with `designSettings.machineProfile`). ## Suggested fix shape Two options: 1. **Warn the user.** When the format isn't compatible with the selected machine profile, render an inline warning in the dialog (similar to `inlineError`): ```tsx const formatCompatible = (format, profile) => { const profileName = MACHINE_PROFILES[profile].name.toLowerCase(); if (format === 'JEF' && (profileName.includes('janome') || profileName.includes('elna'))) return true; if (format === 'PES' && (profileName.includes('brother') || profileName.includes('babylock'))) return true; if (format === 'EXP' && (profileName.includes('melco') || profileName.includes('bernina'))) return true; if (format === 'DST') return true; // DST is universal interchange return false; }; ``` Render: "PES is optimized for Brother / Babylock machines. Your selected profile is the Janome X, but the file will still be generated. Continue anyway?" 2. **Or: add machine-profile-driven format filtering.** Grey out incompatible formats; the user can still click them but sees a warning. Option 1 is the smaller change. Option 2 is the right product move (matches the hoop size filtering by machine profile from #136). ## Severity Medium. A user gets a file they can't use, with no warning. The help text in the format grid (FORMAT_DESCRIPTIONS) is informational; the user has to read it AND match it against their machine profile. ## Discovered by Gap analysis (2026-10-02) of export pipeline. ## Related - #136 (closed) — machine profile selector. The hoops filter by profile; the formats should follow the same pattern. - #129 (closed) — added 4 formats to the export dialog. The format-vs-profile cross-check is the missing piece.
Author
Owner

Fixed by commit 11e1a0d on origin/main. formatCompatible() cross-checks the four service-supported formats against the active machine profile; a warm-amber export-format-warning banner renders under the format grid when there's a mismatch (Export button stays enabled — user might be exporting for a friend's machine).

  • PES ↔ Brother / Babylock
  • DST universal (always compatible)
  • EXP ↔ Melco / Bernina
  • JEF ↔ Janome / Elna / New Home

Substring-match against MACHINE_PROFILES[name] so future Janome / Melco / Bernina profiles need only the right keyword in their display name. Non-blocking by design (matches the "continue anyway?" shape from the issue body); the red inline-error banner stays reserved for cases where export is unavailable.

5 new tests in ExportDialog.test.tsx (29 total). tsc --noEmit clean, pnpm test 742/742, pnpm build clean.

Fixed by commit 11e1a0d on origin/main. formatCompatible() cross-checks the four service-supported formats against the active machine profile; a warm-amber export-format-warning banner renders under the format grid when there's a mismatch (Export button stays enabled — user might be exporting for a friend's machine). - PES ↔ Brother / Babylock - DST universal (always compatible) - EXP ↔ Melco / Bernina - JEF ↔ Janome / Elna / New Home Substring-match against MACHINE_PROFILES[name] so future Janome / Melco / Bernina profiles need only the right keyword in their display name. Non-blocking by design (matches the "continue anyway?" shape from the issue body); the red inline-error banner stays reserved for cases where export is unavailable. 5 new tests in ExportDialog.test.tsx (29 total). tsc --noEmit clean, pnpm test 742/742, pnpm build clean.
Mark closed this issue 2026-10-03 19:05:46 +00:00
Sign in to join this conversation.
No description provided.