feat: corpus-back AnimatePresence, useScroll, useSpring + motion loader refactor#84
Merged
KailasMahavarkar merged 4 commits intomainfrom Apr 21, 2026
Merged
Conversation
…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>
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.
Summary
src/plugins/motion/tools/get-api.tscorpus loader from a hardcodedmotion-only lookup to a generic per-API lookup keyed by normalized API name, matching the reactflow patterncorpus/frontend/motion/index.yamlTest plan