Skip to content

docs(react-timepicker-preview): add TimePicker spec - #36845

Merged
Victor Genaev (mainframev) merged 5 commits into
masterfrom
timepicker-preview/spec
Oct 20, 2026
Merged

Victor Genaev (mainframev) merged 5 commits into
masterfrom
timepicker-preview/spec

Conversation

@mainframev

@mainframev Victor Genaev (mainframev) commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #36811 scaffold (merged) → #36845 spec → #36812 time utilities → #36813 TimePicker → #36814 headless TimePicker

Previous Behavior

The spec for @fluentui/react-timepicker-preview was part of the scaffold PR #36811, next to the generated boilerplate.

New Behavior

Adds library/docs/Spec.md on its own so the API can be reviewed separately from the scaffolding. The first commit is the spec as it was in #36811; the second commit resolves the review comments left there:

  • onSelectedTimeChange data extends EventData<'change' | 'click' | 'keydown' | 'blur', TimePickerSelectedTimeChangeEvent>, so it satisfies EventHandler. A table documents how option selection, freeform commits and clearing are told apart from the payload.
  • The default dateAnchor is resolved once on mount (initial selected time, else the current date) and never re-derived from later selections. Ranges that cross midnight require an explicit dateAnchor.
  • Formatting and the default parser share one resolved hour cycle (hourCycle prop, else the locale's via Intl). The accepted input formats per cycle are listed, with a round-trip guarantee for ASCII digits and AM/PM; localized digits and day periods need a custom parseTimeStringToDate.
  • increment is a finite positive integer. getTimesBetween advances by elapsed time and returns no options for an invalid increment.
  • Selection follows the v9 form control convention: value / defaultValue (Date | null), optional displayValue for controlled input text, and onChange firing on commit, in the shape SpinButton uses. Compat's selectedTime / defaultSelectedTime / onTimeChange are mapped in the migration table.
  • Commit outcomes are defined for invalid-input, out-of-bounds and required-input (selection, input text, highlighted option), together with the required attribute, the clear button and custom parsers.

The spec defines the contract. The implementation in #36812/#36813 is aligned to it in those PRs, together with the timeMath.ts review on #36812.

@mainframev
Victor Genaev (mainframev) requested a review from a team as a code owner October 7, 2026 10:30
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Pull request demo site: URL

Comment thread packages/react-components/react-timepicker-preview/library/docs/Spec.md Outdated
@mainframev
Victor Genaev (mainframev) marked this pull request as draft October 7, 2026 14:38
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

📊 Bundle size report

✅ No changes found

@mainframev
Victor Genaev (mainframev) removed this pull request from stack #36846 October 8, 2026 15:00
@mainframev
Victor Genaev (mainframev) changed the base branch from master to timepicker-preview/custom-style-hook October 8, 2026 15:00
@mainframev
Victor Genaev (mainframev) added this pull request to stack #36857 October 8, 2026 15:00
@mainframev
Victor Genaev (mainframev) marked this pull request as ready for review October 8, 2026 15:10
@mainframev
Victor Genaev (mainframev) removed this pull request from stack #36857 October 8, 2026 15:21
@mainframev
Victor Genaev (mainframev) changed the base branch from timepicker-preview/custom-style-hook to master October 8, 2026 15:21
@mainframev
Victor Genaev (mainframev) added this pull request to stack #36858 October 8, 2026 15:22

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.

After an agent review, it left me with a few questions

Comment thread packages/react-components/react-timepicker-preview/library/docs/Spec.md Outdated
Comment thread packages/react-components/react-timepicker-preview/library/docs/Spec.md Outdated
Comment thread packages/react-components/react-timepicker-preview/library/docs/Spec.md Outdated
Comment thread packages/react-components/react-timepicker-preview/library/docs/Spec.md Outdated
Comment thread packages/react-components/react-timepicker-preview/library/docs/Spec.md Outdated
Comment thread packages/react-components/react-timepicker-preview/library/docs/Spec.md Outdated
- resolve the locale hour cycle with { hour: 'numeric' }
- narrow the round-trip guarantee to ASCII digits, a colon separator and AM/PM
- define the DST tie-break as the earliest occurrence at or after the start anchor
- add the non-required empty commit to the onChange table and stop calling null without error a clear
- use an accepted input in the normalization example
- reword the compat note on controlled value

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! Just the hook signature comment to address before merging. Thanks for the updates.

@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) requested a balanced review from Copilot October 20, 2026 10:08
@mainframev
Victor Genaev (mainframev) merged commit e2642c7 into master Oct 20, 2026
17 checks passed

Copilot AI 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.

🟢 Approval recommended

The documentation-only change has no identified blocking issues.

No open issues 🎉

What changed in this PR

Adds a standalone specification for the preview v9 TimePicker, separating API review from scaffolding and implementation.

Changes:

  • Defines value handling, change events, formatting, parsing, and validation.
  • Documents composition hooks, migration guidance, and accessibility behavior.
File Description
packages/​react-components/​react-timepicker-preview/​library/​docs/​Spec.md Defines the TimePicker API and behavior contract.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants