Skip to content

feat(DateInput, DateTimeInput): report typed rejections through onEntryErrorChange - #11311

Merged
nynexman4464 merged 7 commits into
mainfrom
nynexman4464/feat/date-entry-error-change
Nov 12, 2026
Merged

nynexman4464 merged 7 commits into
mainfrom
nynexman4464/feat/date-entry-error-change

Conversation

@nynexman4464

@nynexman4464 nynexman4464 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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 day dateConstraints rules out), the field's own message replaces the app's status, and nothing tells the app why the text was refused: onChange is not called and no rejection kind is reported.

  • Why does it happen? useTypedDateField sets fieldStatus = typedStatus ?? status, and the rejection stays inside the hook.
  • Why does it hurt? A form with its own validation copy (its own language and tone, one line for a range rule, "Pick a date in your contract period") shows two voices, and the only way to react is to match Astryx's translated text, which changes with the locale and the release.
  • Why does it matter? People see an error the product did not write and cannot change, and apps carry patches that swap the precedence to get their message back.

Problem and solution fit

  • onEntryErrorChange gives the app a locale-independent kind, the typed text, and the Gregorian ISO date when the text names one, so the app can word the message.
  • Opt-in precedence. 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 hides a rejection. Without the callback, nothing changes.
  • Reports without an input event. A new min, max, dateConstraints, or value, 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 reports null. A status that the app derives from the callback never goes stale.
  • Announcements. Each message is announced once. When a rejection starts while the app's winning error message stays the same (for example "Required" already showing), no status change announces it, so the field's own alert announces that message once. Inside an InputGroup (where DateInput renders no Field) the field's alert carries the winning message, so a rejection is never silent.

Current specification

  • Maintainer decision on [Bug] DateInput, DateTimeInput: a typed date's error replaces the host's status, and nothing reports why #10366 (latest comment), which this pull request implements.
  • component:DateInput FR20, AR3, Public contract and Compatibility rows, and the Compatibility and migration bullet: changed here to state the prop, the DateInputEntryError type, the reports, and the precedence and announcement rules. Owner-gated; needs /approve-spec.
  • component:DateTimeInput FR11, AR5, and the matching rows: changed here the same way. Owner-gated.
  • spec:AST-111 FR11 and AR3 are unchanged: a rejection still shows and announces, and each kind keeps its own catalog message.
  • architecture:react-component-runtime INV2 and INV3 (routed by pnpm specs:for for the Effects): handlers report the rejections they cause; one Effect reports prop-driven changes and one reports null at unmount. Both name what they sync and are idempotent.

Public delta and caller burden

  • New optional prop on DateInput and DateTimeInput: onEntryErrorChange?: (error: DateInputEntryError | null) => void.
  • New exported type DateInputEntryError, from both the DateInput and the DateTimeInput entries (beside DateInputStatus and DateTimeInputStatus):
    • kind: 'unreadable' | 'incomplete' | 'nonexistent' | 'outOfRange' | 'unavailable' (outOfRange is before min or after max; unavailable is a day dateConstraints rules out; for DateTimeInput the bounds are the dates of min and max)
    • text: string
    • date?: ISODateString (set for outOfRange and unavailable)
  • Behavior with the callback: see above. Without it: unchanged (typedStatus ?? status), with one exception for every DateTimeInput: 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's status meanwhile.
  • Accessibility: aria-invalid stays as it is while a rejection stands. No theming change. No default changes.
  • The native and touch pickers take no typed text, so they report no rejection, and the prop never reaches their DOM. In DateTimeInput, the native date control keeps the same field instance; while it shows, kept typed text and its rejection wait for the typed field (the field status shows the app's status), and the callback receives null.

Before (the app cannot word the message):

<DateInput label="Due" value={date} onChange={setDate} max="2026-12-31"
  status={{type: 'error', message: 'Pick a date this year'}} />
// Typing 01/05/2027 shows "Enter a date on or before December 31, 2026".

After:

const [entryError, setEntryError] = useState<DateInputEntryError | null>(null);
<DateInput label="Due" value={date} onChange={setDate} max="2026-12-31"
  onEntryErrorChange={setEntryError}
  status={entryError?.kind === 'outOfRange'
    ? {type: 'error', message: 'Pick a date this year'}
    : undefined} />
// Typing 01/05/2027 shows and announces "Pick a date this year".

Caller decisions: whether to pass the callback, and which kinds to word. A caller that passes it but sets no error status sees the field's own messages, as today.

Design and alternatives

  • A rejection that a handler causes (typing, Enter, blur, calendar pick) reaches the caller from that handler, in the same update, so the caller's status and the rejection render together. A rejection that a prop change causes is reported from an Effect after the render, with a ref so that an unchanged rejection never reports twice. An unmount cleanup reports null when a reported rejection still stands.
  • Until the caller has received a prop-driven rejection, the field keeps the caller's current status for that one render. Without this, the field would show and announce its own message, then the app's message right after (for example when a disabled field with kept rejected text becomes editable again). If the caller sets no error status, the field's message shows on the next render.
  • The field records the error message its status showed while no rejection stood. When a rejection starts and the caller's winning message is that same message, the field's alert carries it, once; a change of the shown message during the rejection ends the repeat, because Field announces the change. The record updates during render, behind a ref gate, like the existing value check, so no Effect is involved.
  • Rejected: any app status wins. A standing warning or success would hide a rejection behind non-error styling.
  • Rejected: swap the precedence for every caller. It changes released behavior for apps that rely on the field's own message.
  • Rejected: report only from input, Enter, and blur. A derived status goes stale after a 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, incomplete on blur only, nonexistent, outOfRange with date, unavailable with date); null on typing a valid date and on a calendar pick; a max change that invalidates kept text and then validates it again; disabling and re-enabling; a new value; 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 new max starts; 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; warning and success never 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; null when a native or bottom-sheet presentation 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 datetime max; max change, disabling, no repeat; app error shown and announced once; an unchanged app error announced once through the date alert; null when a native or bottom-sheet presentation takes over during a rejection; warning never 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 rejection
  • Announcements are read from the shared assertive live region with a MutationObserver, so a doubled or joined announcement fails.
  • Mutation checks: removing the one-render hold makes "never shows or announces the field message before the app error that a new max starts" fail; removing the alert repeat makes both "announces an unchanged app error once …" cases fail; removing the unmount report makes the bottom-sheet (and DateInput native) "reports null when …" cases fail; letting the DateTimeInput native date control keep the typed rejection makes its native case 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

pnpm exec vitest run packages/core/src/DateInput packages/core/src/DateTimeInput packages/core/src/DateRangeInput packages/core/src/PowerSearch packages/core/src/docPropLiterals.test.ts
#   43 files, 1712 tests passed
pnpm exec tsc --noEmit -p packages/core                # passes
ASTRYX_STRICT_LINT=1 pnpm exec eslint <changed .ts/.tsx files>   # 0 problems
pnpm exec prettier --check <changed files>             # clean
pnpm check:knowledge                                   # records and templates aligned
pnpm specs:for --diff origin/main                      # routes react-component-runtime INV2, INV3, INV5, INV6 for the Effects
node scripts/pre-review.mjs --base origin/main --head HEAD   # 1573 authored lines, 0 findings, clean merge
node scripts/release/changeset-coverage.mjs pr --base origin/main --head HEAD --released v0.7.13   # passes (latest release tag in this checkout)

The pre-commit hook (lint-staged and pnpm check:repo) passed.

Writing rubric results

docs/specs/components/DateInput/DateInput.spec.md

R1 narration: none; the added sentences state behavior in the present tense ("receives", "shows and announces", "reports null", "announces that message once").
R2 research: none; the rejected alternatives live in this description, not the record.
R3 evidence: the FR20/AR3/AR9 verification cell adds test-case names; no pull request, issue, or commit.
R4 rejected alternatives: none added to the record.
R5 change references: none added. One existing: the FR6 verification cell quotes a test title that ends in "(#5074)"; it is the test's literal name, outside this change, and left as is.
R6 open questions: none; Open questions stays "None."
R7 project status: none; no build-status or sequencing words in the added text.

docs/specs/components/DateTimeInput/DateTimeInput.spec.md

R1 narration: none; FR11, AR5, and the Public contract and Compatibility rows state the prop, the reports, and the precedence and announcement rules in the present tense.
R2 research: none.
R3 evidence: the FR11/AR5 verification cell adds test-case names; no pull request, issue, or commit.
R4 rejected alternatives: none added.
R5 change references: none.
R6 open questions: none; Open questions stays "None."
R7 project status: none.

…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.
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 12, 2026 4:32am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 11, 2026
@astracat-bot

astracat-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 12, 2026, 4:53 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 onEntryErrorChange and a caller error message that does not change when a rejection starts, the new rejection is announced nowhere (useTypedDate.ts:456 empties 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 presentation changes while a rejection is reported, the typed field unmounts without reporting null (DateInput.tsx:1167-1189, DateTimeInput.tsx:2140-2152), so a caller's derived error status stays on a surface with no rejection; report null on that unmount or narrow the "never goes stale" claim.
  • DateEntryError and its kind, text and date members 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 null when 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-461 reduce 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-invalid is unchanged while a rejection stands: verified (DateInput.tsx:1004).
  • Description, DateEntryError is exported from the DateInput entry, and DateTimeInput's bounds are the dates of min and max: 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).

Automated review (maintainer link)

Comment thread packages/core/src/DateInput/index.ts Resolved
…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.
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec e14fab2

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 7e47b53

Storybook · Sandbox · built from this PR's head

Modified components

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.

Component · story Before After Diff
DateInput · All Variations (neutral, light) before frame after frame diff frame
DateInput · All Variations (neutral, dark) before frame after frame diff frame
DateInput · Open Calendar Audit (neutral, light) before frame after frame diff frame
DateInput · Open Calendar Audit (neutral, dark) before frame after frame diff frame
DateInput · Open Calendar Audit (probe, dark) before frame after frame diff frame
DateInput · Open Calendar Audit (probe, light) before frame after frame diff frame
DateInput · Cleared Calendar Selection (neutral, light) before frame after frame diff frame
DateInput · Default (neutral, light) before frame after frame diff frame
DateTimeInput · Cleared Calendar Selection (neutral, light) before frame after frame diff frame
DateTimeInput · Default (neutral, light) before frame after frame diff frame
DateInput · Cleared Calendar Selection (neutral, dark) before frame after frame diff frame
DateInput · Default (neutral, dark) before frame after frame diff frame

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

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:1066 now hides a kept typed rejection for every DateTimeInput while its native date control replaces the typed date field (the field shows the caller's status until 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-455 and 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-505 and 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:2152 and 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-invalid is unchanged while a rejection stands. Verified (isInvalid is 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.

Automated review (maintainer link)

Comment thread .changeset/date-entry-error-change.md Resolved
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 9145c9c

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 status docs (the JSDoc in DateInput.tsx and DateTimeInput.tsx, and the English, Chinese and dense status entries in both .doc.mjs files) say the field shows its own message whenever typed text is rejected, but unreadable text 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, both index.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.md and DateTimeInput.spec.md: clear.
  • Files DateInput.tsx and DateTimeInput.tsx: the status JSDoc finding; the wiring is clear.
  • Files DateInput.doc.mjs and DateTimeInput.doc.mjs: the status entries finding.
  • File useTypedDate.ts: clear.
  • Files DateInput/index.ts and DateTimeInput/index.ts: clear.
  • Files DateInput.test.tsx and DateTimeInput.test.tsx: clear, with the one optional case above.

Automated review (maintainer link)

@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 5dea8e3

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, both index.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-invalid stays while a rejection stands, and no theming or default changes: verified.
  • Claim: the status docs 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.md and DateTimeInput.spec.md: clear.
  • File useTypedDate.ts: clear.
  • Files DateInput.tsx and DateTimeInput.tsx: clear.
  • Files DateInput.doc.mjs and DateTimeInput.doc.mjs: clear.
  • Files DateInput/index.ts and DateTimeInput/index.ts: clear.
  • Files DateInput.test.tsx and DateTimeInput.test.tsx: clear.

Automated review (maintainer link)

@nynexman4464
nynexman4464 marked this pull request as ready for review November 11, 2026 23:50
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 38a94c0

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, both index.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:1068 and 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-invalid stays while a rejection stands, and no theming or default changes: verified (useTypedDate.ts:698).
  • Claim: the status docs 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.mjs files).
  • 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.md and DateTimeInput.spec.md: clear.
  • File useTypedDate.ts: clear.
  • Files DateInput.tsx and DateTimeInput.tsx: clear.
  • Files DateInput.doc.mjs and DateTimeInput.doc.mjs: clear.
  • Files DateInput/index.ts and DateTimeInput/index.ts: clear.
  • Files DateInput.test.tsx and DateTimeInput.test.tsx: clear.

Automated review (maintainer link)

github-actions Bot added a commit that referenced this pull request Nov 12, 2026
github-actions Bot added a commit that referenced this pull request Nov 12, 2026
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec d5e22ad

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_MESSAGE in DateInput.test.tsx and DateTimeInput.test.tsx still 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.tsx and DateTimeInput.test.tsx: stale expected message (above).

Automated review (maintainer link)

github-actions Bot added a commit that referenced this pull request Nov 12, 2026
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 7e47b53

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: onEntryErrorChange reports why the field rejects typed text, with a locale-independent kind, the typed text, and a Gregorian ISO date for outOfRange and unavailable (useTypedDate.ts:58-76, :158-182; "reports a %s rejection").
  • Verified: DateInputEntryError is 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, dateConstraints or value, 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 null when 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 error status with a message is shown and announced instead of the field's message, and warning or success never 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 onEntryErrorChange cases 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.mjs files, both test files, DateInput.tsx, DateTimeInput.tsx, useTypedDate.ts and both index.ts files: clear, and consistent with each other.

Automated review (maintainer link)

@nynexman4464
nynexman4464 merged commit 4705e67 into main Nov 12, 2026
72 checks passed
@github-actions
github-actions Bot deleted the nynexman4464/feat/date-entry-error-change branch November 12, 2026 06:06

This branch was successfully deployed

1 active deployment
Preview — 7e47b539 Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] DateInput, DateTimeInput: a typed date's error replaces the host's status, and nothing reports why

1 participant