Skip to content

feat(core): add mobile DateTimeInput picker - #5582

Merged
imdreamrunner merged 2 commits into
mainfrom
feat/datetime-input-mobile
Aug 28, 2026
Merged

imdreamrunner merged 2 commits into
mainfrom
feat/datetime-input-mobile

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

What this does

DateTimeInput now fits the primary pointer:

  • mouse/trackpad keeps the existing side-by-side typed date and time fields
  • coarse pointers keep the same closed-field structure: separate side-by-side Date and Time segments with the existing segment theme targets
  • tapping/clicking the Date segment or calendar icon, or pressing Enter/Space/ArrowDown in the Date segment, opens the Bottom Sheet directly on Date
  • tapping/clicking the Time segment or clock affordance, or pressing Enter/Space/ArrowDown in the Time segment, opens the Bottom Sheet directly on Time, even before a date exists
  • focus alone does not open the sheet, matching DateInput touch behavior and avoiding focus-restore reopen loops
  • a Date/Time segmented control remains at the top of the sheet for switching after open
  • Date reuses Astryx's custom swipeable month picker and month/year wheels
  • the Date panel primary action is sentence case (Save date) and stays disabled until the controlled value contains a valid selected date
  • Reset clears the controlled date and leaves Save date disabled while keeping the Date panel open
  • Time uses the same accessible wheel primitive for hour, minute, optional seconds, and AM/PM

There are no new public props. Existing controlled-value, async changeAction, min/max, date constraints, 12h/24h, seconds, clear, disabled/loading, status, theming, and accessibility behavior are preserved on the touch surface.

Interaction details

  • The Date closed field displays only the formatted date; the Time closed field displays only the formatted time or timePlaceholder.
  • Each closed segment reports aria-expanded only when the shared sheet is open on that segment's section.
  • Date and Time panels stay mounted and share a stable sheet height, preserving both month scroll position and wheel state.
  • A time chosen before a date is retained as a local draft and displayed in the closed Time segment, then combined when the date is chosen.
  • Boundary-day time values clamp to the datetime min/max.
  • Explicit loading disables interaction, while an optimistic async save does not eject the user from an open sheet or discard later edits.
  • Clearing defers focus restoration to avoid the measured iOS Safari scroll-to-top behavior.
  • Padding-strip clicks still open each segment; clear/spinner/status clicks do not bubble into segment open.

Verification

  • Confirmed Astryx button labels use sentence case from existing Storybook labels such as Learn more, Open sheet, Save changes, Save for later, and Get started.
  • pnpm exec vitest run packages/core/src/DateTimeInput/DateTimeInputTouch.test.tsx --testNamePattern "Save date|directly to Date|padding clicks|keyboard activation|Time Save closes" — 1 file passed; 9 tests passed, 29 skipped.
  • pnpm exec vitest run packages/core/src/DateTimeInput/DateTimeInput.test.tsx packages/core/src/DateTimeInput/DateTimeInputTouch.test.tsx — 2 files passed; 173 tests passed. React printed the existing act warnings in two desktop DateTimeInput tests.
  • pnpm lint:strict — passed; 0 errors, 79 existing warnings.
  • pnpm -F @astryxdesign/core typecheck — passed.
  • pnpm -F @astryxdesign/core typecheck:docs — passed.
  • pnpm check:sync — passed.
  • pnpm check:i18n-catalog — passed; 350 keys over 468 references resolve; 352 en entries described; 29 locales consistent.
  • pnpm check:changesets — passed; 51 changesets valid.
  • pnpm -F @astryxdesign/core build — passed; 579 files compiled, astryx.css 151.4 KB, no dev JSX, relative specifiers fully specified.
  • pnpm -F @astryxdesign/storybook build — passed; Storybook build completed successfully. Vite emitted existing warnings for missing MDX story files, deprecated optimizeDeps.esbuildOptions, Lexical pure annotations, chunk size, and plugin timings.
  • git diff --check — passed.

The PR remains draft.

@vercel

vercel Bot commented Aug 26, 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 27, 2026 4:02am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 26, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 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

DateInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 3291 -
Complexity N/A Very High (356) -
DateTimeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 2592 -
Complexity N/A Very High (403) -

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

614 added · 0 removed. View the report

To accept these exact frames: /accept-visual 33038030350/3 <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

github-actions Bot added a commit that referenced this pull request Aug 27, 2026
@imdreamrunner
imdreamrunner marked this pull request as draft August 27, 2026 00:15
@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-mobile branch from 90c7085 to 978ff79 Compare August 27, 2026 00:44
@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-mobile branch from 978ff79 to e999ccb Compare August 27, 2026 01:01
github-actions Bot added a commit that referenced this pull request Aug 27, 2026
@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-mobile branch from e999ccb to d785398 Compare August 27, 2026 01:12
github-actions Bot added a commit that referenced this pull request Aug 27, 2026
@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-mobile branch from d785398 to d9a099b Compare August 27, 2026 01:30
github-actions Bot added a commit that referenced this pull request Aug 27, 2026
@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-mobile branch from d9a099b to 3a3713b Compare August 27, 2026 01:42
github-actions Bot added a commit that referenced this pull request Aug 27, 2026
@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-mobile branch from 3a3713b to 9e4281e Compare August 27, 2026 01:56
github-actions Bot added a commit that referenced this pull request Aug 27, 2026
@imdreamrunner
imdreamrunner force-pushed the feat/datetime-input-mobile branch from b1c0040 to f6e1b4f Compare August 27, 2026 03:59
github-actions Bot added a commit that referenced this pull request Aug 27, 2026
github-actions Bot added a commit that referenced this pull request Aug 27, 2026
@imdreamrunner
imdreamrunner marked this pull request as ready for review August 27, 2026 04:25
@imdreamrunner
imdreamrunner enabled auto-merge (squash) August 27, 2026 17:18
@imdreamrunner
imdreamrunner disabled auto-merge August 28, 2026 16:42
@imdreamrunner
imdreamrunner enabled auto-merge (squash) August 28, 2026 16:42
github-actions Bot added a commit that referenced this pull request Aug 28, 2026
@xinzi-bot

Copy link
Copy Markdown

/accept-visual 33038030350/3 No desktop visual regressions; these 170 added frames bootstrap previously unpromoted DateInput/DateTimeInput coverage, and the reviewed frames render correctly. The coarse-pointer mobile flow is verified separately.

@github-actions

Copy link
Copy Markdown
Contributor

Visual acceptance refused: only a repository maintainer may accept stable visual changes.

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/accept-visual 33038030350/3 No desktop visual regressions; these 170 added frames bootstrap previously unpromoted DateInput/DateTimeInput coverage, and the reviewed frames render correctly. The coarse-pointer mobile flow is verified separately.

@github-actions

Copy link
Copy Markdown
Contributor

Visual acceptance could not be recorded. See this workflow run for the rejected invariant or infrastructure error.

github-actions Bot added a commit that referenced this pull request Aug 28, 2026
@github-actions github-actions Bot added the visual-approved Current visual bundle has an explicit acceptance record label Aug 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Visual changes accepted for f6e1b4fd77f6. A new push invalidates this approval; after merge, the reviewed AFTER frames must reproduce before the baseline is promoted.

@imdreamrunner
imdreamrunner merged commit d51dbad into main Aug 28, 2026
46 of 47 checks passed
github-actions Bot added a commit that referenced this pull request Aug 28, 2026
@github-actions
github-actions Bot deleted the feat/datetime-input-mobile branch August 29, 2026 06:19

This branch was successfully deployed

1 active deployment
Preview — f6e1b4fd Deployed Aug 27, 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. needs:design-review Affects visuals — Design should review visual-approved Current visual bundle has an explicit acceptance record

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants