Skip to content

feat(DateTimeInput): add native picker option - #5620

Merged
imdreamrunner merged 1 commit into
mainfrom
feat/datetime-input-native-picker
Sep 1, 2026
Merged

imdreamrunner merged 1 commit into
mainfrom
feat/datetime-input-native-picker

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

What

Add nativePicker to DateTimeInput, matching DateInput's surface-selection API for both date and time:

Value Behavior
'touch' (default) Browser/OS <input type="date"> and <input type="time"> on a coarse primary pointer; Astryx surfaces otherwise
'always' Browser/OS date and compatible time controls on every pointer type
'never' Astryx's own surfaces everywhere — pointer fields on fine pointers and the coordinated Date/Time bottom sheet on coarse pointers

The native controls keep DateTimeInput's two-segment field, distinct labels, controlled ISO datetime value, constraints, theming targets, and public date-input ref.

Both native segments use the iOS-safe shape established by DateInput: uncontrolled DOM values, native input/change listeners with deduplication, no programmatic writes while focused, and stale-blur protection. A time chosen before the date is retained and combined when the date commits. Pending changeAction work no longer disables or detaches an open native wheel.

Compatibility fallbacks

The OS time picker cannot faithfully provide every Astryx time feature. hasSeconds, a non-default timeIncrement, or timeOptionInterval retain Astryx's time field while the date remains native. Date constraints and datetime min/max are always enforced in JavaScript; native min/max attributes are hints because iOS may not visually disable invalid wheel values.

iOS verification

Verified against the built component in iOS 26.5 Safari on an iPhone 17 Pro simulator:

  • tapping the DateTimeInput time segment opens the native hour/minute/AM-PM wheel;
  • moving the minute wheel updated the controlled value from 2026-03-15T14:30 to 2026-03-15T14:32;
  • a focused native control is not rewritten or detached by controlled/optimistic updates.
  • sizing now follows DateInput: a compact 180px native-field floor, with a 240px minimum only in the doc-site showcase; native value slots remain shrinkable.

Test plan

  • 30 native-picker regression tests covering surface selection, both ISO halves, time-before-date drafting and boundary clamping, native event deduplication, controlled rejection, optimistic rollback/clear, pending actions, min/max rejection, ARIA, clear/reset, and compatibility fallbacks
  • Existing desktop + touch DateTimeInput suites: 177 tests
  • All 207 DateTimeInput tests pass
  • pnpm lint:strict
  • pnpm build
  • Core/docs and Storybook typechecks
  • Storybook production build
  • Isolated CLI suite: 2,869 tests pass (the monolithic local run retains its known load-time timeout flake)

@vercel

vercel Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 31, 2026 7:33pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 28, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Aug 28, 2026
github-actions Bot added a commit that referenced this pull request Aug 28, 2026
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

DateTimeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 3379 -
Complexity N/A Very High (530) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.8KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

14 added · 0 removed. View the report

To accept these exact frames: /accept-visual 33430802533/1 <reason>

Added — After
Added — After visual regression frame

Added — After
Added — After visual regression frame

Added — After
Added — After visual regression frame


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-native-picker branch from 23d01ac to a1f31c6 Compare August 29, 2026 00:50
github-actions Bot added a commit that referenced this pull request Aug 29, 2026
@imdreamrunner
imdreamrunner marked this pull request as ready for review August 29, 2026 06:20
@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-native-picker branch from a1f31c6 to 6f95a80 Compare August 29, 2026 07:04
@imdreamrunner imdreamrunner changed the title feat(DateTimeInput): add native date picker option feat(DateTimeInput): add native picker option Aug 29, 2026
github-actions Bot added a commit that referenced this pull request Aug 29, 2026

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

Looks good from design. The nativePicker modes provide a clear choice between OS-native and Astryx-owned date/time surfaces, while preserving the established two-segment field presentation and explicit fallbacks for unsupported time features.

@xinzi-bot xinzi-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks — the native picker implementation lines up with DateInput, but the Storybook docs still teach the old touch default. The component description says coarse-pointer DateTimeInput opens the Astryx bottom sheet, while this PR makes nativePicker="touch" use OS date/time controls by default. Could you update that overview so the default and nativePicker="never" paths are separated?

[Automated review]

@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-native-picker branch from 6f95a80 to 78f7f23 Compare August 31, 2026 18:14
@github-actions github-actions Bot removed the needs:design-review Affects visuals — Design should review label Aug 31, 2026
github-actions Bot added a commit that referenced this pull request Aug 31, 2026

@xinzi-bot xinzi-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks — the implementation and core docs now line up with DateInput's native-picker model, but the public Storybook docs still teach the old touch surface. The component overview says coarse-pointer DateTimeInput opens the Astryx bottom sheet by default, and the timeIncrement argType still says mobile touch uses wheels. Could you update those Storybook descriptions so the default native path and nativePicker="never" path are separated?

[Automated review]

@imdreamrunner
imdreamrunner merged commit a84d09c into main Sep 1, 2026
27 of 28 checks passed
@github-actions
github-actions Bot deleted the feat/datetime-input-native-picker branch September 1, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — ff3477a9 Deployed Aug 31, 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.

3 participants