Move progress bar animation init to Loaded event to fix possible null exception of ProgressBar#4313
Move progress bar animation init to Loaded event to fix possible null exception of ProgressBar#4313Jack251970 wants to merge 1 commit intodevfrom
Conversation
InitProgressbarAnimation is now triggered by the progress bar's Loaded event instead of during main window initialization. This ensures the animation starts only after the progress bar is fully loaded, improving reliability and preventing potential UI timing issues.
There was a problem hiding this comment.
Pull request overview
Moves progress bar animation initialization to the ProgressBar Loaded event to avoid timing-related null access during main window initialization.
Changes:
- Removed
InitProgressbarAnimation()call fromMainWindow.OnLoaded. - Added a
ProgressBar_Loadedhandler in code-behind to triggerInitProgressbarAnimation(). - Wired the ProgressBar
Loadedevent in XAML.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Flow.Launcher/MainWindow.xaml.cs | Removes initialization from window load and introduces ProgressBar_Loaded to init animation when the control is loaded. |
| Flow.Launcher/MainWindow.xaml | Hooks the ProgressBar Loaded event to call the new handler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughMoves progress bar animation initialization from the main window's Loaded event to the progress bar's own Loaded event handler, ensuring the control is fully initialized before animation setup begins. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
|
🥷 Code experts: jjw24 jjw24, Jack251970 have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
|
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
|
Do we know if this actually solves the issue? |
It is very hard to reproduce this issue since this issue happens only if the ProgressBar is not loaded when window is loaded (You need a computer with high computation speed and good gpu performance). We can only analyze the root reason of the issue. |
InitProgressbarAnimation is now triggered by the progress bar's Loaded event instead of during main window initialization. This ensures the animation starts only after the progress bar is fully loaded, improving reliability and preventing potential UI timing issues.
Resolve #4311
Summary by cubic
Moves the progress bar animation init from window load to the ProgressBar Loaded event. This prevents null reference exceptions and ensures the animation starts only after the control is ready.
Written for commit a2f2242. Summary will update on new commits.