feat(calendar): inline field-level validation for the appointment form (PMS-578) #397

Merged
longjacksonle merged 2 commits from feat/PMS-578-appointment-inline-validation into main 2026-06-30 21:05:00 +02:00

PMS-578 (found in PMS-556 Calendar + PMS-557 Dispatch smoke)

The shared AppointmentFormModal reported required-field errors as a single top-of-form banner with no red outline on the offending field, diverging from the standard inline pattern.

(The fields already use the shared Input/Select/Textarea components - a prior change migrated them - so this PR is the validation-wiring half.)

Change

  1. Route validation to per-field signals (title_err, assignee_err, start_err, end_err) instead of the banner. Title + assignee are checked together so both surface at once; date/time parse + ordering errors land on the start/end field. Recurrence was already field-level.
  2. Wire those signals into the fields' error prop: Title, Assigned to, Start/End dates (all-day) and Start/End datetimes (timed) now show a red outline + message under the field.
  3. The top error banner now appears only for non-field failures (the save request failing).

Commits (small, logical)

  • handle_save: route errors to field signals
  • wire the field error props

Scope

The same modal backs both Calendar and Dispatch create/edit, so both are covered.

Verified

dx build clean (33s), no warnings, fmt clean. Dev app serves this branch.

Test

Calendar or Dispatch -> New appointment -> Save with a blank Title and no assignee: both fields show a red outline + inline message (no top banner). Enter a bad/!ordered date or time: the start/end field shows the error. A save-API failure still shows the top banner.

🤖 Generated with Claude Code

## PMS-578 (found in PMS-556 Calendar + PMS-557 Dispatch smoke) The shared `AppointmentFormModal` reported required-field errors as a single top-of-form banner with no red outline on the offending field, diverging from the standard inline pattern. (The fields already use the shared `Input`/`Select`/`Textarea` components - a prior change migrated them - so this PR is the validation-wiring half.) ## Change 1. Route validation to per-field signals (`title_err`, `assignee_err`, `start_err`, `end_err`) instead of the banner. Title + assignee are checked together so both surface at once; date/time parse + ordering errors land on the start/end field. Recurrence was already field-level. 2. Wire those signals into the fields' `error` prop: Title, Assigned to, Start/End dates (all-day) and Start/End datetimes (timed) now show a red outline + message under the field. 3. The top `error` banner now appears only for non-field failures (the save request failing). ## Commits (small, logical) - handle_save: route errors to field signals - wire the field `error` props ## Scope The same modal backs both Calendar and Dispatch create/edit, so both are covered. ## Verified dx build clean (33s), no warnings, fmt clean. Dev app serves this branch. ## Test Calendar or Dispatch -> New appointment -> Save with a blank Title and no assignee: both fields show a red outline + inline message (no top banner). Enter a bad/!ordered date or time: the start/end field shows the error. A save-API failure still shows the top banner. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Route required/format errors to per-field signals (title_err, assignee_err, start_err, end_err) instead of the single top-of-form banner. Title and assignee are now checked together so both surface at once; date/time parse + ordering errors set the start/end field. The `error` banner is left for non-field failures (the save request failing). Field signals are wired into the inputs in the next commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(calendar): show appointment validation inline under each field (PMS-578)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m19s
Create release / Create release from merged PR (pull_request) Has been skipped
8475ff6ff5
Wire the field-error signals into the shared components: Title, Assigned to (Select), Start/End dates (all-day) and Start/End datetimes (timed) now render a red outline + message under the offending field, matching the standard pattern. Recurrence was already field-level. The top banner now appears only for save failures.

Applies to both Calendar and Dispatch create/edit, which share this AppointmentFormModal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle scheduled this pull request to auto merge when all checks succeed 2026-06-30 21:04:14 +02:00
longjacksonle deleted branch feat/PMS-578-appointment-inline-validation 2026-06-30 21:05:00 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!397
No description provided.