Skip to content

Make the Motion autoplay option opt-in - #637

Merged
titouanmathis merged 3 commits into
mainfrom
feature/motion-autoplay-opt-in
Aug 13, 2026
Merged

Make the Motion autoplay option opt-in#637
titouanmathis merged 3 commits into
mainfrom
feature/motion-autoplay-opt-in

Conversation

@titouanmathis

Copy link
Copy Markdown
Contributor

What

Flip the Motion autoplay option from default true to default false: the animate keyframes now play on mount only when data-option-autoplay is present.

The examples used data-option-no-autoplay more often than not, so the old default was wrong — most Motion usage is driven by an Action, a MotionSequence, a MotionScrollTimeline or a timer, not by mount-time playback. With a false default, the presence-based data-option-autoplay attribute reads better than the negated no- 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 drop data-option-no-autoplay, and the stories that play on mount (Motion basic, MotionSequence usage snippets) gain data-option-autoplay.

No changelog entry: the @studiometa/ui-motion package 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 warnings
  • node scripts/validate-reference.ts: 66 reference entries, 273 symbols, 5 concepts
  • npm run build --workspace=@studiometa/ui-motion passes and the playground deps regenerate with autoplay: Boolean

🤖 Generated with Claude Code

https://claude.ai/code/session_01FVXrJ8idMfvt667yJadvB8

titouanmathis and others added 3 commits August 13, 2026 14:02
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
@github-actions

Copy link
Copy Markdown

Code Review

Risk: Low — The opt-in autoplay change is implemented consistently and is safe to merge.

Changes Motion autoplay to default to false, enables mount-time playback through the presence-based data-option-autoplay attribute, and updates the related sequence and timeline documentation. Tests and examples were updated to reflect the new default and explicit opt-in behavior.


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

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.75%. Comparing base (a8c462a) to head (19a5bfa).

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           
Flag Coverage Δ
unittests 87.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/ui-motion/src/Motion.ts 96.59% <ø> (ø)
packages/ui-motion/src/MotionScrollTimeline.ts 92.30% <ø> (ø)
packages/ui-motion/src/MotionSequence.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

Export size

Bundled per export with peer dependencies left external, dynamic imports excluded and the output minified; sizes are gzipped.

@studiometa/ui-motion

Export Size (gzip) Diff
(barrel) 2.44 kB -1 B (-0.0%)
autoload 362 B -1 B (-0.3%)
manifest 322 B -2 B (-0.6%)
MotionScrollTimeline 1.57 kB -5 B (-0.3%)
Motion 1.33 kB -12 B (-0.9%)
MotionSequence 1.53 kB -13 B (-0.8%)
Unchanged (127)

@studiometa/ui

Export Size (gzip) Diff
(barrel) 30.77 kB
AbstractCarouselChild 542 B
AbstractCarouselComponent 219 B
AbstractFrameTrigger 1.11 kB
AbstractPrefetch 438 B
AbstractScrollAnimation 651 B
AbstractSliderChild 489 B
Accordion 1.11 kB
AccordionItem 995 B
Action 1.22 kB
AnchorNav 1018 B
AnchorNavLink 867 B
AnchorNavTarget 166 B
AnchorScrollTo 222 B
Carousel 2.89 kB
CarouselBtn 720 B
CarouselDrag 735 B
CarouselItem 786 B
CarouselWrapper 670 B
CircularMarquee 313 B
ClickOutside 219 B
Cursor 676 B
DataBind 3.97 kB
DataComputed 4.06 kB
DataEffect 4.04 kB
DataModel 4.07 kB
DataScope 1.4 kB
Dialog 1.79 kB
Disclosure 2.39 kB
DisclosureGroup 1.16 kB
Draggable 1.14 kB
Fetch 2.45 kB
FetchShopifyPartial 2.98 kB
FetchShopifySection 2.71 kB
Figure 1.07 kB
FigureShopify 1.35 kB
FigureTwicpics 1.6 kB
FigureVideo 1.27 kB
FigureVideoTwicpics 1.85 kB
Frame 2.51 kB
FrameAnchor 1.2 kB
FrameForm 1.32 kB
FrameLoader 788 B
FrameTarget 1.1 kB
FrameTriggerLoader 801 B
Hoverable 624 B
InView 204 B
InViewOnce 245 B
Indexable 1022 B
LargeText 499 B
LazyInclude 421 B
Menu 1.72 kB
MenuBtn 186 B
MenuList 1.28 kB
Modal 1.13 kB
ModalWithTransition 1.26 kB
Panel 1.52 kB
PrefetchWhenOver 485 B
PrefetchWhenVisible 510 B
ScrollAnimation 806 B
ScrollAnimationChild 979 B
ScrollAnimationChildWithEase 1.25 kB
ScrollAnimationParent 1.05 kB
ScrollAnimationTarget 898 B
ScrollAnimationTimeline 983 B
ScrollAnimationWithEase 1.08 kB
ScrollReveal 1005 B
Sentinel 175 B
Slider 2.28 kB
SliderBtn 745 B
SliderCount 549 B
SliderDots 1.15 kB
SliderDrag 348 B
SliderItem 574 B
SliderProgress 612 B
Sticky 929 B
Tabs 663 B
Target 125 B
Timer 589 B
TimerProgress 731 B
Toast 968 B
Toaster 1.3 kB
Track 1.61 kB
TrackContext 416 B
TrackShopify 1.71 kB
Transition 746 B
ViewTransition 658 B
animationScrollWithEase 438 B
autoload 3.04 kB
manifest 2.99 kB
scheduler 324 B
types 20 B
viewTransition 325 B
withDeprecation 250 B
withIndex 986 B
withScrollAnimationDebug 1.63 kB
withTransition 717 B

@studiometa/ui-mapbox

Export Size (gzip) Diff
(barrel) 6.41 kB
AbstractMapboxControl 1.02 kB
AbstractMapboxMapChild 848 B
MAPBOX_CLUSTER_CONNECTED 143 B
MAPBOX_MAP_CONNECTED 128 B
MapboxCluster 2.13 kB
MapboxClusterItem 644 B
MapboxFullscreenControl 1.17 kB
MapboxGeocoder 1.21 kB
MapboxGeolocateControl 1.23 kB
MapboxImage 1.34 kB
MapboxImages 1.38 kB
MapboxLayer 1.36 kB
MapboxMap 723 B
MapboxMarker 1.11 kB
MapboxNavigationControl 1.21 kB
MapboxPopup 1.17 kB
MapboxSource 1.32 kB
StoreLocator 1.96 kB
autoload 681 B
dependencies 342 B
manifest 639 B
provideMapboxGeocoder 107 B
provideMapboxGl 104 B
resolveMapboxGeocoder 148 B
resolveMapboxGl 139 B

@studiometa/ui-motion

Export Size (gzip) Diff
MotionView 1010 B
dependencies 257 B
provideMotion 102 B
resolveMotion 115 B

@titouanmathis
titouanmathis merged commit cb4fbc1 into main Aug 13, 2026
20 checks passed
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