bugfix: standardize loading states and add save spinner to Create pages#819
bugfix: standardize loading states and add save spinner to Create pages#819eduardosmaniotto wants to merge 2 commits into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the reliability and consistency of the admin panel's UI by standardizing how loading states are handled. It addresses issues where inline spinners were used inconsistently, replaces non-functional progress messages with a robust 'is processing' state for form submissions, and resolves a specific entity framework tracking conflict that occurred when discarding changes in the Merchants view. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors loading and processing states across several Blazor pages by introducing a centralized LoadingOverlayService and an IsProcessing parameter on AutoForm, replacing local state spinners. It also localizes the save button text and improves state preservation when discarding changes in the Merchants page. The review feedback highlights critical issues with using ConfigureAwait(false) in Blazor components and event handlers, which can discard the synchronization context and lead to threading or UI update issues. Additionally, it is recommended to avoid setting _viewModels to null before reloading in Merchants.razor.cs to prevent a permanently blank page if the reload fails.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Problem 1 — Inconsistent loading states
Merchants,EditConfigGrid,CreateGameServerConfig, andCreateConnectServerConfigused inlinespinner-borderelements while data loaded, while other pages used theLoadingOverlayServicemodal overlay. The inline spinners also didn't cover the full page.Fix: Replaced inline spinners with
LoadingOverlayService.ShowLoadingIndicator()modal overlay in all four pages.Problem 2 —
_initStateprogress messages never visibleThe Create pages had a
string? _initStatethat displayed step messages ("Creating configuration...", "Saving...") viaInvokeAsync(StateHasChanged). Due to Blazor Server's render batching, intermediate states never reached the client — only the finalnullrendered, so the div never appeared. The progress messages and theirInvokeAsyncwrappers were dead code.Fix: Replaced
_initStatewithbool _isProcessing. Set totrueat the top ofOnSaveButtonClickAsync, reset in afinallyblock (so it always clears). Flows intoAutoForm'sIsProcessingparameter, which disables the Save button and shows aspinner-border-sm. Gives immediate visual feedback without relying on intermediate string updates.Problem 3 — EF tracking conflict on Merchants discard
OnCancelButtonClickAsynccalledDiscardChangesAsyncthenLoadDataAsync, but the old_selectedMerchantwas still tracked by EF, causing a tracking conflict.Fix: Fix: Capture the merchant's Id before discard. After reload, re-select the merchant by matching the ID against the fresh _viewModels.