Skip to content

[dev-v5] fix: prevent global overlay spinner flash when opening dialogs - #5283

Merged
Vincent Baaij (vnbaaij) merged 1 commit into
microsoft:dev-v5from
JamesNK:fix/5282-global-overlay-spinner-flash
Sep 16, 2026
Merged

Vincent Baaij (vnbaaij) merged 1 commit into
microsoft:dev-v5from
JamesNK:fix/5282-global-overlay-spinner-flash

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Pull Request

📖 Description

Preserves component identity for items rendered by FluentDialogProvider by keying each item with its stable dialog ID.

Previously, the global overlay has the highest sort index and moved from the first rendered position to the last when a normal dialog was added. Without keys, Blazor removed and recreated the global FluentOverlay. Its light-DOM spinner could paint briefly before deferred web-component initialization moved it behind the closed shadow-DOM dialog.

🎫 Issues

Closes #5282

👩‍💻 Reviewer Notes

A smoke test is recommended: open a service-driven dialog while the global overlay is enabled and confirm that no spinner flashes before the dialog appears.

The regression test verifies that the same FluentOverlay component instance remains after a normal dialog is added.

📑 Test Plan

  • dotnet test tests/Core/Components.Tests.csproj --configuration Debug --no-restore --nologo --verbosity minimal — 4,417 passed
  • dotnet build Microsoft.FluentUI-v5.slnx --configuration Debug --no-restore --nologo --verbosity minimal — succeeded
  • Playwright against the local /Dialog demo:
    • The normal dialog was added.
    • The global overlay had no removal or insertion mutations.
    • The original global overlay node remained connected.
    • 45 timer samples observed zero identity changes and zero visible spinner samples.

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

  • I have added a new component
  • I have added Unit Tests for my new component
  • I have modified an existing component
  • I have validated the Unit Tests for an existing component

⏭ Next Steps

None.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved issues were identified.

Pull request overview

Prevents the global overlay spinner flash by preserving dialog component identity during provider reordering.

Changes:

  • Adds stable @key values to provider-rendered components.
  • Adds a regression test verifying overlay instance preservation.
File summaries
File Description
tests/Core/Components/Dialog/Overlay/OverlayServiceTests.razor Verifies the global overlay instance survives dialog creation.
src/Core/Components/Dialog/FluentDialogProvider.razor Keys rendered dialog, overlay, and input-file components by ID.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@vnbaaij
Vincent Baaij (vnbaaij) merged commit 963bd73 into microsoft:dev-v5 Sep 16, 2026
3 checks passed
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.

3 participants