plans/issues/issue-2205.md
Executor instructions: Follow this plan step by step. If anything in "STOP conditions" occurs, stop and report. When done, update this plan's row in
plans/issues/README.md.Drift check (run first):
gh api repos/motiondivision/motion/issues/2205 --jq '.state'→open(if closed, mark DONE and stop).
42bfbe3ed, 2026-06-11The 2023 request — animate([[...anim1], [...anim2], [() => { /* do something */ }, { at: '<' }]]) — was implemented on main in 2026 and the
issue was never closed. The thread also contains two secondary asks
(per-segment onComplete; sequence-level onComplete) that current API
answers. Closing with the exact syntax + version resolves a 5-comment
thread.
0d7a2b7db "Adding support for callbacks in animation sequences"
(2026-02-03), first released in v12.31.1 (git tag --contains 0d7a2b7db).packages/framer-motion/src/animation/sequence/types.ts:92-101 —
SequenceProgressCallback = (value: any) => void and FunctionSegment
([callback], [callback, options], [callback, keyframes, options]),
part of the Segment union (line 112).packages/framer-motion/src/animation/animate/sequence.ts:23-37
— function segments are pre-processed into a motionValue(0) segment
animating [0, 1] (or the user-supplied keyframes) with the callback
subscribed via mv.on("change", callback). So the callback receives the
animated progress value every frame during its window of the timeline,
honoring at, duration, easing, etc.{ forwards, backwards } one-shot semantics.types.ts:12-23 (LifecycleCallbacks omitted from segment
transition options, commit 47cf13955) because segments are
consolidated into one animation per subject.SequenceOptions.onComplete
(types.ts:122, wired in animate/index.ts:119-124, commit
21869e9a3) — this answers Curve's 2025-01-02 comment.if (v === 1) ...).npx jest --config packages/framer-motion/jest.config.json --testPathPattern="sequence"
→ passes. Confirm a test exercising function segments exists:
grep -rn "typeof segment\[0\]\|function segment\|() =>" packages/framer-motion/src/animation/sequence/__tests__/index.test.ts | head
and/or git show 0d7a2b7db --stat (the commit includes tests). If no test
covers [callback, { at: ... }] placement, run a throwaway check (do not
commit) before answering.
plans/issues/README.md row APPROVED): Answer and closeComment on #2205: the requested syntax works as written since v12.31.1
([email protected]), with a short example mirroring the issue's own snippet,
plus the SequenceOptions.onComplete answer for the thread's follow-up ask
and the note that per-segment onComplete is intentionally unsupported
(segments merge into one animation per subject). Close:
gh api -X PATCH repos/motiondivision/motion/issues/2205 -f state=closed -f state_reason=completed
plans/issues/README.md row updatedat
ignored) → real regression; report with the failing case instead of
closing.