Investigate #3407: same root cause as #3265, fixed in #3593#3706
Conversation
The Chrome-spring-feels-stuck behaviour reported in #3407 has the same root cause as #3265 (fixed in PR #3593, commit e931020): every target update interrupts the spring animation, and reading `value.getVelocity()` after `stopAnimation()` collapses to a cross-animation finite difference of ~0. The fix reads the spring generator's analytical velocity before stopping the animation. Annotate the existing follow-value-framerate test so #3407 traces back to the same regression gate.
Greptile SummaryThis PR makes no functional changes — the only diff is renaming the
Confidence Score: 5/5Safe to merge — the entire change is a one-word addition to a test description string with no effect on runtime behaviour or test logic. The only changed line is the describe block label in a test file. No assertions, no setup, no production code, and no imports are touched. The underlying regression gate continues to pass unchanged, and the rename accurately reflects the dual-issue coverage. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Issue #3407 reported\n(Chrome spring stuck)"] --> B["Root cause traced:\ngetVelocity() returns ~0\nafter single-frame stop"]
B --> C["Same root cause as #3265"]
C --> D["Already fixed in PR #3593\ngetGeneratorVelocity() added"]
D --> E["follow-value-framerate.test.ts\ndescribe block renamed\nto reference #3265 + #3407"]
E --> F["No code change needed\n✅ Covered by existing test"]
Reviews (1): Last reviewed commit: "Investigate #3407: link existing #3265 f..." | Re-trigger Greptile |
Fixes #3407 (recommend closing as already fixed)
Summary
Issue #3407 reports a Chrome-only spring animation bug where a
useSpring-driven cursor follower feels "stuck" and resists orbiting the cursor. After investigation, this appears to be the same root cause as #3265, which was already fixed by PR #3593 (commite93102089, shipped in v12.35.2 and later).This PR is a draft for tracking purposes — no fix is required. The only diff is a test rename annotating that #3407 is covered by the existing regression gate at
packages/motion-dom/src/value/__tests__/follow-value-framerate.test.ts.Background
12.29.1-alpha.0. That alpha did not yet contain the velocity-preservation fix.sampleAt/canSampleVelocityAPI toJSAnimationto read pre-stop velocity via a 5ms finite difference. Closed without merge.e93102089("Fix laggy spring animations at high refresh rates (240hz)") which addresses the same root cause more cleanly: it addsJSAnimation.getGeneratorVelocity()(analytical derivative from the spring formula) and reads it inattachFollow.startAnimation()before stopping the active animation. It also stabilises theframe.postRenderreference so multiple per-frame events deduplicate.Why #3407 and #3265 are the same bug
Both reports trace to:
Current
follow-value.tsalready does the right thing:Verification
packages/motion-dom/src/value/__tests__/follow-value-framerate.test.tssimulates a moving target at 60hz vs 240hz with vsync-aligned interruptions every frame:getGeneratorVelocity()line back tovalue.getVelocity()drops the ratio to ~0.78 — the test fails for the right reason and reproduces the "stuck" behaviour described in [BUG] Spring animation is broken on Chrome (works on Firefox/Safari) (Mac) #3407.Recommendation
Ask the reporter to upgrade to v12.35.2 or later (current latest: v12.38.0). If they still see the regression on the latest version, reopen with a fresh CodeSandbox so we have a real repro to chase.
Test plan
follow-value-framerate.test.tspasses against currentmainfollow-value-framerate.test.tsfails whengetGeneratorVelocity()is reverted tovalue.getVelocity()(ratio 0.78 < 0.9)yarn buildsucceedsyarn test— 793 passed, 7 skipped, 0 failed