Skip to content

[KS][MOT] API: Windows motion engine (Composition) #237

Open

Description

@sethwebster

Part of #42 · Umbrella #9 · Task key MOT.win-core · Follow-up to #174

Goal

A Windows implementation of the @legendapp/spark/motion engine from #174. Today getMotionAvailability() reports unsupported-platform on Windows, every operation fails with E_UNSUPPORTED_PLATFORM, MotionView throws it when rendered, and packages/motion declares no Windows native project.

Why it was not done in #174

Design (from docs/motion.md#windows)

  • Reuse packages/motion/cpp (spark::motion::Engine) unchanged: it is portable C++ with no platform types and already does solving, interruption, timelines, completion and baking.
  • RNW glue resolves the element's Visual with ElementCompositionPreview and converts each baked channel into linear KeyFrameAnimations on Offset, Scale, RotationAngleInDegrees (centre point at half size) and Opacity. Loop periods use IterationBehavior.Forever.
  • Scroll links observe ScrollViewer.ViewChanged; frame telemetry and the virtual clock (CompositionAnimationController pause, driver setClock/advanceClock) need a Windows driver too.
  • Define Fluent-tuned spring presets alongside the macOS (SwiftUI) presets.

Scope

  • RNW module and SparkMotionView component in packages/motion/windows, sharing the C++ engine
  • Truthful getMotionAvailability() on Windows; Windows presets in spring()
  • motion-system flows run on Windows x64 and ARM64

Acceptance

  • The Kitchen Sink motion-system screens animate on Windows, light/dark, LTR/RTL
  • A 500 ms JavaScript block during an animation drops no frames
  • MOT-* checks list windows in platforms and pass in the release gate

Blocked by

Activity

  1. added
    sparkLegend Spark desktop framework
    kitchen-sinkKitchen Sink verification app
    type:taskAgent-sized unit of work
    kind:apiMissing or incomplete Spark API
    priority:p1Required for full gate
    on Oct 11, 2026
  2. sethwebster commented on Oct 12, 2026

    @sethwebster
    CollaboratorAuthor

    Scope addition from #176 (MOT.effects): the Windows engine also needs the visual-effect properties (OKLCH backgroundColor, borderRadius, shadow, blur, rotateX/rotateY/perspective, mask insets), MotionNumber and MotionText (which only need the engine and MotionView), and a design for symbol effects (SF Symbols do not exist on Windows). All of them are typed E_UNSUPPORTED_PLATFORM on Windows today; docs/motion.md#windows sketches the Composition mapping.

  3. sethwebster commented on Oct 12, 2026

    @sethwebster
    CollaboratorAuthor

    Scope from #407 (PR #430): MotionMaterial and getMaterialAvailability are typed unsupported on Windows (E_UNSUPPORTED_PLATFORM / unsupported-platform) until Composition backdrop brushes are wired. Intended glue (docs/motion.md#windows): withinWindow → CreateBackdropBrush, behindWindow → CreateHostBackdropBrush (with Acrylic-style blur and tint effects); materialIntensity and materialTintOpacity → the brush visual's and the tint visual's Opacity keyframes from the shared engine bake; a material change → two brush visuals crossfaded by materialCrossfade. Reduce Transparency → UISettings.AdvancedEffectsEnabled.

  4. sethwebster commented on Oct 13, 2026

    @sethwebster
    CollaboratorAuthor

    Scope added by #406 (MotionShape: shape morph and stroke drawing). On Windows MotionShape throws E_UNSUPPORTED_PLATFORM like every motion component (checked by e2e/flows/motion-system/windows-unsupported.yaml, MOT-UNSUP-01). Intended glue: a CompositionSpriteShape whose CompositionPathGeometry takes the engine's baked sample paths (every path has the same cubic structure, as on macOS) as PathKeyFrameAnimation keyframes for morph; strokeStart/strokeEnd onto TrimStart/TrimEnd, strokeWidth onto StrokeThickness, and fillColor/strokeColor onto CompositionColorBrush ColorKeyFrameAnimations (each sample converted from OKLCH). lineCap, lineJoin and fillRule map onto StrokeStartCap/StrokeEndCap, StrokeLineJoin and CompositionPathGeometry's fill rule. See docs/motion.md#shapes.

  5. sethwebster commented on Oct 13, 2026

    @sethwebster
    CollaboratorAuthor

    Scope added by #405 (PR #442: MotionShader shader effects and MotionEmitter particles). On Windows MotionShader and MotionEmitter throw E_UNSUPPORTED_PLATFORM, startParticles/stopParticles reject with it, and getShaderEffectAvailability/getParticleAvailability report unsupported-platform (checked by e2e/flows/motion-system/windows-unsupported.yaml, MOT-UNSUP-01). Intended glue (docs/motion.md#windows): ripple and distortion as Win2D DisplacementMapEffect brushes over a CompositionVisualSurface of the element, the specular sweep as an animated CompositionLinearGradientBrush, the dissolve as a precompiled pixel shader behind a CompositionEffectBrush mask (or a Direct2D custom effect), and particles as a Composition sprite pool, with the same 1,000-particle budget, Reduce Motion rules and built-in-only shaders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:motionMotion & flourisheskind:apiMissing or incomplete Spark APIkitchen-sinkKitchen Sink verification appplatform:windowsWindows-specificpriority:p1Required for full gatesparkLegend Spark desktop frameworktype:taskAgent-sized unit of work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions