feat(forms): consistent help/error spacing + persistent inline server errors #265
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/MAPPS-265-form-help-error-spacing-inline-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Normalize the help/error slot in the shared form controls (Input/Textarea/Select/Checkbox) so spacing and line-height match: every help/error paragraph now uses text-sm leading-5, and the Checkbox renders its help/error below the label with the same mt-1 spacing and gains an optional error prop so it lines up with the other controls.
Wire the server-side errors[] envelope back onto each field. On a failed submit the create/edit forms for companies, contacts, projects, and contracts now route every 422 field error from ApiError::field_errors() onto its own inline error prop, so the offending field keeps a persistent inline cue across re-render instead of only a banner/toast. Errors with no matching field, or a non-422 failure, still fall back to the top-of-form banner. The contact and project forms switch from the String-error helpers to the *_typed helpers so they carry the field-level envelope.
#MAPPS-265
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com