Skip to content

feat: corpus-back AnimatePresence, useScroll, useSpring + motion loader refactor#84

Merged
KailasMahavarkar merged 4 commits intomainfrom
feat/corpus-motion-apis
Apr 21, 2026
Merged

feat: corpus-back AnimatePresence, useScroll, useSpring + motion loader refactor#84
KailasMahavarkar merged 4 commits intomainfrom
feat/corpus-motion-apis

Conversation

@KailasMahavarkar
Copy link
Copy Markdown
Collaborator

Summary

  • Refactors src/plugins/motion/tools/get-api.ts corpus loader from a hardcoded motion-only lookup to a generic per-API lookup keyed by normalized API name, matching the reactflow pattern
  • Adds 3 corpus-backed Motion API slices: AnimatePresence, useScroll, useSpring
  • Each slice is registered in corpus/frontend/motion/index.yaml
  • Test file asserts corpus source for every migrated slice; fallback check rotates to the next un-migrated API (useAnimate)

Test plan

  • bun test tests/motion-corpus-backed-tools-behaviour.test.ts - 5 pass
  • bun run build - typecheck exit 0
  • Full regression across 19 test files - no failures

KailasMahavarkar and others added 4 commits April 22, 2026 02:17
…ence

Refactors `src/plugins/motion/tools/get-api.ts` corpus loader from a hardcoded `motion`-only lookup to a generic per-API lookup keyed by normalized API name. Matches the reactflow pattern so new Motion API slices can be added by dropping YAML into `corpus/frontend/motion/` and registering in the namespace index.

Adds corpus/frontend/motion/animatepresence.yaml with the AnimatePresence contract (props, modal + page-transition examples, key/propagate tips).
Registers animatepresence in namespace index.
Test asserts corpus source for AnimatePresence; fallback check moves to useScroll.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/motion/usescroll.yaml with the scroll-linked MotionValue hook contract (props, window/element/target usage patterns, progress-bar / reveal / horizontal examples, offset tips).
Registers usescroll in namespace index.
Test asserts corpus source for useScroll; fallback check moves to useSpring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/motion/usespring.yaml with the spring-physics MotionValue hook contract (stiffness/damping/mass props, scroll-smoothing + mouse-follower examples).
Registers usespring in namespace index.
Test asserts corpus source for useSpring; fallback check moves to useAnimate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@KailasMahavarkar KailasMahavarkar merged commit 5fa9e65 into main Apr 21, 2026
4 checks passed
@KailasMahavarkar KailasMahavarkar deleted the feat/corpus-motion-apis branch April 21, 2026 20:53
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.

1 participant