Repository navigation
Conversation
|
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.
This needs an engineering owner's decision before it can be approved, and one existing test needs updating.
- Owner decision needed: the DateInput and DateTimeInput component specs (DateInput FR20/AR3, DateTimeInput FR11/AR5) require these rejections and their messages, but they do not say whether the error appears as soon as the typed date is complete (current behavior) or on Enter or blur (this PR). An engineering owner needs to settle that, for example by amending FR20 or by commenting
/approve-specwith this PR's head commit. You are not expected to write the spec yourself. - Blocking:
packages/core/src/DateTimeInput/DateTimeInput.calendar.test.tsx:92-100("shows an out-of-range error with the bounds in the calendar") now fails because it expects the error before Enter or blur. Assert that nothing shows after typing, then callfireEvent.blur(input)(or press Enter) beforeexpectShown, as the updated DateInput tests do.
The DateInput side behaves as described: the edited tests fail without your change and pass with it, and after Enter or blur the field looks and reads exactly as before. Unreadable text such as abc still announces "Invalid date" immediately, so the owner decision should cover whether that difference is intended. CI has not run on this head yet; a maintainer adds the ci:run label so it runs.
|
Applied the concrete test correction from review in |
700391a to
d01108e
Compare
|
Updated the branch at d01108e and rebased it onto current main. The requested DateTimeInput calendar test now stays silent after typing the out-of-range value and asserts the bounds message only after blur. While rerunning the full date suites, I also found and corrected two stale DateInput assertions for provider-calendar invalid dates and date constraints; both now verify no error while typing and the expected announcement after blur. Verification:
The remaining item is the engineering-owner decision on whether nonexistent and out-of-range typed dates should be announced on Enter or blur; the implementation and tests now consistently enforce the proposed behavior. |
There was a problem hiding this comment.
Changes requested: the DateInput and DateTimeInput specs now keep today's error timing as the default, so this change needs to become the opt-in option the maintainers chose.
- Regression: since the last review, the maintainers ruled on #10367 and recorded in the DateInput spec (FR24 and FR25, which DateTimeInput FR15 and FR16 follow) that, by default, a nonexistent or out-of-range typed date still shows its error as soon as it is complete, so making
typedDateErrorwait for Enter or blur for every field (packages/core/src/DateInput/useTypedDate.ts:148-152), with the test edits and changeset that assert it, now contradicts the spec: restore(result.isComplete || isCommitted)as the default and deliver the deferral underentryErrorBehavior="blur-or-enter"as FR24 describes, or close this in favour of that work.
The earlier failing DateTimeInput out-of-range test is fixed at this head. You do not need to write or change a spec: the option's contract is already recorded. CI has not run on this head yet; a maintainer adds the ci:run label so it runs.
d01108e to
3f1e71e
Compare
|
Addressed the latest validation-timing review in 3f1e71e.
Verification: calendar suites pass (54/54), the DateInput/DateTimeInput entry-error tests pass, and Core typecheck plus repository pre-commit checks pass. The maintainer/spec-owner gate remains open on the PR. |
There was a problem hiding this comment.
Changes requested. The new entryErrorBehavior prop, its 'complete' default and the exported EntryErrorBehavior type match the option chosen on #10367, but 'blur-or-enter' does not yet behave as the DateInput and DateTimeInput specs describe.
- DateTimeInput's time segment and native segments ignore the prop: under
'blur-or-enter'the time field still setsaria-invalidand announces "Invalid time" on every keystroke (DateTimeInput.tsx:878-887,:2006-2024), while DateTimeInput FR15 says both segments follow it, and the prop's docs narrow it to "the date segment". - Under
'blur-or-enter', editing a revealed rejection to another rejected date (2/30/2026to2/31/2026) hides the error and callsonEntryErrorChange(null), becausehandleChangeclears the commit flag on every edit (useTypedDate.ts:628-640); DateInput FR24 keeps the error, without a new announcement, until the next Enter or blur. - DateInput's native control never receives the prop (
DateInput.tsx:1189-1190), so on a coarse pointer it still marks and announces a refused date at once, although FR24 holds native rejections until blur and the prop's JSDoc says every signal is held. - Under
'blur-or-enter', kept unreadable text stays pending (useTypedDate.ts:670-689), so a form posts the typed text under the field'snameand Enter never submits, while FR25, which FR24 applies here, puts the committed date in a hidden input and lets the next Enter submit. - The title, description and changeset still describe a fix that defers errors by default: please retitle (for example
feat(DateInput, DateTimeInput): add entryErrorBehavior to hold typed-date errors until Enter or blur), tag the changeset[feat]as other new props are, and update the description's Change and Evidence sections.
Tests for an edit after a revealed rejection, a native edit and the time segment under 'blur-or-enter' would cover these cases. Smaller notes are inline.
Claims and files checked
- Changeset: both components support an opt-in
'blur-or-enter'that holds typed rejection signals until Enter or blur, keeping the'complete'default. Partly false: only typed date text is held, not DateTimeInput's time segment or the native controls, and[fix]labels a new option. - Description: fixes #10367 by deferring nonexistent and out-of-range errors until commit. False as a default; true only under the new value.
- Description: before the change, a complete invalid date showed an error while typing. True, and still true by default.
- Description: that did not match the commit timing of unreadable text. Partly false: unreadable text is already announced at once; only its visible status waits.
- Description: nonexistent and out-of-range results stay quiet while editing. True under
'blur-or-enter'(useTypedDate.ts:146-148), but an edit also hides a revealed rejection. - Description: those errors show and are announced at Enter or blur. Verified for typed text (
useTypedDate.ts:697-707). - Description: immediate handling of unreadable input is preserved. True by default; false under
'blur-or-enter', which holds it. - Description:
onChangefor valid dates is unchanged. Verified (useTypedDate.ts:641-646). - Description: regression coverage for Gregorian, Japanese, Persian and Buddhist calendars. Verified (
DateInput.calendar.test.tsx). - Description: a patch changeset for core. Verified.
- Description evidence table: no error while typing a complete nonexistent or out-of-range date. False by default; true under
'blur-or-enter'. - Description testing results (suites, typecheck, lint, pre-commit). Not verified: CI has not run on this head.
- Files:
.changeset/defer-date-rejection-until-commit.md([fix]tag);DateInput.calendar.test.tsx(clear; default calendar cases now run only under the new value);DateInput.doc.mjs(promises every signal is held, native control);DateInput.tsx(native control);DateInput/index.ts(clear);useTypedDate.ts(edit after a revealed rejection, kept unreadable text);DateTimeInput.calendar.test.tsx(clear);DateTimeInput.doc.mjs(scopes the prop to the date segment);DateTimeInput.tsx(time segment and native segments);DateTimeInput/index.ts(clear).
| // Keep a rejection that was held while typing long enough to explain it | ||
| // at the commit that reveals it. The shipped complete behavior continues | ||
| // to drop unreadable text after announcing it while typing. |
There was a problem hiding this comment.
Non-blocking (comment style): "long enough to explain it" is vague, and the second sentence narrates another branch. Suggested: "Unreadable text stays so the commit can show why. Under 'complete', the code below drops it."
| it('reads Japanese era dates and rejects a year outside its era', () => { | ||
| const {input, onChange, container} = renderField('en', { | ||
| calendar: 'japanese', | ||
| entryErrorBehavior: 'blur-or-enter', |
There was a problem hiding this comment.
Non-blocking: this and five other existing rejection cases now run only under 'blur-or-enter', and "announces a different message for each kind of rejection" commits before it asserts, so the calendar suites no longer check the default's immediate reveal for these calendars. Running each case under both values keeps both timings covered.
|
Addressed the concrete requested changes in
Verification: focused deferred tests 6/6 passed; Core typecheck, targeted ESLint/Prettier, and commit preflight passed. The unrelated existing Korean locale hour-cycle assertion remains the only failure in the broader DateTimeInput suite. The engineering-owner/spec approval gate and |
There was a problem hiding this comment.
Recommending that this pull request be closed: #11485, merged to main on 2026-11-13, already ships entryErrorBehavior on DateInput and DateTimeInput (and on TimeInput, with FormLayout's defaultEntryErrorBehavior), and this branch now conflicts with main. Thank you for pushing #10367 forward; the behavior built here is what main now provides. If you find a case that main's version still gets wrong, a new, focused pull request from main is the way to land it.
- Regression: since the last review, #11485 landed the same prop, type and release note on
main, and this branch conflicts with it in 9 files (DateInput.tsx,DateInput.doc.mjs,useTypedDate.ts,NativeDateField.tsx,NativeDateField.test.tsx,DateTimeInput.tsx,DateTimeInput.doc.mjs,NativeDateSegment.tsx,NativeTimeSegment.tsx), so nothing here remains to land. - Regression: the field resolves only its own prop, else
'complete'(DateInput.tsx:612,DateTimeInput.tsx:709), while the validation-timing spec (AST-117 FR2, DateInput FR24) also reads the nearest FormLayout'sdefaultEntryErrorBehavior. - Under
'blur-or-enter', Enter in a native date or time control reveals nothing until blur (NativeDateField.tsx:403-405and both native segments), while AST-117 FR4 holds a native value only to the next Enter or blur. - Under
'blur-or-enter', the time segment's first Enter on a rejected time blocks the form's submission (DateTimeInput.tsx:1690-1696, asserted by the new form test), while DateTimeInput FR16 says Enter there commits and is not prevented beyond that, so the form submits.
Claims and files checked
- Changeset: both components get an opt-in
'blur-or-enter'that holds typed and native rejections until Enter or blur, keeping the'complete'default. Partly false: native controls hold only until blur (NativeDateField.tsx:403-405), andmainalready carries a release note for this feature. - Description: the shipped
completebehavior stays the default. True for rejection timing ("keeps complete-date rejection immediate by default"); under the default, Enter in the time segment now also commits the typed time (DateTimeInput.tsx:1672-1689). - Description: the default still reveals complete-date and native rejections immediately. Verified (
useTypedDate.ts:149-161; native'complete'path unchanged). - Description: under
'blur-or-enter', typed and native rejections stay quiet while editing and appear at Enter or blur. True for typed dates and times (new tests pass); false for Enter on native controls. - Description: editing a revealed rejection into another rejected value keeps it without a second announcement. Verified for
aria-invalidand the callback ("keeps a revealed rejection when another rejected date is edited"); the announcement is not asserted. - Description: kept unreadable text leaves form submission, a hidden input carries the committed date, and the next Enter submits. Verified for DateInput ("keeps the committed form value while deferred unreadable text is shown"); DateTimeInput's copy is untested.
- Description: adds a public
nameprop. Verified:name?: stringis new on both prop types. - Description: docs and changeset updated. Verified; the
.doc.mjsfiles are authored docs. - Description evidence table. Matches the code except native Enter and the time segment's form submission.
- Description testing results. The six changed test files pass here (482 tests); the reported Korean locale failure did not reproduce in them.
- Files:
.changeset/defer-date-rejection-until-commit.md(duplicatesmain's release note);DateInput.calendar.test.tsx(clear);DateInput.doc.mjs(conflicts);DateInput.test.tsx(clear);DateInput.tsx(FormLayout default, conflicts);NativeDateField.test.tsx(blur only, conflicts);NativeDateField.tsx(native Enter, conflicts);DateInput/index.ts(clear);useTypedDate.ts(secondEntryErrorBehavior, conflicts);DateTimeInput.calendar.test.tsx(clear);DateTimeInput.doc.mjs(conflicts);DateTimeInput.test.tsx(asserts the blocked first Enter);DateTimeInput.tsx(time-segment Enter, FormLayout default, conflicts);NativeDateSegment.tsxandNativeTimeSegment.tsx(native Enter, conflict);NativePickerSegments.test.tsx(blur only);DateTimeInput/index.ts(clear).
|
Closing this branch because #11485 is merged to main and already ships the entryErrorBehavior implementation for DateInput, DateTimeInput, TimeInput, and FormLayout. Keeping this PR open would duplicate and conflict with the shipped code. Any remaining regression should be raised as a new focused PR from current main. |
Primary intent
Add the opt-in
entryErrorBehavior="blur-or-enter"behavior requested by #10367 while keeping the shippedcompletebehavior unchanged by default.User impact
With the default
entryErrorBehavior="complete", DateInput and DateTimeInput continue to reveal complete-date and native-control rejections immediately, as they did before this PR.Consumers that choose
entryErrorBehavior="blur-or-enter"get a quieter editing flow: typed date/time and native date/time rejections stay quiet while the value is being edited, then reveal on Enter or blur. If a revealed value is edited to another rejected value, the rejection stays visible without a second announcement until the next Enter or blur.When deferred unreadable date text is kept in a pointer field, the visible input is removed from form submission and a hidden input carries the last committed date. The following Enter is therefore available to submit the surrounding form.
Authority
Change
completedefault and add the publicentryErrorBehavioroption to both components.blur-or-enterconsistently to typed date text, typed time text, and native date/time controls.nameprop to the date fields and preserve the committed form value while unreadable text is held.Evidence
completedefaultblur-or-enterThis is a validation-state and form-semantics change rather than a layout change, so a screenshot would not reliably distinguish the states. The regression tests assert the user-visible value,
aria-invalid, live-region messages, callback count, hidden form control, and Enter submission behavior.Scope
Components: DateInput, DateTimeInput, native date/time segments, shared typed-date validation.
Testing
pnpm -F @astryxdesign/core typecheck— passed.pnpm check:*, including changesets, package boundaries, i18n, fixtures, and sync checks) — passed.The concrete review findings are addressed in
e591746ef. The remaining maintainer action is the existing engineering-owner/spec approval gate and CI run label.