autoThreadMatch knob defined but never consumed #68

Closed
opened 2026-09-14 03:09:25 +00:00 by Mark · 1 comment
Owner

Where:

  • Declared: src/components/workspace/types.ts:139 (AutoDigitizeSettings.autoThreadMatch: boolean)
  • Defaulted: src/components/workspace/useWorkspace.ts:62 (autoThreadMatch: true)
  • Mapped: src/lib/digitize-adapters.ts:toServiceSettings (per the call at useWorkspace.ts:437)

Bug:

  • The user-facing knob is rendered in RightPanel and submitted via toServiceSettings, but I traced no consumer in lib/easystitch-client.ts / the digitize service that actually resolves detected colors → PR10 thread catalog.
  • Without a consumer, toggling the checkbox changes nothing in the output.

Expected:

  • digitize(...) response either:
    • includes a threadCatalogMatch per region pointing at the PR10 catalog (current BROTHER_PR10_COLORS in types.ts:220-241), or
    • the UI shows a tooltip "autoThreadMatch requires the PR10 catalog (see #24 / #29)" and the checkbox is disabled.

Related: existing in-code comments reference #24 / #29 for PR10 catalog wiring. This issue is the user-visible side of the same gap.

**Where:** - Declared: `src/components/workspace/types.ts:139` (`AutoDigitizeSettings.autoThreadMatch: boolean`) - Defaulted: `src/components/workspace/useWorkspace.ts:62` (`autoThreadMatch: true`) - Mapped: `src/lib/digitize-adapters.ts:toServiceSettings` (per the call at `useWorkspace.ts:437`) **Bug:** - The user-facing knob is rendered in RightPanel and submitted via `toServiceSettings`, but I traced no consumer in `lib/easystitch-client.ts` / the digitize service that actually resolves detected colors → PR10 thread catalog. - Without a consumer, toggling the checkbox changes nothing in the output. **Expected:** - `digitize(...)` response either: - includes a `threadCatalogMatch` per region pointing at the PR10 catalog (current `BROTHER_PR10_COLORS` in `types.ts:220-241`), or - the UI shows a tooltip "autoThreadMatch requires the PR10 catalog (see #24 / #29)" and the checkbox is disabled. **Related:** existing in-code comments reference #24 / #29 for PR10 catalog wiring. This issue is the user-visible side of the same gap.
Author
Owner

Fix landed via commit 674ad11 (bundled in the #67 kilo-gsd run, pushed to origin/main).

Changes (right-panel only — option (b) from the issue):

  • src/components/workspace/RightPanel.tsx:
    • Extended the ToggleField helper with disabled?: boolean and tooltip?: string props (opacity 0.55, native disabled + aria-disabled="true", cursor: not-allowed, click handler short-circuits).
    • Wired the "Auto Thread Match" ToggleField to disabled with tooltip="autoThreadMatch requires the PR10 catalog (see #24 / #29)".
  • src/components/workspace/issue-68.test.tsx (new, 3 vitest cases):
    1. The row is rendered with the PR10-catalog tooltip (getByTitle).
    2. The toggle button is disabled + aria-disabled="true".
    3. Clicking the disabled toggle does NOT dispatch SET_AUTO_DIGITIZE_SETTING for autoThreadMatch.

Why option (b): option (a) (extend digitize(...) with a threadCatalogMatch per region against BROTHER_PR10_COLORS) requires the catalog to be wired end-to-end (see #24 / #29) and is out of scope for this issue. The disabled-with-tooltip approach is self-contained and makes the gap visible to users instead of silently misleading them. The underlying AutoDigitizeSettings.autoThreadMatch field is left in place so the consumer can be plugged in once #24 / #29 lands.

Verification:

  • npx tsc --noEmit — clean.
  • npm run lint — clean.
  • npm test — 290/290 passed (issue-68.test.tsx 3/3 green).
  • The autoThreadMatch knob remains in state (not removed) so #24 / #29 can re-enable it without a re-plumb.

Closing as fixed.

Fix landed via commit `674ad11` (bundled in the #67 kilo-gsd run, pushed to origin/main). **Changes (right-panel only — option (b) from the issue):** - `src/components/workspace/RightPanel.tsx`: - Extended the `ToggleField` helper with `disabled?: boolean` and `tooltip?: string` props (opacity 0.55, native `disabled` + `aria-disabled="true"`, `cursor: not-allowed`, click handler short-circuits). - Wired the "Auto Thread Match" `ToggleField` to `disabled` with `tooltip="autoThreadMatch requires the PR10 catalog (see #24 / #29)"`. - `src/components/workspace/issue-68.test.tsx` (new, 3 vitest cases): 1. The row is rendered with the PR10-catalog tooltip (`getByTitle`). 2. The toggle button is `disabled` + `aria-disabled="true"`. 3. Clicking the disabled toggle does NOT dispatch `SET_AUTO_DIGITIZE_SETTING` for `autoThreadMatch`. **Why option (b):** option (a) (extend `digitize(...)` with a `threadCatalogMatch` per region against `BROTHER_PR10_COLORS`) requires the catalog to be wired end-to-end (see #24 / #29) and is out of scope for this issue. The disabled-with-tooltip approach is self-contained and makes the gap visible to users instead of silently misleading them. The underlying `AutoDigitizeSettings.autoThreadMatch` field is left in place so the consumer can be plugged in once #24 / #29 lands. **Verification:** - `npx tsc --noEmit` — clean. - `npm run lint` — clean. - `npm test` — 290/290 passed (issue-68.test.tsx 3/3 green). - The `autoThreadMatch` knob remains in state (not removed) so #24 / #29 can re-enable it without a re-plumb. Closing as fixed.
Mark closed this issue 2026-09-14 03:46:37 +00:00
Sign in to join this conversation.
No description provided.