Repository navigation
chore(core): UIKit's spring, decay, rubber-band and projection math - #8054
Merged
Merged
Conversation
vjeux
requested review from
cixzhang,
imdreamrunner and
josephfarina
as code owners
October 24, 2026 03:55
4 tasks done
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 24, 2026
|
AI review status for this pull request.
|
4 tasks done
This was referenced Oct 24, 2026
vjeux
force-pushed
the
wip/uikit-pr-m2
branch
from
October 24, 2026 04:12
d62a71f to
c88087c
Compare
4 tasks done
Contributor
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: No accessibility violations detected. Visual Regression48 of 502 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 28 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
This was referenced Oct 24, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Oct 26, 2026
The touch foundation's fold, mergeable against main cd4aca6: her chain on main (meta#8058, meta#8054, meta#8059, meta#8060) and meta#8258's rework, which keeps touch motion internal (no theme surface): the generated role table, its script and the role kinds file are gone, and a table registers only the roles it lists. The motion doc and its golden take meta#8076's side; the role kinds file stays deleted.
cixzhang
added a commit
to vjeux/astryx
that referenced
this pull request
Oct 26, 2026
…cation export reverted; overlap and borrow fixes) Conflicts in animator.ts and the motion README: meta#8056's Reduce Motion plan wins, which already carries a waiting move to the next call's invisible moment and keeps a running dip's borrow. meta#8055's new tests run against the plan, the re-timing one advancing the clock to the landing and the preference change written through the media stub.
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Oct 26, 2026
meta#8076's head is F1's fold on the maintainer's chain now on main (meta#8058, meta#8054, meta#8059, meta#8060): touch motion is internal (the tables register their values as internal motion roles, with no theme surface), and the `isRtlElement` resolver. Conflicts, resolved: - The theme-roles changeset and the motion guide take meta#8076's side; their sentence on ChatLayout's Reduce Motion cross-fade goes with the theme surface. - The CLI goldens for the empty icon set take meta#8076's side and regenerate. - keyboardModel.test.ts reads the internal role registry (`motionRoleIn`) now that the generated role-kind table is gone, and no longer names a theme.
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Oct 26, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Oct 26, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
pushed a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
…math) into the Reduce Motion policy The animator, its tests, the README and the timing table take this pull request's Reduce Motion policy, which already holds meta#8055's decisions: a fade of 200 ms at most, no 'keep', every change at once on any other pointer, and a decay that keeps moving (momentum continues a throw). meta#8055's call option for the instant form gives way to this pull request's rule that no call option changes the policy. meta#8055's coast, its curve type and the presets' use names come through.
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
…to the theme motion roles scroll.ts and timing.ts keep this pull request's registry import beside meta#8053's DELAYS_CONTENT_TOUCHES_MS and press export; springs.viewChange keeps its own copy of UIKit's default spring, so each role has its own leaf; the reference-reading note on springs.menuReducedMotion also says it is not a theme motion role. The role table is regenerated under the use names, and this pull request's tests and docs take them (spec:AST-094 FR4).
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
…heme motion roles
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
… release curve, with main) into the theme motion roles The tables take meta#8053's keys, which already carry spec:AST-094 FR4's use names, beside this pull request's rename map; the role ids are the same either way. The menu reduced-motion spring takes meta#8053's reference-reading note. The role tests reach the table entries by their use names and keep checking that the old preset and curve-shape names are no role ids.
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
pushed a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
added a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
… the press curve pinned) into the animator
vjeux
pushed a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
pushed a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
pushed a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
… plan MEASUREMENTS.md and the motion README take this branch's lines where they conflict: its M-RM1 row (the played 200 ms fade) and the animator rows and section that meta#8054 does not carry.
vjeux
pushed a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
vjeux
pushed a commit
to vjeux/astryx
that referenced
this pull request
Nov 3, 2026
…cation export reverted; overlap and borrow fixes) Conflicts in animator.ts and the motion README: meta#8056's Reduce Motion plan wins, which already carries a waiting move to the next call's invisible moment and keeps a running dip's borrow. meta#8055's new tests run against the plan, the re-timing one advancing the clock to the landing and the preference change written through the media stub.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Depends on #8053 (and its predecessors); review the last two commits. Until #8053 merges at its approved head, this branch also carries two table commits for it,
press.highlightOutCurve(M-PR1) and the velocity note (spec:AST-100FR2), and its merge withmain.User need
Touch presentations need UIKit's motion math: a sheet released at 1,200 pt/s must land on the detent UIKit would pick, with UIKit's spring and the finger's velocity, and a scroll-like surface must coast and resist like a scroll view.
Problem and solution fit
Pure functions for
spec:AST-094FR3:spring.ts: the damped spring in closed form for all three regimes; conversions between SwiftUI's duration and bounce, response and damping ratio, Core Animation's mass, stiffness and damping, and UIKit's legacyusingSpringWithDamping(from UIKit's measured grid); Core Animation's settling duration; a spring chasing a target moving at constant speed. Overdamping clamps to critical, as Core Animation does.decay.ts,rubberBand.ts,projection.ts: UIScrollView's coast, its resistance past an edge (and inverse), and the release target nearest the projected rest, paging included.uikit/values.test.ts: plays the constants table through this math.One intent at 2,050 lines: each module ships with the tests that pin it to independent references.
Current specification
spec:AST-094FR3.Public delta and caller burden
None: internal, not exported, and no component uses it yet. The changeset is
[chore].Design and alternatives
toSpringnormalizes a description kept in its source's vocabulary.Evidence
settlingDurationgrid (underdamped to the last digit, critical within 0.02 %), the durations UIKit gives its spring APIs, and the legacy grid from ζ 0.1 to 1.Scope
Testing
pnpm exec vitest run --project ui packages/core/src/motion: 7 files, 316 tests passed.pnpm build,pnpm typecheck, ui and node suites,pnpm check:repo: clean.pnpm -F @astryxdesign/core typecheck: clean.ASTRYX_STRICT_LINT=1 pnpm exec eslint packages/core/src/motion: clean.pnpm check:changesets,pnpm check:repo(pre-commit): clean.Stack, in merge order: #8053, #8058, #8059, #8060, #8061, #8054, #8257, #8055, #8056, #8067, #8258, #8071, #8072, #8073, #8074, #8076, #8340; #8067 also follows #8043, #8044, #8348, #8045 and #8446. #8062 is on
main.