Repository navigation
fix(form): whole-form refine() errors block submit (#897) - #980
Conversation
A schema-level refine/superRefine with no path reports path [], which
parseValues dropped: the error map came back empty and an invalid form
submitted. Keep it under FORM_ERROR_KEY (''); the summary FormError shows
its message. AGENTS.md: subthemes' -on-main variables are real (the
audit's second finding was a false positive from the on-* note).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🔎 Gemini review ( Review metadatakind: gemini-review
schema: 1
model: gemini-3-flash-preview
pr: 980
head_sha: 502d6895d755754711839d3a6006e1344d22d94e
run_id: 45184878722
run_attempt: 1
created_at: 2026-11-23T13:32:53Z
diff_bytes: 11110
history_bytes: 0
omitted_generated_files: 2
review_chars: 726The logic changes in The regression tests in No defects identified. |
Closes #897 (weekly Gemini audit, Form Controls — Composite).
Finding 1: confirmed, fixed
A whole-form
.refine()/.superRefine()with nopathreportspath: [].parseValuesdropped it (if (fieldPath && ...)), so the error map came back empty andhandleSubmittreated an invalid form as valid:onSubmitran with raw values that had failed the schema.parseValuesnow keeps a pathless issue under the exportedFORM_ERROR_KEY('', the path it joins to; no field name is empty). The form is invalid,form:erroredcarries it, and submit is blocked.<FormError>(noname) shows that message instead of the generic text.Form.test.tsx: mismatched passwords block submit and show "Passwords must match"; matching ones submit.Finding 2: false positive, AGENTS.md corrected
--ai-subtheme-error-on-mainis defined (harmonies.ts:446). The audit applied AGENTS.md's "the convention is-text, noton-*" note, which is true for the harmony roles but not for subthemes. That paragraph now names the subtheme exception and carries a three-part entry for this false positive.🤖 Generated with Claude Code