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.
Thanks for the focused fix and the clear before/after tests — clearing a date input after a calendar pick no longer leaves the old date selected on reopen.
Approval needs one maintainer decision first: this introduces value={null} on Calendar as the controlled “no selection” value (with undefined staying uncontrolled), and there is currently no governing Calendar spec for that distinction. A maintainer needs to provide or identify the spec that settles Calendar controlled-empty in both single and range modes, including how it interacts with defaultValue and that onChange never emits null.
No other changes are requested: the select → clear → reopen behavior is covered for all three inputs, and existing uncontrolled use is preserved.
[Automated review]
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsDateInput (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression26 of 458 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 6 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
e5d7caf to
e27bf30
Compare
|
Thanks @cixzhang! After seeing yesterday's fixes in #7297 and #7298, I rebased this PR onto the latest main and removed the overlapping Calendar, DateRangeInput, and DateTimeInput changes. This now covers only the remaining DateInput controlled-empty boundary and the locale-consistency example, with regression tests. The DateInput fix follows the same |
There was a problem hiding this comment.
Thanks for narrowing this to the remaining DateInput piece: keeping the popover Calendar controlled while the field is empty means a cleared DateInput no longer reopens with the old date selected, matching the pattern DateTimeInput already uses on main. The new select → clear → reopen regression test covers exactly that outcome, so this automated review requests no changes; the pull request still needs the usual maintainer review before merging.
[Automated review]
User impact
After selecting a date through DateInput's calendar, clearing the field and reopening the calendar still shows the previous date as selected. This fix keeps the empty field and Calendar selection consistent.
Fixes #6934
Scope after rebase
Rebased onto
mainat2514d86d02ffa32b1c17b32523e1149eb86334feand removed the portions already covered by:The remaining change is the DateInput composition and the original locale-consistency example, with regression evidence and a scoped patch changeset. Calendar, DateRangeInput, and DateTimeInput have no diff against the rebase target.
Problem and solution fit
Calendar treats
undefinedas uncontrolled. Selecting a date updates its internal selection; passingundefinedafter DateInput clears lets that old selection become visible again.DateInput now passes
optimisticValue ?? nullto Calendar, following the same controlled-empty boundary used by DateTimeInput in #7298. DateInput's public value type,onChange(undefined)clear callback, optimistic change pipeline, and picker presentation stay unchanged.Expected behavior and authority
nullas controlled-empty and omitted/undefinedvalues as uncontrolled.Smallest restoration
nullonly at its Calendar boundary.ClearedCalendarSelectionStorybook play function, following [Component Audit] DateTimeInput: keep cleared calendars empty #7298's evidence pattern.Evidence
Core/DateInput/ClearedCalendarSelectionselects April 15, clears, reopens, and asserts an empty field with no selected day. Its final open-calendar frame is taggedvisual-baseline.Scope
Testing
pnpm build— passed.pnpm -F @astryxdesign/core typecheckandpnpm -F @astryxdesign/storybook typecheck— passed.pnpm check:repo) — passed; the user-reviewed patch is unchanged by the hooks.pnpm lint:strict --ignore-pattern 'assets/**'— passed. The plain command picked up a local, ignored generated bundle underassets/; that directory contains no tracked files. No repository lint rules or configuration were changed.pnpm test --maxWorkers=4— 22,668 passed, 2 failed, 2 expected failures, 40 skipped. All DateInput and related date-component suites pass. The only failures are the two taxonomy assertions inapps/storybook/.storybook/story-tree.test.ts, which read a pre-existing local Storybook index. Both failures were independently reproduced with the exactmainversion of that test and the same index; the test itself is unchanged. They are not reported as passing and are outside this fix.Core/DateInput/ClearedCalendarSelection— passed: empty field, reopened calendar, zero selected gridcells, no page errors.git diff --check— passed.