Skip to content

Comments

[pull] main from motiondivision:main#208

Merged
pull[bot] merged 18 commits intocode:mainfrom
motiondivision:main
Feb 3, 2026
Merged

[pull] main from motiondivision:main#208
pull[bot] merged 18 commits intocode:mainfrom
motiondivision:main

Conversation

@pull
Copy link

@pull pull bot commented Feb 3, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

claude and others added 18 commits February 1, 2026 07:11
This implements #2205 - callbacks can now be injected at specific points
in an animation sequence. Callbacks support both forward (onEnter) and
backward (onLeave) firing for scrubbing support.

Usage:
```js
animate([
  [element, { x: 100 }, { duration: 1 }],
  [{ onEnter: () => console.log("midpoint!") }, { at: 0.5 }],
  [element, { y: 200 }, { duration: 1 }],
])
```

Implementation has minimal overhead:
- SequenceCallbackAnimation is lightweight (no DOM ops, just time tracking)
- Callbacks are sorted and stored separately from animations
- Only fires callbacks when time crosses thresholds

https://claude.ai/code/session_01Es5grCjnfwALQxsWvrrpzF
- Rename onEnter/onLeave to forward/backward for clarity
- Remove dedicated SequenceCallbackAnimation class
- Use animateSingleValue(0, 1) with onUpdate to track time crossings
- Much simpler implementation with same functionality

https://claude.ai/code/session_01Es5grCjnfwALQxsWvrrpzF
Just destructure animationDefinitions directly from
createAnimationsFromSequence instead of wrapping it.

https://claude.ai/code/session_01Es5grCjnfwALQxsWvrrpzF
Return ResolvedAnimationDefinitions directly instead of a wrapper object.
Callbacks are passed via an optional out-parameter that only
animateSequence uses. WAAPI path and tests are unaffected.

https://claude.ai/code/session_01Es5grCjnfwALQxsWvrrpzF
onPanStart/onDragStart were deferred via frame.postRender(), causing
them to fire after onPan/onDrag which ran synchronously in the update
phase.

Fix by using frame.update(callback, false, true) for all pan/drag
event handlers. The third argument (immediate) schedules callbacks
into the currently executing update step, so they fire within the
same frame pass in the order they were scheduled: start before move.

https://claude.ai/code/session_01NUF3Mj5SSALV5gSW6AVGn6
…, fix timing assertion

- Rename forward/backward to enter/leave across types, create, and sequence
- Add 4 integration tests: scrubbing thresholds, complete(), cancel() without scrub, cancel() after scrub
- Fix unit test expectation for trailing keyframe offset in callback timing test

https://claude.ai/code/session_01Es5grCjnfwALQxsWvrrpzF
…2056-da0kh

Fix pan event firing order: ensure onPanStart fires before onPan
- Rename leave → exit across types, create, sequence, and tests
- Replace fragile duration lookup with SequenceCallbackData out-parameter
- Simplify isCallbackSegment type guard
- Use optional chaining for callbackData in create.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reorder describe blocks so callback tests run before the buggy
"non-animatable color" test that corrupts frame loop state.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ation-XwKRA

Add sequence callback support for animation timelines
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pull pull bot locked and limited conversation to collaborators Feb 3, 2026
@pull pull bot added the ⤵️ pull label Feb 3, 2026
@pull pull bot merged commit 0d7a2b7 into code:main Feb 3, 2026
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants