Skip to content

Fix incorrect spring stiffness default in docs#3672

Open
Dakshh-Agarwal wants to merge 1 commit intomotiondivision:mainfrom
Dakshh-Agarwal:fix-spring-stiffness-docs
Open

Fix incorrect spring stiffness default in docs#3672
Dakshh-Agarwal wants to merge 1 commit intomotiondivision:mainfrom
Dakshh-Agarwal:fix-spring-stiffness-docs

Conversation

@Dakshh-Agarwal
Copy link
Copy Markdown

Summary

Fixes the incorrect default value shown for stiffness in the docs.

Changes made

  • Added explicit TSDoc @default values for spring options in SpringOptions
  • Set stiffness to 100
  • Also documented damping as 10 and mass as 1

Notes

The docs appear to be generated from source metadata, and the runtime implementation already uses stiffness: 100 in springDefaults.

Issue

Closes #3664

@Dakshh-Agarwal
Copy link
Copy Markdown
Author

Opened a PR to fix this by adding explicit TSDoc defaults for the spring options metadata.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 6, 2026

Greptile Summary

This PR adds explicit TSDoc @default annotations to three properties — stiffness, damping, and mass — in the SpringOptions interface in packages/motion-dom/src/animation/types.ts. The fix ensures auto-generated documentation accurately reflects the actual runtime defaults defined in springDefaults within spring.ts.

  • The documented defaults (stiffness: 100, damping: 10, mass: 1) exactly match the values in the springDefaults object in packages/motion-dom/src/animation/generators/spring.ts (lines 23–25).
  • The prose descriptions already mentioned these defaults in plain text ("Set to 100 by default") — the @default tags make them machine-readable for doc generators.
  • No logic, runtime behavior, or tests are affected; this is a pure documentation change.

Confidence Score: 5/5

Safe to merge — purely additive TSDoc annotation change with no runtime impact.

No logic changes, no API surface changes, and the documented default values have been verified against the actual springDefaults implementation. Zero risk of regression.

No files require special attention.

Important Files Changed

Filename Overview
packages/motion-dom/src/animation/types.ts Adds @default TSDoc tags (100, 10, 1) to stiffness, damping, and mass in SpringOptions; values verified against springDefaults in spring.ts.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[SpringOptions interface\npackages/motion-dom/src/animation/types.ts] -->|TSDoc @default tags| B[stiffness: 100]
    A -->|TSDoc @default tags| C[damping: 10]
    A -->|TSDoc @default tags| D[mass: 1]
    E[springDefaults\npackages/motion-dom/src/animation/generators/spring.ts] -->|runtime default| B
    E -->|runtime default| C
    E -->|runtime default| D
    B & C & D -->|consumed by| F[Doc generator]
    F -->|renders correct defaults| G[Public docs site]
Loading

Reviews (1): Last reviewed commit: "Fix incorrect spring default values in d..." | Re-trigger Greptile

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.

Docs site has incorrect default value for spring stiffness

1 participant