refactor(chess/ui): extract ParamField from CustomModifierEditor (no behavior change)

Moves the 247-line PrimitiveInspector function out of the 872-line
CustomModifierEditor (now 533 lines) into its own ParamField module so
the upcoming visual builder can reuse the same Zod-introspecting form
renderer without coupling to the form-mode editor's three-pane layout.

Discipline:
- Snapshot test seeded under the original PrimitiveInspector first;
  component then extracted; snapshots re-verified byte-identical.
- Renamed export from PrimitiveInspector to ParamField; props,
  data-testids, classNames, and Zod-internal access patterns preserved
  verbatim — including the existing block-move-type and override-promotion
  Zod-v4 enum bug (out of scope to fix here).
- Internal helpers (isAttrFieldName, attrFieldPreferredType,
  attrFieldMode, collectSeededAttrs, ATTR_FIELD_NAMES) move with the
  component; generateDefaultParams stays in CustomModifierEditor since
  the palette button still uses it.

Snapshot harness uses react-dom/server#renderToStaticMarkup for
deterministic SSR — no @testing-library dependency added. vitest.config
include pattern widened to *.test.tsx alongside *.test.ts.
This commit is contained in:
Joey Yakimowich-Payne 2026-04-21 16:57:42 -06:00
commit 776c192874
No known key found for this signature in database
5 changed files with 687 additions and 343 deletions

View file

@ -3,7 +3,7 @@ import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
name: "chess",
include: ["src/**/*.test.ts", "tests/**/*.test.ts"],
include: ["src/**/*.test.ts", "src/**/*.test.tsx", "tests/**/*.test.ts"],
environment: "happy-dom",
},
});