Improve the Motion-family doc examples - #638
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8
Code ReviewRisk: Low — no blocking issues; safe to merge aside from nits. Improves the Motion-family documentation with replayable mount examples, ambient backdrop and conditional-rendering transitions, scroll-timeline demos, and a MotionSequence hero choreography. The implementation changes are confined to documentation stories and their registration scripts. Still open from earlier reviews (1 finding):
Review usage: 78,168 in (57,918 cached) / 1,308 out tokens — $0.0195 (openrouter/openai/gpt-5.6-luna, thinking: low) Reviewed by @weareikko/code-review v0.9.5 for commit 7c0cebb. Previous review runsPrevious run archived 2026-08-13T14:54:40ZCode ReviewRisk: Low — The documentation examples are safe to merge, with one minor mismatch between the parallax example's stated distances and its keyframes. Adds MotionView ambient backdrop and tighter conditional-rendering examples, two MotionScrollTimeline stories, and a MotionSequence hero-intro story. The examples demonstrate the intended lifecycle, scroll-scrubbing, and sequence-positioning APIs without changing library behavior. 1 issue(s) found:
Review usage: 74,283 in (60,100 cached) / 1,794 out tokens — $0.0172 (openrouter/openai/gpt-5.6-luna, thinking: low) Reviewed by @weareikko/code-review v0.9.5 for commit 3c34b7a. |
| data-option-animate='{ "y": [80, -80] }' | ||
| class="col-start-1 row-start-1 size-72 rounded-full bg-blue-400/30 dark:bg-blue-600/30"></div> | ||
| <div | ||
| data-component="Motion" |
There was a problem hiding this comment.
nitpick: Match parallax distances to the documented travel values
The keyframes move the disc from y: 80 to y: -80, resulting in 160 pixels of travel rather than the documented 80 pixels; the other layers likewise travel 360 and 600 pixels instead of 180 and 300. Use [0, 80], [0, 180], and [0, 300] (or update the documentation to describe the actual displacement).
Confidence: high.
Reviewed by @weareikko/code-review v0.9.5 for commit 3c34b7a.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/motion-autoplay-opt-in #638 +/- ##
=================================================================
Coverage 87.75% 87.75%
Complexity 145 145
=================================================================
Files 153 153
Lines 5415 5415
Branches 1030 1030
=================================================================
Hits 4752 4752
Misses 579 579
Partials 84 84
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
A preview iframe boots and settles its mount animation before a reader looks at it, so the basic Motion story and the MotionSequence hero intro now carry a replay button. Both stories declare their keyframes as [from, to] arrays: a single target value animates from the current state, so replaying a settled animation moved nothing. The animate option documents the distinction. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8
What
Titouan's feedback on the Motion-family documentation examples, in four points.
1. The dialog backdrop is animated too. In the
MotionViewambient dialog story, the backdrop<div>was a static overlay. It is now a secondMotionView(ambient-modal-backdrop), fading betweenopacity-0andopacity-100while keeping itsActionclose behaviour. Both instances join the same dialog lifecycle with zero wiring attributes, which shows thatwaitUntil()is additive: every transitioner that registers on theopen/closeevent is awaited, so any number of them can animate one dialog without knowing about each other. Both view-transition groups now get an explicitz-index, so the backdrop group always stays under the box group.2. A tighter
data-bind:ifwrapper. TheMotionViewwrapped the whole widget, checkbox included. It now sits just outside the<template data-bind:if>, inside theDataScopeblock. The bubblingdom-updateevent still reaches it, so the enter and exit transitions are unchanged, but thelayoutmorph hugs the panel region alone.3. Two more
MotionScrollTimelineexamples.Motionchild is scrubbed fromscaleX: 0toscaleX: 1withorigin-left. Theoffsetis set to["start start", "end end"]so progress follows the article's own scroll instead of the default entering-and-leaving range.Motionchildren over one range, travelling 80, 180 and 300 pixels. The timeline scrubs every child with the same progress, so depth comes from the keyframe distances alone.4. A
MotionSequencehero intro. A badge, a heading, a paragraph and a CTA entering as one autoplaying choreography.data-option-autoplayis on the sequence, never on the children, and the three positioning modes are mixed: DOM order,data-option-at="<"on the paragraph and the relative offsetdata-option-at="-0.2"on the button. No Action-driven replay story was added: the existing Staggered sequence example already coversplay()/reverse()wiring.Test plan
npx prettier --writeon every touched file, andprettier --checkclean throughnpm run lintcd packages/docs && node scripts/validate-reference.ts→ 66 Reference entries, 273 symbols, 5 conceptsnpm run lint→ 0 errors, 20 warnings (unchanged from the base branch)npm run test -- -- Motion/→ 8 files, 58 tests passed🤖 Generated with Claude Code
https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8