Progressbar snapping jitter#489
Conversation
Refactor useDebounce hook for better readability
❌ Deploy Preview for github-spy failed.
|
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 16 minutes and 13 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 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 |
|
@mehul-m-prajapati @Srijatalamarla @ASR1015 @md-asharaf please kindaly review this pr |
|
🎉🎉 Thank you for your contribution! Your PR #489 has been merged! 🎉🎉 |
Related Issue
Description
🧱 The Architectural Context:
Seamless user experiences depend on smooth, gradual transitions. Conditional rendering (
{condition && ...}) completely unmounts old DOM nodes and attaches fresh elements on the fly, which can disrupt smooth visual transitions.❌ The Failure Mechanism:
The original progress bar toggled between two separate element containers based on the state variable
isAnimating. The initial loader smoothly scaled across the screen width from 0% to 100% over a fixed 2-second window. The exact millisecondisAnimatingflipped to false, that loading element unmounted and the active scroll tracker mounted. If a user had already scrolled halfway down the page during that initial loading phase, the progress bar would instantly snap from 100% back to 50%.💥 The Impact:
This sudden horizontal shift created a jarring visual jump that made the interface feel unpolished and glitchy.
✅ The Solution:
Unified the layout structure into a single, continuous HTML tracking node. Instead of swapping components out of the DOM entirely, the updated code uses dynamic inline style properties to shift the transition behavior profile from a time-based ease curve over to layout scroll-depth tracking ticks the moment the page finish timer resolves.
How Has This Been Tested?
Type of Change