Make the Motion autoplay option opt-in - #637
Conversation
The examples used data-option-no-autoplay more often than not, so the default was wrong: autoplay now defaults to false and playback on mount is enabled with the presence-based data-option-autoplay attribute. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8
Specs asserting playback on mount now set data-option-autoplay, specs asserting manual playback mount bare, and the default spec asserts that animate keyframes without the attribute do not play. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8
Rewrite the autoplay option docs (default false, enabled with data-option-autoplay), drop data-option-no-autoplay from every story and example, and add data-option-autoplay to the stories that play on mount. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8
Code ReviewRisk: Low — The opt-in autoplay change is implemented consistently and is safe to merge. Changes Review usage: 85,836 in (63,942 cached) / 731 out tokens — $0.0191 (openrouter/openai/gpt-5.6-luna, thinking: low) Reviewed by @weareikko/code-review v0.9.5 for commit 19a5bfa. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #637 +/- ##
=========================================
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:
|
Export sizeBundled per export with peer dependencies left external, dynamic imports excluded and the output minified; sizes are gzipped. @studiometa/ui-motion
Unchanged (127)@studiometa/ui
@studiometa/ui-mapbox
@studiometa/ui-motion
|
What
Flip the
Motionautoplayoption from defaulttrueto defaultfalse: theanimatekeyframes now play on mount only whendata-option-autoplayis present.The examples used
data-option-no-autoplaymore often than not, so the old default was wrong — mostMotionusage is driven by anAction, aMotionSequence, aMotionScrollTimelineor a timer, not by mount-time playback. With afalsedefault, the presence-baseddata-option-autoplayattribute reads better than the negatedno-prefix, which no longer exists for this option.The sweep covers the package docblocks (
Motion,MotionSequence,MotionScrollTimeline), the tests, the README, the reference pages and every story: interaction- and timeline-driven stories dropdata-option-no-autoplay, and the stories that play on mount (Motionbasic,MotionSequenceusage snippets) gaindata-option-autoplay.No changelog entry: the
@studiometa/ui-motionpackage is unreleased and the existing Unreleased lines already cover it.Test plan
npm run test: 106 files, 879 tests passed (3 skipped, 1 todo)npm run lint: 0 errors, 20 warningsnode scripts/validate-reference.ts: 66 reference entries, 273 symbols, 5 conceptsnpm run build --workspace=@studiometa/ui-motionpasses and the playground deps regenerate withautoplay: Boolean🤖 Generated with Claude Code
https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8