Repository navigation
feat(TimeInput): the minute wheel loops under a finger, as on iOS - #10953
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DateTimeInput · Storybook | 213.3 kB (+1.2 kB) · 18.7 kB CSS (0) | 3,612 (0) | ✗ · ✓ · ✓ |
| DateInput · Storybook | 191.1 kB (+1.2 kB) · 17.1 kB CSS (0) | 6,035 (+271) | ✗ · ✓ · ✓ |
| PowerSearch | 294.7 kB (+1.2 kB) · 24.2 kB CSS (0) | — | — · — · — |
4 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TimeInput · Storybook | 165.9 kB (+1.1 kB) · 16.1 kB CSS (0) | 1,609 (+1) | ✓ · ✓ · — |
| Lightbox | 124.7 kB (0) · 10.6 kB CSS (0) | — | — · — · — |
| lab/Comments | 356.0 kB (0) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 349.1 kB (0) · 2.4 kB CSS (0) | — | — · — · — |
Visual changes: 14 snapshots in 2 components
A change is a question for the reviewer, not a failure.
2 more are in the run's visual report.
Package size: @astryxdesign/core 7.31 MB packed (+7.0 kB); no new dependencies.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the record changes. This pull request writes the looping minute wheel, its one-hour-per-lap carry and the key change into the current component:TimeInput FR7 and ORD3, component:DateInput FR17 and component:DateTimeInput FR14. An engineering owner records that decision by commenting /approve-spec <full head SHA>, and the author may do so as an engineering owner. The decision should also settle whether a DateTimeInput carry at midnight keeps the date.
Blocking findings, to fix whatever the decision:
- With
minormaxinside the shown hour, the copies, the rest rule and the key step judge the neighbouring hour's minutes by the shown hour's rows (PickerWheel.tsx:333-336,wheelOptions.ts:180,wheelOptions.ts:275-276), so at a 5 PM maximum the allowed 4:56–4:59 PM show greyed, and ArrowUp at 1:00 PM with a 1:30 PM maximum commits 12:30 PM. - A key carry past a bound leaves the minute wheel on the wrong row, because
turnToPositioncommits before it starts its own turn and that turn replaces the clamp's corrective spin (PickerWheel.tsx:828-830): PageDown at 4:55 PM with a 5 PM maximum commits 5:00 PM while the wheel rests on :05, and the test "brings a carry past the maximum back onto it" checks onlyaria-activedescendant. nearestPosition,loopStepandwrapIndexre-implementnearestLoopCopyandmodfromhooks/usePager.tswith a different tie rule, so they should move to one shared helper that both the pager and the wheel call.
CI has not run on this draft head yet.
[Automated review]
adf627e to
32e4d64
Compare
Under a finger, the bottom sheet's minute wheel now loops, as UIDatePicker's does: past 59 comes 00, and the hour stays. On the iOS 26.2 simulator a flick of UIDatePicker's minute wheel through 59 keeps its hour, so the datePicker motion table now says so. The picker wheel gains an internal isLooping switch. Every commit first moves the strip onto the wheel's own rows, so a value the owner clamps turns the wheel on from there. The pager and the wheel share one loop helper. A sandbox page shows the sheet at 11:58 AM. The hour wheel does not loop yet.
32e4d64 to
fb0a4f3
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the record changes. This pull request writes the looping minute wheel, which keeps the hour at the seam, into the current component:TimeInput FR7 and ORD3, component:DateInput FR17 and DEC-3, and component:DateTimeInput FR14. An engineering owner records that decision by commenting /approve-spec <full head SHA> on the pull request, and the author may do so as an engineering owner.
Blocking findings to fix, whatever the decision:
- The description still says the minute wheel "carries the hour" (12:58 PM reading 1:02 PM, 11 AM turning to 12 PM), while the head, its tests and the changeset keep the hour, so the summary, evidence and testing steps need to describe the head's behaviour.
- The proposed FR7 sentence "The minute wheel loops" names no pointer, but under a fine pointer the sheet renders the scrolling column, which stops at :59 (
Wheel.tsx:287), so scope it to a coarse primary pointer as DEC-3 and the changeset do, or make the scrolling column loop too. hooks/usePager.ts:272keeps its ownmodbeside the new sharedutils/loopIndex.tsmod, so import it from the shared helper and delete the local copy.
[Automated review]
|
/approve-spec fb0a4f3 |
|
/approve-spec fb0a4f3 |
FR7 now says the minute wheel loops under a coarse primary pointer, as the rest of the record does. The pager imports mod from the shared loop helper instead of keeping its own copy, and the wheel physics drop stale wrap comments.
|
/approve-spec b8c8354 |
There was a problem hiding this comment.
Changes requested: the looping minute wheel's record text is approved at this head, and one wheel defect needs a fix.
Blocking:
- Miss: a looping wheel treats a rest one lap from its committed row as a different row (
PickerWheel.tsx:504), so at 10:05 AM with a 10:10 AM minimum a full turn back onto :05 commits 10:10 AM, and with no enabled minute in the hour a fling spins back more than two laps, againstcomponent:DateInputFR13; compare rows withmod(position, count), pass the nearest copy of the committed row (nearestLoopCopy) torestingLoopStepas its tie-break and fallback, and add a test for each case.
Non-blocking: two new comments in PickerWheel.tsx (lines 248 and 478) restate the code and can go.
The looping wheel compared its rest with the committed row by position, so a rest whole laps away counted as another row. A full turn back onto a committed value outside the bounds then committed the nearest enabled row, and with no enabled row the wheel turned back over every lap. The committed row now counts at its copy nearest the rest. Two comments that restated the code go.
|
/approve-spec 4aea43e |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is still a draft.
The earlier blocker is fixed: a looping minute wheel that comes to rest a whole lap away on its committed row now commits nothing, even when that row is outside the bounds (component:DateInput FR13), and two new tests in PickerWheel.test.tsx cover it. The record text for the looping minute wheel (component:TimeInput FR7 and ORD3, component:DateInput FR17 and DEC-3, component:DateTimeInput FR14) is approved at this head, and no public API changes.
The looping wheel and the pager shared mod and nearestLoopCopy through a new utils/loopIndex.ts module. usePager already exports nearestLoopCopy, and its own mod is the same function. The wheel now imports both from usePager, which exports mod, and the new module and its test go.
AST-094 names usePager's mod and nearestLoopCopy, which DateInput's looping picker wheel imports. DateInput's record names restingLoopStep and loopedStep, the loop steps that wheelOptions.ts exports.
|
/approve-spec e81a587 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is still a draft; it carries ci:run, so CI runs once it is marked ready.
The record text for the looping minute wheel (component:TimeInput FR7 and ORD3, component:DateInput FR17 and DEC-3, component:DateTimeInput FR14, and the spec:AST-094 line naming the shared loop helpers) is approved at this head. The tests for the loop, the rest and key rules across the seam, and the hidden copies pass, and no public API changes. One non-blocking suggestion is inline: two comments in PickerWheel.tsx retell the functions below them.
| // Draws the copies over `next`, or none. It adds the positions it lacks and | ||
| // drops those past the span. `isRedrawn` draws every copy again. |
There was a problem hiding this comment.
Miss, non-blocking (architecture:knowledge-contracts INV29): this comment retells drawCopies step by step, and the one at line 364 retells cover. The reason, that the copies are drawn directly so a gesture never re-renders the wheel, is already stated above copiesRef at line 282. Both comments can go.
|
Decision: D-20261111-237 |
|
Decision: D-20261111-242 |
|
/approve-spec e81a587 |
|
Decision: D-20261111-242 |




































User need
On iOS, a time picker's minute wheel loops: past 59 comes 00, and the hour stays. Astryx's touch sheet stops at :59.
Problem and solution fit
isLoopingswitch: its first row follows its last.Current specification
component:TimeInputFR7 and ORD3,component:DateInputFR17 andcomponent:DateTimeInputFR14 now say passing the seam keeps the hour; FR7 scopes the loop to a coarse primary pointer. Newcomponent:DateInputDEC-3 records the decision. The motion table gainswheels.minuteSeamKeepsHour.wheels.meridiemFollowsHourdrops a stale carry note. DateInput's Ownership boundary andspec:AST-094name the loop helpers the wheel shares.Public delta and caller burden
Design and alternatives
nearestLoopCopyandmodfrom usePager, which the pager uses.Evidence
06ab7f9840, main's wheel, fails 29 of 248 tests.Scope
Components: Wheel, TimeInput, DateTimeInput
Merges after #9810, #10284 and #8200, which import usePager, so this edit lands after their device checks. Its usePager hunk conflicts with #10592 and #10927; whichever merges second resolves it.
Testing
Gates at
e81a587b24, on mainebb9ddecc0.pnpm exec vitest run --project ui packages/core/src/DateInput packages/core/src/TimeInput packages/core/src/DateTimeInput: 1219 tests pass.4aea43e16c, the sandbox page does the same: the clip. From 11:58 AM a fast flick up rests on 11:38 AM, and a flick back rests on 11:58 AM. The hour and AM never change. The recorder dropped frames for 0.15 to 0.25 s at a time, mostly as a swipe began, so the clip jumps there. None of the recording's 1,215 frames is blank. The two commits since change no behavior: the wheel takes the same two functions from usePager, and two records gain a line. A run at this head is pending.One sighting was not reproduced. On one of two iOS 26.2 simulators at
b8c835418d, the first fast flick after the page loaded blanked the minute column mid-coast. The blank lasted 47 frames, about 0.8 s. Over seven fast flicks there, only those 47 of 4,863 frames were blank. A first flick on the other simulator was clean. Main's wheel, the same flick: 0 of 679 frames blank.4594d5cba1carries this head's two new tests onb8c835418d's wheel and fails both.Public and internal API delta
@astryxdesign/core, merge baseebb9ddecc0against this head, has 0 added, changed or removed rows.hooks/usePager.tsexports its existingmod, and the wheel importsmodandnearestLoopCopyfrom it. Usage:import {mod, nearestLoopCopy} from '../hooks/usePager'. Why: usePager already exportsnearestLoopCopy, so no new module is needed.spec:AST-094names both as shared.WheelProps.isLooping?: boolean, an option of the internalWheel. Usage:<Wheel options={minutes} value={58} onChange={setMinute} isLooping />. Why: TimeWheels turns it on for the minute column. It is off by default, and the mouse column ignores it.WheelLayout.looping?: boolean. Usage:offsetBounds({rowHeight: 28, rowCount: 60, looping: true}) // {min: -Infinity, max: Infinity}. Why: a loop has no ends to rubber-band.restingLoopStepandloopedStepinDateInput/wheelOptions.ts. Usage:restingLoopStep(p => p % 12 < 2, 11, 1, 12) // 1andloopedStep(() => true, 59, 1, 60) // 1. Why: a rest and a key step find the nearest enabled row around the seam. DateInput's Ownership boundary names them.datePicker.wheels.minuteSeamKeepsHour: true. Usage:datePicker.wheels.minuteSeamKeepsHour // true. Why: it records the measured iOS behavior that the time wheels follow.ebb9ddecc0, with chunk hashes normalized: +1,007 B gzip (+3,227 B raw). Nearly all of it, +979 B gzip, is in the chunk that holds the wheel. A fresh rebuild of the same code is byte-identical.ebb9ddecc0..e81a587b24), in 21 files: source +617/−104, tests +743/−1, docs and changeset +60/−34.Writing rubric results
Rejected:line.