You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5e0b13f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(codegen-ts-react): the blank-optional list names only fields with a scalar control (#223)
Regenerating the advanced-modeling example put `syllabus` (an array-of-VO jsonb) and
`instructorProfile` (a single VO jsonb) into `BLANK_OPTIONAL_FIELDS`. Neither can
ever hold `""` — one renders as a `useFieldArray` list and the other as a nested
block, so what they submit is an array or an object, and the normalizer's `!== ""`
guard skips both. Harmless today, and wrong in the direction that invites a real
bug: the list is a statement about which controls can be BLANK, so naming a field
that has no scalar control at all is a claim about something that does not exist.
The predicate was "optional and not a checkbox/image", which is too coarse. It now
also excludes `field.object` and any array field. On the example that takes the list
from five entries to the three that actually have a blankable control: an enum
`<select>`, a textarea, and a currency input.
The example is what caught it — its committed `src/generated/**` is drift-gated, so
it regenerates whenever a generator changes and a reviewer sees the real field list
for a real model. A fixture would not have; the two VO shapes only exist there.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DhpswkF1NvwxhFWMmdAT15
0 commit comments