dont-pre-animate-a-self-animating-property

Installation
SKILL.md

Do not pre-animate what the component already animates

Some components take a property that they animate internally: they hold their own directional specs and drive the value themselves. The correct input is the destination. Handing them a smoothed path to that destination is not "smoother" — it is a new instruction every frame.

// as written — a raw 0f/1f flip, deliberately not animateFloatAsState
val targetAmplitude = if (isPlaying && !isInteracting) 1f else 0f

Traps

The component's update guard drops targets that arrive mid-animation, so the first one wins. An external tween delivers roughly sixty slightly different values per second. The first frame starts an internal animation towards something very close to the old value — 0.97 rather than 0 — and every smaller target after it is swallowed while that animation is still in flight. The visible result is a property frozen just short of its start: here, a wave stuck near full ripple after the audio paused. Nothing errors, and it reproduces on device far more readily than in a preview.

Installs
2
GitHub Stars
35
First Seen
6 days ago
dont-pre-animate-a-self-animating-property — maxrave-dev/kotlin-footguns