Skip to content

docs(spec): AST-043 — text-input is TimeInput-only - #6644

Merged
imdreamrunner merged 2 commits into
mainfrom
spec/ast043-text-input-time-only
Sep 26, 2026
Merged

imdreamrunner merged 2 commits into
mainfrom
spec/ast043-text-input-time-only

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

Update spec:AST-043 (landed in #6614) in place: text-input is TimeInput-only. DateInput/DateTimeInput accept five presentation values and exclude text-input at 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 enables text-input on all three via a shared 6-value type.

Decision

FR1 edited directly (no amendment/DEC added) + FR5/Verification updates:

  • text-input originates solely from TimeInput's released nativePicker="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.
  • Compatibility: narrows a value before its implementation shipped — no released consumer (spec:AST-017 FR2). 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 (TimeInput desktop row), and uniformity is not a caller benefit.

Claim scope and non-goals

Spec-only edit; #6628 implementation update follows separately after this lands. TimeInput behavior, defaults, fallback split, deprecation: unchanged.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Public text and artifacts contain no internal Meta context.

Validation

  • Prettier: pass · git diff --check: pass · pnpm check:knowledge: no AST-043 findings

@vercel

vercel Bot commented Sep 25, 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 Sep 26, 2026 2:11am UTC

Request Review

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

astracat-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Sep 26, 2026, 2:16 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Sep 25, 2026
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).
@imdreamrunner
imdreamrunner force-pushed the spec/ast043-text-input-time-only branch from 83f7d4e to ace63f2 Compare September 25, 2026 22:12
@imdreamrunner imdreamrunner changed the title docs(spec): AST-043 amendment — text-input is TimeInput-only (DEC-4) docs(spec): AST-043 — text-input is TimeInput-only Sep 25, 2026
@imdreamrunner
imdreamrunner marked this pull request as ready for review September 25, 2026 22:13
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

View Storybook for this PR · View Sandbox for this PR

Current run: The current change has no visual or preview-producing scope. Visual checks are not applicable; preview links are not shown.


Generated by PR Enrichment workflow | View current CI run

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

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]

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec e5d270b

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Sep 26, 2026

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

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]

@imdreamrunner
imdreamrunner merged commit 1013a81 into main Sep 26, 2026
41 checks passed
imdreamrunner added a commit that referenced this pull request Sep 26, 2026
…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.
@github-actions
github-actions Bot deleted the spec/ast043-text-input-time-only branch September 26, 2026 06:21
imdreamrunner added a commit that referenced this pull request Sep 28, 2026
…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

This branch was successfully deployed

1 active deployment
Preview — e5d270be Deployed Sep 26, 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. spec-auto-merge Auto-merge was enabled by the spec owner gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant