Skip to content

chore(core): UISlider's measured values - #8189

Closed
vjeux wants to merge 859 commits into
meta:mainfrom
vjeux:uikit/c03-slider-values
Closed

vjeux wants to merge 859 commits into
meta:mainfrom
vjeux:uikit/c03-slider-values

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Slider · finger tracking

Superseded by #8190, which carries this change on main's current base. This pull request closes when #8190 merges.

Depends on #8076 (at 6f994bc). Review only this PR's change: vjeux/astryx@6f994bc...ca43cee

User need

Part of Astryx's UIKit-parity work (spec:AST-094), which makes touch presentations behave as on iOS. #8190 makes a Slider under a finger track like UISlider, and needs UISlider's real numbers: FR1–FR3 require a touch presentation's values to come from the UIKit constants table, each with its source.

Problem and solution fit

motion/uikit/slider.ts holds UISlider's values on iOS 26.2, each with its measurement:

  • Touch target: 48 pt, the 37 × 24 thumb grown by its hit insets; a tap on the track does nothing.
  • Tracking: the value moves by the finger's travel past a 10 pt threshold, over the track's length.
  • Release: a critically damped 0.4 s spring toward the lift value plus 0.4 of the momentum projection; none after a lift outside the bounds.
  • Lift and drop: ×1.55 on 0.215 s / 0.6, back on 0.5 s / 0.7.
  • Haptic: once per arrival at an end. Reduce Motion: the animator's policy; no mode of its own.

Current specification

spec:AST-094 FR1–FR3. component:Slider sets no touch physics.

Public delta and caller burden

None: an internal table ([chore]), unread here; touch motion has no theme surface.

Design and alternatives

  • Measured, not tuned by eye: a tuned value looks right in one demo and drifts from iOS; each value here comes from the lab's logs.
  • Travel, not position: the thumb travels 263 of the track's 300 pt, so it lags the finger, and mapping the finger's position would jump. Every logged valueChanged matches the travel rule to 10⁻⁴.
  • The coast uses UIKit's own settings, read at the lift. The lift uses the per-frame fit, which overshoots more than the read settings, as UISwitch's lens does (chore(core): UISwitch's measured values and flip rule #8123).

Evidence

A UIKit host app on the iOS 26.2 simulator (iPhone 17 Pro, real touches) logged valueChanged, the thumb's frames and four releases. The coast fits within 0.11 pt rms; a 126.9 pt/s release travelled 12.56 pt after the lift, against 12.64 pt predicted.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

Data only; #8190 is its first reader. To check it:

  1. Read motion/uikit/slider.ts: each value names its measurement.
  2. Run pnpm exec vitest run --project ui packages/core/src/motion/uikit: slider.test.ts replays the logged drags and releases (tracking, lift and drop, coast) and holds the table to no Reduce Motion mode.

Run on this head: the UIKit table tests pass (196), and typecheck and lint are clean.

Loading
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants