Pause offscreen homepage adapter motion - #1093
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughLanding-page chart animations now use shared viewport tracking. ChangesVisibility-aware landing animations
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant FrameworkAdapterGraph
participant useInView
participant usePrefersReducedMotion
FrameworkAdapterGraph->>useInView: observe graph container visibility
FrameworkAdapterGraph->>usePrefersReducedMotion: read motion preference
useInView-->>FrameworkAdapterGraph: visibility state
usePrefersReducedMotion-->>FrameworkAdapterGraph: reduced-motion state
FrameworkAdapterGraph->>FrameworkAdapterGraph: run or stop adapter cycling and flow animation
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tanstack-com | c1bd7ba | Commit Preview URL Branch Preview URL |
Aug 04 2026, 10:06 PM |
What changed
Pause the homepage framework-adapter proof's timer and animation-frame loop unless the graph intersects the viewport and the visitor allows motion.
Evidence and impact
FrameworkAdapterGraph, added in #1075, mounted several sections below the fold but immediately started:The animation-frame loop therefore drove roughly 30 React renders per second from initial homepage load even when the proof had never entered the viewport. The active-adapter interval also continued offscreen and for reduced-motion visitors.
The graph now remains static until visible, stops both loops when it leaves the viewport, and keeps the existing animation unchanged while visible. Reduced-motion visitors get the same static proof without either state loop.
Validation
pnpm testgit diff --checkRisk
Low. This changes only when the decorative proof runs; its visible motion, geometry, and content are unchanged.
Summary by CodeRabbit
Accessibility
Performance