Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
52d8aad
feat(Wheel): UIPickerView's motion under a finger, with flat rows
vjeux Nov 2, 2026
78b8bce
test(Wheel): judge a flick's coast by the velocity the page measured
vjeux Nov 2, 2026
50a2ea5
feat(Wheel): a trackpad drives the touch wheel as a finger, and a not…
vjeux Nov 2, 2026
2e3bbc4
refactor(Wheel): drop the turns from script and the owner's rest rule…
vjeux Nov 2, 2026
c615baa
fix(Wheel): attach the strip from a callback ref, and say what the sh…
vjeux Nov 2, 2026
02f533e
fix(Wheel): a key moves to the next enabled row and stops at the last…
vjeux Nov 2, 2026
f154768
fix(Wheel): keys step through a wheel's values in time order, so 12 P…
vjeux Nov 2, 2026
5461709
docs(Wheel): name the scrolling column instead of today's
vjeux Nov 2, 2026
e62c162
fix(Wheel): a key with nowhere to go leaves a turn in flight to finis…
vjeux Nov 3, 2026
f5a6493
fix(Wheel): the touch column's fade sits inside it, so its focus ring…
vjeux Nov 3, 2026
d2ad35c
spec(AST-094, DateInput): the picker wheel's snap rate is an FR4 impl…
vjeux Nov 3, 2026
2c09be7
test(DateInput): the meridiem turn proof judges the frames the strip …
vjeux Nov 3, 2026
8b4fc04
test(Wheel): the scrolling column's Reduce Motion dip lands on the fa…
vjeux Nov 3, 2026
87b9b84
test(DateInput): the Reduce Motion step proof records frames until th…
vjeux Nov 3, 2026
f3b01a2
fix(Wheel): the wheel strip takes the motion animator's new name
vjeux Nov 3, 2026
2c6622c
test(touch bundle): PowerSearch and Table are listed once
vjeux Nov 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/wheel-interaction-proofs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[chore] Internal: browser proofs for the touch picker wheel in Chromium and WebKit, which a finger gets on every engine. A flick coasts on UIKit's curve onto the row it projects and commits on arrival. A finger landing on a coasting wheel stops it, and it then eases onto the nearest row. A storyboard films a flick and its coast. In Chromium, the coast also keeps advancing every frame while the main thread is blocked, and does no Layout or Paint per frame. Under reduced motion, a flick still coasts as momentum with its rows flat, and a tap cross-fades onto its row, animating opacity alone for 200 ms or less. Opening the month and year wheels writes no element per year, and each year is drawn once. Under a mouse, a drag still scrolls today's column onto a row.

@vjeux
7 changes: 7 additions & 0 deletions .changeset/wheel-keys-time-order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[fix] In the DateInput, TimeInput and DateTimeInput bottom sheets, a wheel's Arrow, Page, Home and End keys move through its enabled values in time order, skipping disabled ones, and stop at the first or last enabled value, with a mouse as with a finger. On a 12-hour hour wheel 12 PM comes before 1 PM, so ArrowDown from 12 PM moves to 1 PM, and a key past the last allowed hour commits nothing.

@vjeux
7 changes: 7 additions & 0 deletions .changeset/wheel-listbox-hook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[chore] Internal: the Wheel's two presentations, the scrolling column under a mouse and the picker wheel under a finger, share one listbox hook for their ids, ARIA attributes, Arrow, Page, Home and End keys, and row clicks. Each keeps where its moves start: the scrolling column steps from the row under its band, and the picker wheel from the row it is heading to.

@vjeux
7 changes: 7 additions & 0 deletions .changeset/wheel-trackpad-notch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[feat] On a touch device with a trackpad or a mouse, such as a tablet with a keyboard, the picker wheels in the TimeInput, DateTimeInput and DateInput bottom sheets now take a trackpad's two-finger scroll as a finger: the rows follow the fingers, coast on at their lift, and rest on a row. One mouse-wheel notch turns a wheel one row, as an arrow key does, with no coast. Before, both moved the rows by each scroll's own distance, so a trackpad's momentum ran at the browser's rate and one notch moved several rows. A ctrl-scroll still zooms the page.

@vjeux
7 changes: 7 additions & 0 deletions .changeset/wheel-uikit-picker-values.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[chore] Internal: UIPickerView's values measured on iOS 26.2 join the touch motion tables as internal constants: the row pitch, the picker's height and its rubber band, the coast's stop speed and velocity floor, the snap at rest, the tap spin and the selection tick. The pure math a wheel moves with comes with them. It projects the row a release rests on as UIScrollView sums its deceleration, coasts with the rate re-solved to stop on that row, snaps, bounces at an end, rubber-bands, and spins to a tapped row. It is checked against UIKit's recorded frames. Nothing public changes: none of it is exported from the package entry point, and themes do not set these values.

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.

Non-blocking: the tap spin is no longer only an internal constant: registerPickerTable makes its duration the internal motion role picker.tapSpin.durationMs (FR14). Consider "…and the selection tick, with the tap spin's duration as an internal motion role".

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.

Non-blocking: the tap spin is registered as the internal motion role picker.tapSpin.durationMs (picker.ts:114-116), so listing it among the internal constants reads inaccurately.


@vjeux
7 changes: 7 additions & 0 deletions .changeset/wheel-uikit-picker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[feat] Under a coarse primary pointer, as on a phone or a tablet, the picker wheels in the TimeInput, DateTimeInput and DateInput bottom sheets now move like UIPickerView. Their rows keep the 28 px pitch and lie flat, fading toward the edges of the column in every browser; the scrolling column under a mouse tilts and fades its rows only where the browser supports scroll-driven animations, and shows a plain list elsewhere. The row under the band is in semibold accent text on its plate while the wheel rests and while a finger drags it; no row is marked while the wheel coasts, snaps or turns. A flick coasts at UIKit's deceleration onto the row UIKit's projection picks. A finger landing on a moving wheel stops it. A tap on a row turns it onto the band, and a value changed from outside while the sheet is open, as when a bound clamps the time, turns the wheel onto its row instead of jumping there. Past the first or last row, a drag rubber-bands and the wheel bounces back. As on iOS, the value commits when the wheel comes to rest, and the coast keeps running while the page's main thread is busy. Arrow keys and clicks on a row still commit at once. Under reduced motion a flick still coasts, as scrolling does; a tap, a key or a slow release cross-fades onto its row. `presentation="popover"` keeps the previous surface; no value keeps the native-scroll column under a finger. Each row that reaches the band ticks with a short vibration where the browser supports it, as on Android; iOS Safari has no vibration. Under a fine primary pointer, as with a mouse on a desktop, the wheels keep the scrolling column.

@vjeux
36 changes: 36 additions & 0 deletions apps/storybook/stories/DateInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -861,3 +861,39 @@ export const StylingParts: Story = {
</div>
),
};

/**
* The bottom sheet with two centuries of years: the year wheel has 200 rows.
* Under a finger, opening the month and year wheels costs about the same as
* for two years: each year is drawn once, as a flat row.
*/
export const BottomSheetWideRange: Story = {
render: args => {
const [value, setValue] = useState<ISODateString | undefined>(
'2026-03-15' as ISODateString,
);
return <DateInput {...args} value={value} onChange={setValue} />;
},
args: {
label: 'Date of birth',
presentation: 'bottom-sheet',
min: '1900-01-01' as ISODateString,
max: '2099-12-31' as ISODateString,
},
};

/** The same sheet with two years: the year wheel has 2 rows. */
export const BottomSheetNarrowRange: Story = {
render: args => {
const [value, setValue] = useState<ISODateString | undefined>(
'2026-03-15' as ISODateString,
);
return <DateInput {...args} value={value} onChange={setValue} />;
},
args: {
label: 'Date of birth',
presentation: 'bottom-sheet',
min: '2026-01-01' as ISODateString,
max: '2027-12-31' as ISODateString,
},
};
84 changes: 84 additions & 0 deletions apps/storybook/stories/WheelProofs.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.

/**
* @file WheelProofs.stories.tsx
* @input Uses React and the internal Wheel (packages/core/src/DateInput)
* @output The Wheel alone, for its browser proofs: a 60-row minute column at
* 00, its committed minute shown in a read-only field; and the touch column
* alone, whatever the primary pointer, for the trackpad proofs
* @position A checked-in reproduction path for
* packages/core/src/DateInput/__tests__/Wheel.interaction.browser.spec.ts.
* The proofs test the Wheel itself, so they open a column that stays a plain
* Wheel whatever rules the sheets that use it add (looping, bounds, a date
* that moves with the month).
*/

import type {Meta, StoryObj} from '@storybook/react';
import {useState} from 'react';
import {PickerWheel} from '../../../packages/core/src/DateInput/PickerWheel';
import {Wheel} from '../../../packages/core/src/DateInput/Wheel';

const MINUTES = Array.from({length: 60}, (_, minute) => ({
value: minute,
label: String(minute).padStart(2, '0'),
}));

const meta = {
title: 'Core/Wheel',
tags: ['no-visual', '!autodocs'],
parameters: {layout: 'centered'},
} satisfies Meta;

export default meta;
type Story = StoryObj<typeof meta>;

/**
* A finger gets the touch column, a mouse the scrolling column; either commits
* into the field above it.
*/
export const Minutes: Story = {
render: () => {
const [minute, setMinute] = useState(0);
return (
<div style={{display: 'grid', gap: 16, inlineSize: 160}}>
<input
aria-label="Committed minute"
readOnly
value={String(minute).padStart(2, '0')}
/>
<Wheel
label="Minute"
options={MINUTES}
value={minute}
onChange={setMinute}
/>
</div>
);
},
};

/**
* The touch column alone, whatever the primary pointer: WebKit's driver sends
* a trackpad's precise deltas only from a desktop context, whose primary
* pointer is fine, and its mobile emulation sends no wheel at all.
*/
export const TouchMinutes: Story = {
render: () => {
const [minute, setMinute] = useState(0);
return (
<div style={{display: 'grid', gap: 16, inlineSize: 160}}>
<input
aria-label="Committed minute"
readOnly
value={String(minute).padStart(2, '0')}
/>
<PickerWheel
label="Minute"
options={MINUTES}
value={minute}
onChange={setMinute}
/>
</div>
);
},
};
1 change: 1 addition & 0 deletions docs/specs/AST-094-touch-presentations/motion-roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Every motion role a registered table lists (`spec:AST-094` FR4, DEC-5): its kind

| Role | Kind | Default | Named by |
| ------------------------------- | -------- | --------------------------------------------------------------- | ----------------------- |
| `picker.tapSpin.durationMs` | duration | 300 ms | `component:DateInput` |
| `progress.curves.fill` | curve | cubic-bezier(0, 0, 1, 1) | `component:ProgressBar` |
| `progress.fillTrackMs` | duration | 1000 ms | `component:ProgressBar` |
| `progress.reducedMotionPulseMs` | duration | 2000 ms | `component:ProgressBar` |
Expand Down
4 changes: 4 additions & 0 deletions docs/specs/AST-094-touch-presentations/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ a measured, sourced difference exists.
integrator, its 300 ms animated scroll and that scroll's sinusoidal curve,
DEC-25) plays from internal constants and is not yet a named role.

Implementation gap: the sheet picker wheel's snap rate (UIKit's measured
picker deceleration) plays from an internal constant and is not yet a named
role; a role kind for rates comes with a later change.

### Motion

- **FR5 — Motion runs on the compositor.** Every release and every
Expand Down
Loading
Loading