Skip to content

Fixes #4879. SpinnerView AutoSpin does not advance animation#4882

Merged
tig merged 3 commits intogui-cs:v2_developfrom
YourRobotOverlord:fix/4879-spinnerview-autospin
Apr 5, 2026
Merged

Fixes #4879. SpinnerView AutoSpin does not advance animation#4882
tig merged 3 commits intogui-cs:v2_developfrom
YourRobotOverlord:fix/4879-spinnerview-autospin

Conversation

@YourRobotOverlord
Copy link
Copy Markdown
Collaborator

@YourRobotOverlord YourRobotOverlord commented Apr 4, 2026

Summary

Fixes #4879.

AutoSpin = true is typically set before the view is added to an application (e.g. in an object initializer or scenario setup). App.AddTimeout cannot be called until the view is fully initialized with a running App, which only happens during EndInit() inside App.Run().

Root Cause

When AutoSpin = true is set on a SpinnerView before App.Run() is called, App is
null. AddAutoSpinTimeout() silently exits without registering a timer. Nothing ever retried - the spinner showed its first frame and stopped.

Fix

  • Add _autoSpin backing field to track the desired state independently of the active timer (_timeout)
  • Change AutoSpin getter to return _autoSpin (correctly reflects intent even before the timeout is registered)
  • Override EndInit() to call AddAutoSpinTimeout() - this runs during App.Run() after App is set on the view hierarchy, guaranteeing the timeout is registered at the right time

@YourRobotOverlord YourRobotOverlord requested a review from tig as a code owner April 4, 2026 00:39
@YourRobotOverlord YourRobotOverlord marked this pull request as draft April 4, 2026 00:41
AutoSpin = true is typically set before the view is added to an
application. App.AddTimeout cannot be called until the view is fully
initialized with a running App, which happens during EndInit() inside
app.Run().

Add _autoSpin backing field to track the desired state independently
of the active timer, and override EndInit() to register the repeating
timeout once App is available.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@YourRobotOverlord YourRobotOverlord force-pushed the fix/4879-spinnerview-autospin branch from e588c24 to 42ca9f4 Compare April 4, 2026 00:42
@YourRobotOverlord YourRobotOverlord marked this pull request as ready for review April 4, 2026 00:44
Copy link
Copy Markdown
Member

@tig tig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this. Please add a test that will ensure this bug can't occur again.

@YourRobotOverlord YourRobotOverlord requested a review from tig April 4, 2026 17:43
@tig tig merged commit 0a87f87 into gui-cs:v2_develop Apr 5, 2026
11 checks passed
@YourRobotOverlord YourRobotOverlord deleted the fix/4879-spinnerview-autospin branch April 5, 2026 02:00
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.

SpinnerView AutoSpin does not advance animation

2 participants