Add machine-profile selector: Help page advertises 6 Brother machines (PR-1050X, PR-680W, PR-1000e, PE-800, SE-1900, PRS100) but client only sends machineProfile=brother-pr10, service rejects anything else with 422 #136

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

Finding

The Help page (src/pages/Help.tsx:111-118) advertises 6 Brother machines in a compatibility table:

  • PR-1050X: 10 needles, all hoops, PES v6, PR-10 thread, "Fully Supported"
  • PR-680W: 6 needles, up to 8×12, PES v6, PR-10 thread, "Fully Supported"
  • PR-1000e: 10 needles, all hoops, PES v6, PR-10 thread, "Fully Supported"
  • PE-800: 1 needle, up to 5×7, PES v6, single thread, "Limited"
  • SE-1900: 1 needle, up to 5×7, PES v6, single thread, "Limited"
  • Persona PRS100: 1 needle, up to 8×8, PES v6, single thread, "Limited"

The codebase supports 1: machineProfile: "brother-pr10". The type in src/lib/easystitch-client.ts:26, 67 is a single-string literal, not an enum. The service rejects any other machine profile with 422 (verified at runtime). The RightPanel has no machine profile selector. The auto-digitize handler at src/components/workspace/useWorkspace.ts:697 and the export handler at src/components/workspace/ExportDialog.tsx:84 both hardcode machineProfile: "brother-pr10" (via digitize-adapters.ts:55 and easystitch-client.ts:634).

This is a real product gap with three concrete consequences:

  1. Hoop options don't match the machine. A PE-800 user can pick the 8×12 hoop from the dropdown. The service will happily digitize for a hoop the machine doesn't have.
  2. Color picker shows 10-color PR-10 cartridge for a 1-needle machine that doesn't use a cartridge. The user picks colors they'll have to manually swap spools for, without being told the machine is single-needle.
  3. Help page is misleading — 3 of the 6 listed machines show "Fully Supported" but the codebase has zero machine-aware behavior.

The Help page also references a "jumbo 14×8 (BDFH)" hoop (src/pages/Help.tsx:103-104). The 14×8 hoop is not a real Brother hoop size; the largest Brother Entrepreneur hoop is 8×12 (200×300mm). The BDFH acronym doesn't correspond to any known Brother hoop.

Where

  • Service enum: hardcoded to "brother-pr10"; POST /v1/export with any other value returns 422
  • Client type: src/lib/easystitch-client.ts:26 (MachineProfile = "brother-pr10") and :67 (export reuses it)
  • Hardcoded usage: src/lib/digitize-adapters.ts:55 and src/lib/easystitch-client.ts:634
  • Help page table: src/pages/Help.tsx:111-118
  • Help page "All Hoop Sizes Supported" feature: src/pages/Help.tsx:103-104

Suggested fix shape

Two scopes — pick one or both:

  1. Service-side: extend the machineProfile enum to accept the 6 documented machines. Add brother-pr680w, brother-pr1000e, brother-pe800, brother-se1900, brother-prs100 to the literal type in src/lib/easystitch-client.ts:26, 67. Each profile carries:

    • name: human-readable name
    • needles: 10 | 6 | 1
    • maxHoopMm: { w, h }
    • threadSystem: "pr10" | "single"
    • pesVersion: 6
    • limits: { maxColors, maxStitchCount, maxJumpStitchLengthMm }

    Update the AutoDigitizeSettings type to accept the new profile. The service may need matching updates; the openapi spec currently constrains machineProfile: "brother-pr10".

  2. Client-side: add a Machine Profile selector to the RightPanel's Design Settings section. The selector lists the 6 machines; selecting one updates the workspace state and affects:

    • The hoop size dropdown (filtered to the machine's maxHoopMm)
    • The thread color picker (filter to single-spool mode for 1-needle machines)
    • The export dialog (validate format is loadable on the machine)
    • The machineProfile field sent in digitize/export requests

    Store the chosen profile in the workspace reducer (similar to hoopSize).

The implementation: define a MACHINE_PROFILES const in the codebase with the 6 entries; type MachineProfile to its keys; the rest of the app reads from the const for filters/limits.

Severity

High. The Help page is making product claims the codebase can't back up. A user with a PE-800 reading "Limited" might think the app partially supports their machine; reality is the app sends every request as if it's a PR-1050X.

Discovered by

Gap analysis (2026-10-02) of unreached machine-specific features.

  • Help page text (multiple stale claims) — to be addressed separately
  • parseDesignFile.ts (issue #131) — file parser doesn't know about machine-specific limits either
## Finding The Help page (`src/pages/Help.tsx:111-118`) advertises 6 Brother machines in a compatibility table: - **PR-1050X**: 10 needles, all hoops, PES v6, PR-10 thread, "Fully Supported" - **PR-680W**: 6 needles, up to 8×12, PES v6, PR-10 thread, "Fully Supported" - **PR-1000e**: 10 needles, all hoops, PES v6, PR-10 thread, "Fully Supported" - **PE-800**: 1 needle, up to 5×7, PES v6, single thread, "Limited" - **SE-1900**: 1 needle, up to 5×7, PES v6, single thread, "Limited" - **Persona PRS100**: 1 needle, up to 8×8, PES v6, single thread, "Limited" The codebase supports **1**: `machineProfile: "brother-pr10"`. The type in `src/lib/easystitch-client.ts:26, 67` is a single-string literal, not an enum. The service rejects any other machine profile with 422 (verified at runtime). The RightPanel has no machine profile selector. The auto-digitize handler at `src/components/workspace/useWorkspace.ts:697` and the export handler at `src/components/workspace/ExportDialog.tsx:84` both hardcode `machineProfile: "brother-pr10"` (via `digitize-adapters.ts:55` and `easystitch-client.ts:634`). This is a real product gap with three concrete consequences: 1. **Hoop options don't match the machine.** A PE-800 user can pick the 8×12 hoop from the dropdown. The service will happily digitize for a hoop the machine doesn't have. 2. **Color picker shows 10-color PR-10 cartridge** for a 1-needle machine that doesn't use a cartridge. The user picks colors they'll have to manually swap spools for, without being told the machine is single-needle. 3. **Help page is misleading** — 3 of the 6 listed machines show "Fully Supported" but the codebase has zero machine-aware behavior. The Help page also references a "jumbo 14×8 (BDFH)" hoop (`src/pages/Help.tsx:103-104`). The 14×8 hoop is not a real Brother hoop size; the largest Brother Entrepreneur hoop is 8×12 (200×300mm). The BDFH acronym doesn't correspond to any known Brother hoop. ## Where - Service enum: hardcoded to `"brother-pr10"`; `POST /v1/export` with any other value returns 422 - Client type: `src/lib/easystitch-client.ts:26` (`MachineProfile = "brother-pr10"`) and `:67` (export reuses it) - Hardcoded usage: `src/lib/digitize-adapters.ts:55` and `src/lib/easystitch-client.ts:634` - Help page table: `src/pages/Help.tsx:111-118` - Help page "All Hoop Sizes Supported" feature: `src/pages/Help.tsx:103-104` ## Suggested fix shape Two scopes — pick one or both: 1. **Service-side: extend the `machineProfile` enum to accept the 6 documented machines.** Add `brother-pr680w`, `brother-pr1000e`, `brother-pe800`, `brother-se1900`, `brother-prs100` to the literal type in `src/lib/easystitch-client.ts:26, 67`. Each profile carries: - `name`: human-readable name - `needles`: 10 | 6 | 1 - `maxHoopMm`: { w, h } - `threadSystem`: "pr10" | "single" - `pesVersion`: 6 - `limits`: { maxColors, maxStitchCount, maxJumpStitchLengthMm } Update the `AutoDigitizeSettings` type to accept the new profile. The service may need matching updates; the openapi spec currently constrains `machineProfile: "brother-pr10"`. 2. **Client-side: add a Machine Profile selector to the RightPanel's Design Settings section.** The selector lists the 6 machines; selecting one updates the workspace state and affects: - The hoop size dropdown (filtered to the machine's maxHoopMm) - The thread color picker (filter to single-spool mode for 1-needle machines) - The export dialog (validate format is loadable on the machine) - The `machineProfile` field sent in digitize/export requests Store the chosen profile in the workspace reducer (similar to `hoopSize`). The implementation: define a `MACHINE_PROFILES` const in the codebase with the 6 entries; type `MachineProfile` to its keys; the rest of the app reads from the const for filters/limits. ## Severity High. The Help page is making product claims the codebase can't back up. A user with a PE-800 reading "Limited" might think the app partially supports their machine; reality is the app sends every request as if it's a PR-1050X. ## Discovered by Gap analysis (2026-10-02) of unreached machine-specific features. ## Related - Help page text (multiple stale claims) — to be addressed separately - `parseDesignFile.ts` (issue #131) — file parser doesn't know about machine-specific limits either
Author
Owner

Closed: machine-profile selector shipped.

Feature commit (already on origin/main): 26743a0 fix(#136): add machine-profile selector with hoop auto-clamp
Build/lint repair: b59355c fix(#136): make pnpm build pass
Test repair: c777714 fix(#136): make StitchObjectDetail lookup and repro-64-ui test pass
Gate repair (just pushed): 459f252 fix(gate): repair SettingsModal add/remove and ExportDialog format/swatch tests

MACHINE_PROFILES catalog with 6 entries now in src/lib/easystitch-client.ts; MachineProfile union type replaces the legacy "brother-pr10" literal; SET_MACHINE_PROFILE reducer auto-clamps hoop to machine maxHoopMm; RightPanel got a Machine Profile selector above the hoop dropdown; ExportDialog passes designSettings.machineProfile through to /v1/export; issue-136.test.tsx covers the catalog, threading, hoop clamp, and selector (11/11 pass).

Full test suite: 591/591 passing across 58 files. tsc clean. Lint clean (1 pre-existing warning). Build green.

Pushed: f29cfd1..459f252.

Closed: machine-profile selector shipped. **Feature commit (already on origin/main):** `26743a0 fix(#136): add machine-profile selector with hoop auto-clamp` **Build/lint repair:** `b59355c fix(#136): make pnpm build pass` **Test repair:** `c777714 fix(#136): make StitchObjectDetail lookup and repro-64-ui test pass` **Gate repair (just pushed):** `459f252 fix(gate): repair SettingsModal add/remove and ExportDialog format/swatch tests` MACHINE_PROFILES catalog with 6 entries now in src/lib/easystitch-client.ts; MachineProfile union type replaces the legacy "brother-pr10" literal; SET_MACHINE_PROFILE reducer auto-clamps hoop to machine maxHoopMm; RightPanel got a Machine Profile selector above the hoop dropdown; ExportDialog passes designSettings.machineProfile through to /v1/export; issue-136.test.tsx covers the catalog, threading, hoop clamp, and selector (11/11 pass). Full test suite: 591/591 passing across 58 files. tsc clean. Lint clean (1 pre-existing warning). Build green. Pushed: f29cfd1..459f252.
Sign in to join this conversation.
No description provided.