Repository navigation
docs(spec): AST-043 — text-input is TimeInput-only - #6644
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
FR1 directly: DateInput/DateTimeInput presentation excludes text-input (type-level, five values); only TimeInput accepts it, for its released nativePicker=never typed field. FR5/Verification aligned. Narrows an unreleased value (AST-017 FR2).
83f7d4e to
ace63f2
Compare
PR Analysis ReportView Storybook for this PR · View Sandbox for this PR
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Thanks for the clear write-up. This change is internally consistent and, because the presentation prop has not shipped yet, narrowing it would not break any released caller.
Approval is on hold for a maintainer decision, though. The spec currently on main says the opposite: it gives DateInput and DateTimeInput a typed text field, requires a forced text-input value to render that surface, and requires six presentation values in docs, types, and controls. This proposal intentionally reverses that — five values on those two components, with text-input accepted only on TimeInput.
A maintainer needs to update that existing spec claim — FR1's six-value acceptance and FR5's six-value requirement — to the proposed TimeInput-only rule before this can be approved. No other changes are being requested for the intentional spec change itself, and no separate defects were found in the proposal.
[Automated review]
|
/approve-spec e5d270b |
There was a problem hiding this comment.
Thanks for the clear write-up. This change is internally consistent and, because the presentation prop has not shipped yet, narrowing it would not break any released caller.
Approval is on hold for a maintainer decision, though. The spec currently on main says the opposite: it gives DateInput and DateTimeInput a typed text field, requires a forced text-input value to render that surface, and requires six presentation values in docs, types, and controls. This proposal intentionally reverses that — five values on those two components, with text-input accepted only on TimeInput.
A maintainer needs to update that existing spec claim — FR1's six-value acceptance and FR5's six-value requirement — to the proposed TimeInput-only rule before this can be approved. No other changes are being requested for the intentional spec change itself, and no separate defects were found in the proposal.
[Automated review]
…43 (#6644) DateInput and DateTimeInput no longer accept presentation="text-input". Their `presentation` is `PickerPresentation = Exclude<InputPresentation, 'text-input'>` (five values); TimeInput keeps all six. - utils/inputPresentation: add `PickerPresentation`, `PickerPresentationSurface` and type-checked picker-only twins (`pickerPresentationFromNativePicker`, `effectivePickerPresentation`, `resolvePickerPresentation`). The general resolvers delegate to them, so TimeInput's mapping (`never` → `text-input`) is unchanged and the narrowing needs no cast and no runtime rejection. - DateInput / DateTimeInput: drop the `text-input` dispatch and the `hasPicker(s)` plumbing. PointerDateField / PointerDateTimeField are back to their released popover behavior (toggle button, combobox role and ARIA, popover render, click/ArrowDown open) unconditionally. - Presentation tests: remove the text-input cases; the FR4 precedence test now pits presentation="bottom-sheet" against nativePicker="always". - Docs (en/zh/dense) and Storybook controls drop 'text-input' for DateInput/DateTimeInput; the changeset spells out their five values against TimeInput's six. - Review follow-ups: DateTimeInput usage prose describes `presentation` (adaptive-native default) instead of `nativePicker`; the `nativePicker` Storybook control in all three stories is marked deprecated with its `presentation` mapping.
…AST-043) (#6628) * feat(core): add presentation to DateInput, DateTimeInput, TimeInput Implements spec:AST-043 (FR1-FR5, DEC-3): - presentation: text-input | popover | bottom-sheet | native | adaptive-bottom-sheet | adaptive-native (default), resolved by the shared utils/inputPresentation resolver per pointer. - FR2 fallback split: native is forced (no Astryx fallback); adaptive-native keeps released fallbacks (TimeInput seconds/increment, DateTimeInput per-segment). - FR3/FR4: nativePicker deprecated (@deprecated types, docs, dev warning) and keeps working exactly (TimeInput never -> text-input); presentation wins when both are set. - DEC-3: forced popover/bottom-sheet surfaces plus a new TimeInput bottom-sheet field (TouchTimeField, time wheels from DateTimeInput's sheet). - Docs (en/zh + dense), Storybook controls/showcases, CLI template, changeset, and astryx upgrade codemod migrate-native-picker-to-presentation (+ tests). Tests: 570 passing across Time/Date/DateTime suites incl. new Presentation.test.tsx per component; codemod + doc-prop suites pass. * fix(core): deprecated nativePicker=always keeps released fallbacks Route nativePicker=always without explicit presentation to legacy native mode (Time/DateTime): seconds, non-default increment/step, and preset options keep the Astryx field, exactly as released (AST-043 FR2/FR3). Explicit presentation=native stays forced with no fallback. Tests updated accordingly (suite green). * fix(cli): make nativePicker codemod mapping atomic Collect a value's static leaves before mutating any of them, so a mixed static/dynamic conditional (e.g. flag ? 'always' : mode) stays byte-identical instead of being half-migrated to an invalid nativePicker='native' when a sibling callsite migrates the file. Regression test covers the mixed-file case. * fix(cli): annotate collectStaticLeaves return type for strict typecheck The recursive `collectStaticLeaves` helper in the nativePicker → presentation codemod had no `@returns` JSDoc, so the CLI strict typecheck (checkJs + strict) failed with TS7023: implicit `any` return type on a function that references itself in its own return expressions. Declare `@returns {boolean}`. * feat(core): narrow presentation — text-input TimeInput-only per AST-043 (#6644) DateInput and DateTimeInput no longer accept presentation="text-input". Their `presentation` is `PickerPresentation = Exclude<InputPresentation, 'text-input'>` (five values); TimeInput keeps all six. - utils/inputPresentation: add `PickerPresentation`, `PickerPresentationSurface` and type-checked picker-only twins (`pickerPresentationFromNativePicker`, `effectivePickerPresentation`, `resolvePickerPresentation`). The general resolvers delegate to them, so TimeInput's mapping (`never` → `text-input`) is unchanged and the narrowing needs no cast and no runtime rejection. - DateInput / DateTimeInput: drop the `text-input` dispatch and the `hasPicker(s)` plumbing. PointerDateField / PointerDateTimeField are back to their released popover behavior (toggle button, combobox role and ARIA, popover render, click/ArrowDown open) unconditionally. - Presentation tests: remove the text-input cases; the FR4 precedence test now pits presentation="bottom-sheet" against nativePicker="always". - Docs (en/zh/dense) and Storybook controls drop 'text-input' for DateInput/DateTimeInput; the changeset spells out their five values against TimeInput's six. - Review follow-ups: DateTimeInput usage prose describes `presentation` (adaptive-native default) instead of `nativePicker`; the `nativePicker` Storybook control in all three stories is marked deprecated with its `presentation` mapping. * fix(core): align TimeInput sheet chrome * docs(storybook): add TimeInput adaptive-bottom-sheet mode * docs: TimeInput constrained example uses adaptive-bottom-sheet
Exact decision needed
Update
spec:AST-043(landed in #6614) in place:text-inputisTimeInput-only.DateInput/DateTimeInputaccept fivepresentationvalues and excludetext-inputat the type level.Existing authority searched
Landed
docs/specs/AST-043-input-presentation/spec.md(FR1 surface table, FR3 mapping, FR5); implementation in flight in #6628 currently enablestext-inputon all three via a shared 6-value type.Decision
FR1 edited directly (no amendment/DEC added) + FR5/Verification updates:
text-inputoriginates solely fromTimeInput's releasednativePicker="never"(typed field, no picker) — FR3 unchanged.DateInput/DateTimeInput: no released state or caller need selects a picker-less date field; accepting it would silently drop the calendar affordance typed entry already coexists with in their popover surface.spec:AST-017FR2). feat(core): add presentation to DateInput, DateTimeInput, TimeInput (AST-043) #6628 conforms by removing the type member on those two components (no runtime handling needed).Rejected alternatives
Uniform six-value types for tidiness — the FR1 vocabulary already differs per component (
TimeInputdesktop row), and uniformity is not a caller benefit.Claim scope and non-goals
Spec-only edit; #6628 implementation update follows separately after this lands.
TimeInputbehavior, defaults, fallback split, deprecation: unchanged.Scope
Validation
git diff --check: pass ·pnpm check:knowledge: noAST-043findings