Skip to content

Add native spring easing for motion and style transitions - #207

Merged
Ernxst merged 2 commits into
mainfrom
feat/196-spring-easing
Sep 1, 2026
Merged

Ernxst merged 2 commits into
mainfrom
feat/196-spring-easing

Conversation

@Ernxst

@Ernxst Ernxst commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Fixes #196.

Summary

  • add the shared { type: "spring", stiffness?, damping?, mass?, velocity? } easing object to both MotionTransition.ease and StyleTransition.easing
  • drive motion and state-style springs through native closed-form damped-spring tracks, preserving the painted position and per-channel velocity when interrupted
  • derive spring completion from unit-aware settling thresholds, keep delay semantics, and ignore fixed duration for springs
  • reject unknown spring tags, unknown fields, and invalid physical parameters through the existing motion/style rejection paths
  • document the browser mirror as sampled CSS linear() easing

The object wire format deliberately matches remorses/gpuix#34 for reconciliation, while this implementation keeps the existing native track machinery and adds no JavaScript frame loop. Defaults are Motion's 100 / 10 / 1, and springs are available on both motion targets and state-style transitions.

Verification

  • bun run build --target aarch64-apple-darwin in packages/native
  • bun run test in packages/react: 719 passed, 0 failed, 0 skipped (42 files)
  • bun run test in examples: 54 passed, 0 failed, 0 skipped (7 files)
  • cargo test --lib in packages/native: 344 passed, 0 failed, 0 ignored
  • fail-before: the initial four native spring specs failed 0/4 and the state-style binding test snapped directly to its target; pass-after: eight targeted native spring regressions and both React spring effect tests pass

@Ernxst
Ernxst merged commit 5387da3 into main Sep 1, 2026
@Ernxst
Ernxst deleted the feat/196-spring-easing branch September 1, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spring easing for transitions and motion (stiffness/damping/mass)

1 participant