fix(spinner):Fixed spinner animation interruption bug. #56
Merged
LittleLittleCloud merged 9 commits intoRazorConsole:mainfrom Oct 24, 2025
Merged
fix(spinner):Fixed spinner animation interruption bug. #56LittleLittleCloud merged 9 commits intoRazorConsole:mainfrom
LittleLittleCloud merged 9 commits intoRazorConsole:mainfrom
Conversation
Corrected spelling of 'styleAttribution' to 'styleAttribute' and 'justifyAttribution' to 'justifyAttribute' for consistency with standard naming conventions. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Set lowercase letters for field names Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a visual bug where spinner animations restart from frame 0 whenever the UI is re-rendered (e.g., during button clicks or menu toggles). The solution replaces per-instance Stopwatch timing with a global clock based on DateTime.UtcNow, ensuring that newly created spinner instances continue the animation from the current frame rather than resetting.
Key Changes:
- Removed the per-instance
Stopwatchfield fromAnimatedSpinnerRenderable - Switched to
DateTime.UtcNow.Ticksas the timing source for calculating the current spinner frame - Added safeguard logic to prevent division by zero when
_interval.Ticksis invalid
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the UI is interacted with (e.g. button click or navigation menu toggle), spinner instances get recreated and their animation restarts from the beginning. This produces a visible jump in the spinner every time the DOM is re-rendered.
Root cause
Each AnimatedSpinnerRenderable started its own Stopwatch in the constructor, so a newly created instance always displayed frame 0. Re-creating the renderable on every interaction therefore resets the spinner.
Solution
Compute the current frame from a global clock instead of using a per-instance Stopwatch. The spinner frame index is now derived from DateTime.UtcNow (scaled by spinner interval), so new instances continue the animation position instead of starting over.