Repository navigation
feat(DateInput, DateTimeInput): report typed rejections through onEntryErrorChange - #11311
Conversation
…ryErrorChange DateInput and DateTimeInput take an optional `onEntryErrorChange`. It receives a `DateEntryError` (`kind`, the typed `text`, and the Gregorian ISO `date` for `outOfRange` and `unavailable`) each time the field's rejection of typed text changes, and `null` when the rejection ends. Prop changes that start, change, or end a rejection report too. With the callback, an app `error` status with a message is the message the field shows and announces; the field's own message is the fallback. A `warning` or `success` status never replaces a rejection. Without the callback, behavior does not change. Each message is announced once, and inside an InputGroup the field's alert carries the winning message. The DateInput and DateTimeInput records state the prop and the precedence rule. Fixes #10366.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Not ready to approve yet: the proposed DateInput and DateTimeInput spec changes need an engineering owner's decision, and three fixes are needed either way.
Spec decision needed: this pull request rewrites the DateInput (FR20, AR3) and DateTimeInput (FR11, AR5) specs. It adds onEntryErrorChange and DateEntryError and lets a caller error status replace the field's own rejection message, which reverses the current AR3 precedence. An engineering owner records that decision by commenting /approve-spec with the full head commit SHA, and the author may do so as an engineering owner.
Blocking:
- With
onEntryErrorChangeand a callererrormessage that does not change when a rejection starts, the new rejection is announced nowhere (useTypedDate.ts:456empties the field alert and Field only speaks a changed message), so either speak the caller message through the field alert in that case or correct the description's "a rejection still shows and announces" and AR3. - When the primary pointer or
presentationchanges while a rejection is reported, the typed field unmounts without reportingnull(DateInput.tsx:1167-1189,DateTimeInput.tsx:2140-2152), so a caller's derived error status stays on a surface with no rejection; reportnullon that unmount or narrow the "never goes stale" claim. DateEntryErrorand itskind,textanddatemembers are outside this pull request's stated scope (DateInput, DateTimeInput), so name it in the Scope components line for the owner decision or split it into its own pull request.
Smaller notes: DateEntryError is not re-exported from the DateTimeInput entry, and FR20 and FR11 still read as if the field's own message always shows.
Claims and files checked
- Changeset, the callback reports a locale-independent kind, the typed text, and the ISO date for out-of-range and unavailable days: verified (
useTypedDate.ts:158-182). - Changeset, it reports on prop changes, a calendar pick, disabling, Enter and blur, and
nullwhen the rejection ends: verified (useTypedDate.ts:479-497,:552-560,:597-599; tests). - Changeset, with the callback an error status with a message is the message shown and announced, and warning or success never replaces a rejection: verified (
useTypedDate.ts:444-461). - Changeset and description, without the callback nothing changes: verified (
useTypedDate.ts:448-461reduce to the old expressions). - Changeset and description, native and touch pickers never report and never receive the prop: verified (
DateInput.tsx:1164-1189,DateTimeInput.tsx:2146; tests). - Description, a rejection still shows and announces: false with the callback and an unchanged caller error message (
useTypedDate.ts:456). - Description, prop-driven reports keep a derived status from going stale: false for a surface switch (
DateInput.tsx:1167-1189). - Description, handlers report their own rejections in the same update and the Effect covers prop changes only, without repeats: verified (
useTypedDate.ts:463-491). - Description, the field keeps the caller's status for one render until the caller has a prop-driven rejection: verified (
useTypedDate.ts:440-451; test). - Description, inside an InputGroup the field alert carries the winning message: verified (
useTypedDate.ts:455-456; tests). - Description,
aria-invalidis unchanged while a rejection stands: verified (DateInput.tsx:1004). - Description,
DateEntryErroris exported from the DateInput entry, and DateTimeInput's bounds are the dates ofminandmax: verified (DateInput/index.ts:19,DateTimeInput.tsx:802-803). - Description, 21 DateInput and 6 DateTimeInput cases that read announcements from the live region: verified by reading the test files.
- Description, the test, typecheck, lint, format, knowledge and mutation results: not verified, because they could not be run here and CI has not run yet.
.changeset/date-entry-error-change.md: clear.docs/specs/components/DateInput/DateInput.spec.md: needs an owner decision; FR20 wording note.docs/specs/components/DateTimeInput/DateTimeInput.spec.md: needs an owner decision; FR11 wording note.packages/core/src/DateInput/DateInput.doc.mjs: clear.packages/core/src/DateInput/DateInput.test.tsx: clear.packages/core/src/DateInput/DateInput.tsx: surface-switch finding.packages/core/src/DateInput/index.ts: scope finding.packages/core/src/DateInput/useTypedDate.ts: unannounced-rejection and no-null-on-unmount findings.packages/core/src/DateTimeInput/DateTimeInput.doc.mjs: clear.packages/core/src/DateTimeInput/DateTimeInput.test.tsx: clear.packages/core/src/DateTimeInput/DateTimeInput.tsx: surface-switch finding; type not re-exported from its entry (note).
…d error status, report null when the typed field leaves - A rejection that starts while the caller's winning error message stays the same changes no status, so nothing announced it. The field's alert now announces that message once; a change of the shown message during the rejection ends the repeat, because Field announces the change. - When the typed field unmounts while a reported rejection stands (a presentation or pointer change shows the native or touch picker), it reports null. In DateTimeInput the native date control keeps the same field, so kept typed text and its rejection wait while it shows. - Rename DateEntryError to DateInputEntryError and export it from the DateTimeInput entry too. - DateInput FR20 and DateTimeInput FR11 say that a caller error status replaces the field's own messages when the callback is passed, and the records, docs, and changeset cover the two fixes.
|
/approve-spec e14fab2 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DateInput · Storybook | 193.4 kB (+644 B) · 17.0 kB CSS (0) | 6,224 (+186) | ✗ · ✓ · ✓ |
| DateTimeInput · Storybook | 216.0 kB (+571 B) · 18.7 kB CSS (0) | 3,641 (+10) | ✗ · ✓ · ✓ |
| PowerSearch | 299.9 kB (+629 B) · 24.7 kB CSS (0) | — | — · — · — |
Visual changes: 14 snapshots in 2 components
A change is a question for the reviewer, not a failure.
2 more are in the run's visual report.
Package size: @astryxdesign/core 7.37 MB packed (+9.5 kB); no new dependencies.
API changes: core +5 · ~0 · −0
5 API changes (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | core |
. · Components · component DateInput |
prop onEntryErrorChange?: (error: DateInputEntryError | null) => void |
<DateInput onEntryErrorChange={…} /> |
| + | core |
. · Components · component DateTimeInput |
prop onEntryErrorChange?: (error: DateInputEntryError | null) => void |
<DateTimeInput onEntryErrorChange={…} /> |
| + | core |
. · Types · interface DateInputEntryError |
interface DateInputEntryError |
import type {DateInputEntryError} from '@astryxdesign/core' |
| + | core |
./DateInput · Also exported from an earlier entry point · DateInputEntryError |
DateInputEntryError (.) |
import {DateInputEntryError} from '@astryxdesign/core/DateInput' |
| + | core |
./DateTimeInput · Also exported from an earlier entry point · DateInputEntryError |
DateInputEntryError (.) |
import {DateInputEntryError} from '@astryxdesign/core/DateTimeInput' |
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: the feature, its spec changes and its tests line up, but the release note misdescribes who is affected.
- The changeset says "Without the callback, nothing changes", but
DateTimeInput.tsx:1066now hides a kept typed rejection for every DateTimeInput while its native date control replaces the typed date field (the field shows the caller'sstatusuntil the typed field returns), so add a sentence saying that to the changeset and correct the description's "Without it: unchanged" line.
The three points from the previous review are fixed at this head. Two optional cleanups are in the inline comments: errorMessage can reuse the new isOutsideBounds, and one new comment says where the code runs rather than why.
Claims and files checked
- Claim: the callback reports a locale-independent kind, the typed text, and the ISO date for out-of-range and unavailable dates. Verified (
useTypedDate.ts:157-182, "reports a %s rejection"). - Claim: the error type is exported from both components. Verified (
DateInput/index.ts,DateTimeInput/index.ts). - Claim: it reports after new bounds, constraints or value, a calendar pick, disabling, Enter or blur, and null when the rejection ends or the typed field leaves. Verified (
useTypedDate.ts:507-555, the max, disabled, value, calendar-pick and surface-switch tests). - Claim: with the callback an error status with a message wins, and warning or success never hide a rejection. Verified (
useTypedDate.ts:448-455and tests). - Claim: a rejection under an unchanged error message is announced once more, and inside an InputGroup the field alert carries the winning message. Verified (
useTypedDate.ts:457-505and tests). - Claim: without the callback nothing changes. False for DateTimeInput (
DateTimeInput.tsx:1066). - Claim: the native and touch pickers never report and the prop never reaches their DOM. Verified (
DateInput.tsx:1167,DateTimeInput.tsx:2152and tests). - Claim: the base sets the field status to the typed status before the caller's status and reports nothing. Verified (base
useTypedDate.ts). - Claim: handler-caused rejections report from the handler, prop changes from one Effect, and unmount reports null, with a one-render hold. Verified (
useTypedDate.ts:433-549). - Claim:
aria-invalidis unchanged while a rejection stands. Verified (isInvalidis unchanged). - Claim: 25 new DateInput cases and 9 new DateTimeInput cases. Verified by reading the test files.
- Claim: the listed test, typecheck, lint and mutation runs pass. Not checked: the tests could not be run in this review.
.changeset/date-entry-error-change.md: finding above.docs/specs/components/DateInput/DateInput.spec.md: clear.docs/specs/components/DateTimeInput/DateTimeInput.spec.md: clear.packages/core/src/DateInput/DateInput.doc.mjs: clear.packages/core/src/DateInput/DateInput.test.tsx: clear.packages/core/src/DateInput/DateInput.tsx: clear.packages/core/src/DateInput/index.ts: clear.packages/core/src/DateInput/useTypedDate.ts: two optional cleanups.packages/core/src/DateTimeInput/DateTimeInput.doc.mjs: clear.packages/core/src/DateTimeInput/DateTimeInput.test.tsx: clear; no case covers the native-control status without the callback.packages/core/src/DateTimeInput/DateTimeInput.tsx: the change behind the finding above.packages/core/src/DateTimeInput/index.ts: clear.
…date control shows; reuse the bounds check
|
/approve-spec 9145c9c |
There was a problem hiding this comment.
Changes requested: onEntryErrorChange, its owner-approved spec changes and its tests line up, and the earlier changeset correction is in; two text fixes remain.
- Miss: the new
statusdocs (the JSDoc inDateInput.tsxandDateTimeInput.tsx, and the English, Chinese and densestatusentries in both.doc.mjsfiles) say the field shows its own message whenever typed text is rejected, butunreadabletext is never kept or shown as the status, only announced, so describe the cases that show (a date the field rejects, and unfinished text that Enter or blur keeps) and say unreadable text is announced. - The Testing section of the description reports 1532 authored lines from
pre-review, the count before the last commit (1551 now), so rerun the listed checks on the final head and update the transcript.
Optional: a DateTimeInput test without the callback that switches a kept rejection to presentation="native" and expects the caller's status would pin the one change every caller sees. CI has not run on this draft yet; it starts when the pull request is marked ready for review.
Claims and files checked
- Claim: the callback reports a locale-independent kind, the typed text, and the ISO date for range and constraint rejections, and the type is exported from both components: verified (
useTypedDate.ts, bothindex.ts). - Claim: it also reports after a new min, max, constraints or value, a calendar pick, disabling, Enter and blur, and reports null when the typed field leaves: verified (the hook's handlers and its two Effects; DateTimeInput's native mode).
- Claim: with the callback, an error status with a message wins, and warning or success never replace a rejection: verified.
- Claim: an unchanged error message is announced once more when a rejection starts, and inside an InputGroup the field's alert carries the winning message: verified.
- Claim: without the callback nothing else changes, except DateTimeInput while a native date control replaces the typed field: verified.
- Claim: the native and touch pickers never report and keep the prop off the DOM: verified.
- Claim: the change implements the maintainer decision on the linked issue: verified.
- Claim: 25 and 9 new test cases, with announcements read from the shared live region: verified; the mutation checks are consistent with the code, not run.
- Claim: the testing transcript's 1532 authored lines: false at this head (1551); the test, typecheck, lint and knowledge-check results were not rerun.
- File
.changeset/date-entry-error-change.md: clear. - Files
DateInput.spec.mdandDateTimeInput.spec.md: clear. - Files
DateInput.tsxandDateTimeInput.tsx: thestatusJSDoc finding; the wiring is clear. - Files
DateInput.doc.mjsandDateTimeInput.doc.mjs: thestatusentries finding. - File
useTypedDate.ts: clear. - Files
DateInput/index.tsandDateTimeInput/index.ts: clear. - Files
DateInput.test.tsxandDateTimeInput.test.tsx: clear, with the one optional case above.
…w; test the native-mode caller status
|
/approve-spec 5dea8e3 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this draft yet, and it starts when the pull request is marked ready for review.
onEntryErrorChange, its owner-approved spec changes and its tests line up, and both earlier fixes are in: the status docs now say which rejections show, and the testing transcript matches the change. No blocking finding remains.
Claims and files checked
- Claim: the callback reports a locale-independent kind, the typed text, and the ISO date for range and constraint rejections, and the type is exported from both components: verified (
useTypedDate.ts, bothindex.ts). - Claim: it also reports after a new min, max, constraints or value, a calendar pick, disabling, Enter and blur, and reports null when the typed field leaves or unmounts: verified (the hook's handlers and two Effects, DateTimeInput's native-mode wiring).
- Claim: with the callback, an error status with a message wins, a warning or success never replaces a rejection, and an error status without a message keeps the field's message: verified.
- Claim: until the app has a rejection that a prop change started, the field keeps the app's status for that render: verified.
- Claim: an unchanged error message is announced once more when a rejection starts, and inside an InputGroup the field's alert carries the winning message: verified.
- Claim: without the callback nothing else changes, except DateTimeInput while a native date control replaces the typed field: verified, including the new test for that case.
- Claim: the native and touch pickers never report and keep the prop off the DOM: verified.
- Claim:
aria-invalidstays while a rejection stands, and no theming or default changes: verified. - Claim: the
statusdocs say a rejected date and kept unfinished text show the field's message, and unreadable text is only announced: verified. - Claim: the change implements the maintainer decision on the linked issue: verified.
- Claim: 25 and 10 new test cases, with announcements read from the shared live region: verified by reading; the mutation checks are consistent with the code, not run.
- Claim: 1575 authored lines: verified; the test, typecheck, lint, formatting, knowledge, routing and changeset-coverage results were not rerun.
- Claim: the writing rubric results for both records: consistent with the added text.
- File
.changeset/date-entry-error-change.md: clear. - Files
DateInput.spec.mdandDateTimeInput.spec.md: clear. - File
useTypedDate.ts: clear. - Files
DateInput.tsxandDateTimeInput.tsx: clear. - Files
DateInput.doc.mjsandDateTimeInput.doc.mjs: clear. - Files
DateInput/index.tsandDateTimeInput/index.ts: clear. - Files
DateInput.test.tsxandDateTimeInput.test.tsx: clear.
|
/approve-spec 38a94c0 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet; its first run was refused while CI was full, and a re-run is in progress.
This head only merges main, and the pull request's own changes are unchanged: onEntryErrorChange, its owner-approved spec changes and its tests line up, and no blocking finding remains.
Claims and files checked
- Claim: the callback reports a locale-independent kind, the typed text, and the ISO date for range and constraint rejections, and the type is exported from both components: verified (
useTypedDate.ts:58,:158, bothindex.ts). - Claim: it also reports after a new min, max, constraints or value, a calendar pick, disabling, Enter and blur, and reports null when the typed field leaves or unmounts: verified (
useTypedDate.ts:418-426,:516-550,DateInput.tsx:842,DateTimeInput.tsx:1068,:2030). - Claim: with the callback, an error status with a message wins, a warning or success never replaces a rejection, and an error status without a message keeps the field's message: verified (
useTypedDate.ts:443-450). - Claim: until the app has a rejection that a prop change started, the field keeps the app's status for that render: verified (
useTypedDate.ts:439-440). - Claim: an unchanged error message is announced once more when a rejection starts, and inside an InputGroup the field's alert carries the winning message: verified (
useTypedDate.ts:458-500,DateInput.tsx:726). - Claim: without the callback nothing else changes, except every DateTimeInput while a native date control replaces the typed field: verified (
DateTimeInput.tsx:1068and its test). - Claim: the native and touch pickers never report and keep the prop off the DOM: verified (
DateInput.tsx:1169,DateTimeInput.tsx:2154). - Claim:
aria-invalidstays while a rejection stands, and no theming or default changes: verified (useTypedDate.ts:698). - Claim: the
statusdocs say a rejected date and kept unfinished text show the field's message, and unreadable text is only announced: verified (DateInput.tsx:338-343,DateTimeInput.tsx:505-510, both.doc.mjsfiles). - Claim: the change implements the maintainer decision on the linked issue and leaves the calendar-systems spec unchanged: verified.
- Claim: 25 and 10 new test cases, with announcements read from the shared live region: verified by reading; the mutation checks are consistent with the code, not rerun.
- Claim: 1575 authored lines: verified; the test, typecheck, lint, formatting, knowledge, routing and changeset-coverage results were not rerun here; at this head, lint passes in CI and the test run has not started.
- Claim: the writing rubric results for both records: consistent with the added text.
- File
.changeset/date-entry-error-change.md: clear. - Files
DateInput.spec.mdandDateTimeInput.spec.md: clear. - File
useTypedDate.ts: clear. - Files
DateInput.tsxandDateTimeInput.tsx: clear. - Files
DateInput.doc.mjsandDateTimeInput.doc.mjs: clear. - Files
DateInput/index.tsandDateTimeInput/index.ts: clear. - Files
DateInput.test.tsxandDateTimeInput.test.tsx: clear.
|
/approve-spec d5e22ad |
There was a problem hiding this comment.
Changes requested: onEntryErrorChange, its owner-approved DateInput and DateTimeInput spec changes and its feature code still line up, but merging main brought in the new "Enter a real date" wording, and the new tests still expect the old text.
- Regression: four new tests fail in CI at this head because
NONEXISTENT_MESSAGEinDateInput.test.tsxandDateTimeInput.test.tsxstill reads "This date does not exist in the Gregorian Calendar"; set both to "Enter a real date", and give the "leaves the field alert empty when the app error changes as the rejection starts" test app wording that differs from the field's own message. - Regression: the description's Testing transcript ("43 files, 1710 tests passed") no longer holds at this head; rerun the suites after the test fix and update it.
Nothing else is open: the feature code is unchanged since the last review, and the other new cases pass in CI.
Claims and files checked
- Claim: both components report typed rejections through the new callback, with the type exported from both entries: verified.
- Claim: the reported kinds, the typed text, and the ISO date for out-of-range and unavailable days: verified.
- Claim: reports follow new bounds, constraints, values, calendar picks, disabling, Enter and blur, and never repeat: verified.
- Claim: null when the rejection ends or the typed field is replaced by a native or touch surface: verified.
- Claim: with the callback, a caller error with a message wins, warning and success never hide a rejection: verified in code; its tests fail on the stale message.
- Claim: an unchanged caller error is announced once more when a rejection starts, and InputGroup's alert carries the winning message: verified.
- Claim: without the callback nothing changes, except DateTimeInput's native date control showing the caller status: verified.
- Claim: native and touch pickers never report and keep the prop off the DOM: verified.
- Claim: the component records' rows and rules are rewritten as described, and the calendar-systems record is not edited: verified.
- Claim: Effects follow the runtime rules (handlers report what they cause, one idempotent sync, one unmount report): verified.
- Claim: test counts of 25 and 10 cases and the live-region recording: verified.
- Claim: mutation checks: consistent with the code, not re-run.
- Claim: Testing transcript "43 files, 1710 tests passed": false at this head.
- Claim: typecheck and lint pass: verified by CI at this head.
- Claim: 1575 authored lines: verified.
- Files: changeset, both component records, both doc modules, both component sources, the shared hook and both index files: clear.
- Files:
DateInput.test.tsxandDateTimeInput.test.tsx: stale expected message (above).
|
/approve-spec 7e47b53 |
There was a problem hiding this comment.
Approved. The rewritten DateInput and DateTimeInput spec clauses are owner-approved for this head, and the test-wording problem from the last review is fixed: the new cases expect "Enter a real date", and CI's tests pass at this head.
There are no blocking findings and nothing else to change.
Claims and files checked
- Verified:
onEntryErrorChangereports why the field rejects typed text, with a locale-independentkind, the typedtext, and a Gregorian ISOdateforoutOfRangeandunavailable(useTypedDate.ts:58-76,:158-182; "reports a %s rejection"). - Verified:
DateInputEntryErroris exported from both components and the package root (DateInput/index.ts:19,DateTimeInput/index.ts:21,index.ts:60-61). - Verified: it reports after a new
min,max,dateConstraintsorvalue, a calendar pick, disabling, Enter or blur, never twice for one rejection (useTypedDate.ts:521-534,:549-553,:653-655; DateInput tests for each). - Verified: it reports
nullwhen the rejection ends or when a presentation or pointer change replaces the typed field (useTypedDate.ts:539-547; "reports null when a %s presentation replaces the field during a rejection"). - Verified: with the callback, an
errorstatus with a message is shown and announced instead of the field's message, andwarningorsuccessnever replaces a rejection (useTypedDate.ts:446-453; precedence tests). - Verified: a rejection that starts under an unchanged error message announces it once more (
useTypedDate.ts:461-503;DateInput.test.tsx:2489). - Verified: without the callback, DateInput keeps its old status and alert behavior (
useTypedDate.ts:450-453,:500-501; "without the callback, the rejection replaces an error status as it always has"). - Verified: every DateTimeInput shows the caller's status while a native date control replaces kept typed text (
DateTimeInput.tsx:1068; matching DateTimeInput test). - Verified: the native and touch pickers never report and never receive the prop in their DOM (
DateInput.tsx:1169-1191,DateTimeInput.tsx:2154; "keeps the prop off the DOM" tests). - Verified: the change implements the decision in the issue's latest comment, with the wording change landed separately.
- Verified:
aria-invalid, theming and defaults are unchanged (useTypedDate.ts:701; no theming entry changes in either doc). - Verified: 25 DateInput and 10 DateTimeInput
onEntryErrorChangecases exist and read announcements from the shared live region (DateInput.test.tsx:2119-2140). - Verified: 1,573 authored changed lines; lint, typecheck, changeset coverage and the tests pass in CI at this head.
- Verified: the records add no narration, project status or change references, and Open questions stays "None."
- Files: the changeset, both spec records, both
.doc.mjsfiles, both test files,DateInput.tsx,DateTimeInput.tsx,useTypedDate.tsand bothindex.tsfiles: clear, and consistent with each other.




































Fixes #10366 together with #11309, which changes the built-in wording.
User need
An app that words its own date errors cannot do it today. When DateInput or DateTimeInput rejects typed text (a date the calendar does not have, a date outside
min/max, a daydateConstraintsrules out), the field's own message replaces the app'sstatus, and nothing tells the app why the text was refused:onChangeis not called and no rejection kind is reported.useTypedDateFieldsetsfieldStatus = typedStatus ?? status, and the rejection stays inside the hook.Problem and solution fit
onEntryErrorChangegives the app a locale-independentkind, the typedtext, and the Gregorian ISOdatewhen the text names one, so the app can word the message.errorstatus with a message is the message the field shows and announces; the field's own message is the fallback. Awarningorsuccessstatus never hides a rejection. Without the callback, nothing changes.min,max,dateConstraints, orvalue, a calendar pick, disabling the field, and Enter or blur all report a changed rejection. When the typed field leaves while its rejection stands (a presentation or pointer change shows the native or touch picker, or the field unmounts), it reportsnull. A status that the app derives from the callback never goes stale.InputGroup(where DateInput renders no Field) the field's alert carries the winning message, so a rejection is never silent.Current specification
component:DateInputFR20, AR3, Public contract and Compatibility rows, and the Compatibility and migration bullet: changed here to state the prop, theDateInputEntryErrortype, the reports, and the precedence and announcement rules. Owner-gated; needs/approve-spec.component:DateTimeInputFR11, AR5, and the matching rows: changed here the same way. Owner-gated.spec:AST-111FR11 and AR3 are unchanged: a rejection still shows and announces, and each kind keeps its own catalog message.architecture:react-component-runtimeINV2 and INV3 (routed bypnpm specs:forfor the Effects): handlers report the rejections they cause; one Effect reports prop-driven changes and one reportsnullat unmount. Both name what they sync and are idempotent.Public delta and caller burden
DateInputandDateTimeInput:onEntryErrorChange?: (error: DateInputEntryError | null) => void.DateInputEntryError, from both the DateInput and the DateTimeInput entries (besideDateInputStatusandDateTimeInputStatus):kind: 'unreadable' | 'incomplete' | 'nonexistent' | 'outOfRange' | 'unavailable'(outOfRangeis beforeminor aftermax;unavailableis a daydateConstraintsrules out; for DateTimeInput the bounds are the dates ofminandmax)text: stringdate?: ISODateString(set foroutOfRangeandunavailable)typedStatus ?? status), with one exception for everyDateTimeInput: while a native date control replaces the typed date field, kept typed text and its rejection wait for the typed field, as in a disabled field, so the field shows the caller'sstatusmeanwhile.aria-invalidstays as it is while a rejection stands. No theming change. No default changes.status), and the callback receivesnull.Before (the app cannot word the message):
After:
Caller decisions: whether to pass the callback, and which kinds to word. A caller that passes it but sets no
errorstatus sees the field's own messages, as today.Design and alternatives
nullwhen a reported rejection still stands.valuecheck, so no Effect is involved.warningorsuccesswould hide a rejection behind non-error styling.min,max,dateConstraints,value, presentation, or disabled change.Evidence
jsdom tests, all new in the existing test files:
DateInput.test.tsx›DateInput onEntryErrorChange(25 cases): each kind (unreadable,incompleteon blur only,nonexistent,outOfRangewithdate,unavailablewithdate);nullon typing a valid date and on a calendar pick; amaxchange that invalidates kept text and then validates it again; disabling and re-enabling; a newvalue; no repeat for an unchanged rejection (blur, Enter, unrelated rerender, a new callback function each render); app error shown and announced once with the field alert empty; no field message shown or announced before the app error that a newmaxstarts; the field message once the app gives no error status; an unchanged app error ("Required") announced once through the field alert when a rejection starts, kept without a new announcement while the rejection stands, cleared when it ends, and announced again for the next rejection; the field alert empty when the app error changes as the rejection starts;warningandsuccessnever replace a rejection; an error status without a message keeps the field message; without the callback, today's behavior (the rejection replaces an error status, the alert announces uncommitted unreadable text); InputGroup alert carries the app error, or the field message when no app error wins;nullwhen anativeorbottom-sheetpresentation replaces the field during a rejection, to the latest callback; nothing at unmount when no rejection stands; native and bottom-sheet presentations never report and keep the prop off the DOM.DateTimeInput.test.tsx›DateTimeInput onEntryErrorChange(10 cases): kinds with the date of a datetimemax;maxchange, disabling, no repeat; app error shown and announced once; an unchanged app error announced once through the date alert;nullwhen anativeorbottom-sheetpresentation takes over during a rejection;warningnever replaces; without the callback unchanged; native and bottom sheet never report and keep the prop off the DOM.; without the callback, the caller's status shows while the native date control replaces a kept rejectionbottom-sheet(and DateInputnative) "reports null when …" cases fail; letting the DateTimeInput native date control keep the typed rejection makes itsnativecase fail; passing the prop to the native field, the DateInput sheet, or the DateTimeInput sheet makes the "keeps the prop off the DOM" cases fail.Evidence gap: no real-browser or screen-reader run; the announcement order is verified in jsdom only.
Scope
Components: DateInput, DateTimeInput
Testing
The pre-commit hook (
lint-stagedandpnpm check:repo) passed.Writing rubric results
docs/specs/components/DateInput/DateInput.spec.mddocs/specs/components/DateTimeInput/DateTimeInput.spec.md