Repository navigation
feat(Slider): every pointer drags a thumb by its travel, as UISlider does - #8190
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batch: Slider · finger tracking
Implements
component:SliderFR7 (#9407): every pointer drags a thumb by its travel, as UISlider does. It supersedes #8189, #8669 and #8168, which close when it merges. It runs onmain's harness.Evidence
iOS 26.2 simulator, Android 15 emulator; the gray dot is a finger.
User need
A Slider jumped its thumb to the pointer and trapped vertical swipes. UISlider moves the thumb by the travel and coasts after a flick.
Change
::beforeis a 48 px target. It lifts and drops on thesliderLiftandsliderDroproles, and a drag into an end plays UISlider's haptic where the browser vibrates. A flick coasts onsprings.sliderRelease, withonChangethrough it andonChangeEndwhen it settles. A finger on the coast stops it where it is drawn, and the coast follows the track's live length.onChangeEnd.Public delta and caller burden
No API change. A press no longer sets a value, a mouse drag starts after 10 px, and
onChangeEndfollows a flick's coast.Size
About +37 KB gzip, shipping as is; the live-length re-map reuses core's shared ResizeObserver. A follow-up loads the touch layer after hydration or on the first pointer. A single slider renders 14 elements (11 on
main), a range 19 (16): a travel box for container units, a value anchor for the tooltip, and the fill's clip. The touch target adds none.Design and alternatives
Keeping jump-to-pointer for a mouse was rejected: FR7 covers every pointer. #4050's resize mid-drag is handled: a drag and a coast follow the track's length. #7516's off-grid max is not addressed: with max 100 and step 3, a drag reaches 100 only past the end.
Current specification
component:SliderFR5–FR7, ORD2, DEC-4;spec:AST-094FR4, FR9, FR13, FR19, FR23, FR42, FR43;spec:AST-017FR60;design:reduced-motionDR2.Scope
Testing
Local gates at a610788: build, Storybook build, typecheck, strict lint (no warnings in changed files), check:knowledge, Slider's interaction specs in Chromium (23 passed) and WebKit (18 passed, 5 behind engine-limit guards), and the catch test ×80 at 4 workers on an exclusive 2-core pair (80 passed, no runner faults). Core and cli unit tests: 26,099 passed; 5 cli integration tests timed out at 30 s under machine load, and pass alone (211 of 211 in their three files), which this pull request does not touch. The provenance baseline check fails only on
main's own four stale entries (ChatComposer, Item, layerSurfacePress, Token), which this pull request does not carry; its own entries match.Red first: the focus case fails on the previous head for a finger and a pen; the disable-mid-drag case fails without the cancel; the zero-width case fails without the guard; a track tap that sets an end played the haptic before the pan check; two sliders made two observers before the shared one. On the previous stack, the catch's stop check failed 16 of 20 runs without the drawn-translate stop, and its visual check 20 of 20 without the live-length re-map.
The WebKit form of the busy-main-thread proof moves out of this pull request to a follow-up stacked on #9545, "Slider: the WebKit busy-main-thread proof on the paced touch play". On
main's harness WebKit's injected touches bunch behind a stalled dispatch, and its JPEG cast moves in 2 px steps, so the proof cannot judge the coast there. Here the proof runs in Chromium, and its WebKit run carries the harness's engine-limit guard until the follow-up replaces it.Writing rubric results
R1–R6 pass for every record edit: FR7's sentences, Slider's system specs, verification row and removed gap, AST-094's path list, the role table. No research, history or open questions.