Add reconnect UI component to the Blazor template #60376
Merged
ilonatommy merged 13 commits intodotnet:mainfrom Feb 18, 2025
Merged
Add reconnect UI component to the Blazor template #60376ilonatommy merged 13 commits intodotnet:mainfrom
ilonatommy merged 13 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 5 out of 9 changed files in this pull request and generated 1 comment.
Files not reviewed (4)
- src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/template.json: Language not supported
- src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/ReconnectModal.razor.css: Language not supported
- src/Components/test/testassets/BasicTestApp/Reconnection/ReconnectionComponent.razor: Evaluated as low risk
- src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/MainLayout.razor: Evaluated as low risk
Comments suppressed due to low confidence (1)
src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts:56
- Ensure that the new behavior for retrying attempts is covered by tests.
if (currentAttempt > 1 && secondsToNextAttempt > 0) {
...ctTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/ReconnectModal.razor
Show resolved
Hide resolved
javiercn
reviewed
Feb 14, 2025
src/Components/test/E2ETest/ServerExecutionTests/ServerReconnectionCustomUITest.cs
Outdated
Show resolved
Hide resolved
javiercn
reviewed
Feb 14, 2025
src/Components/test/testassets/Components.TestServer/ServerStartupWithCsp.cs
Outdated
Show resolved
Hide resolved
Member
Author
|
@javiercn There are two changes in behavior compared to
|
3 tasks
a30db8b to
25f93fa
Compare
3 tasks
This was referenced Feb 26, 2025
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.
Reconnect UI component for the Blazor template
Adds CSP-compliant UI to the Blazor Web App project template.
Description
Adds a Razor component for reconnection UI to the Blazor Web App project template. This component showcases to users how to override and customize the UI that gets displayed when the client loses the WebSocket connection to the Blazor server.
The appearance and behavior matches the existing default UI that is created by JS code in
DefaultReconnectDisplay. However, since it does not need to add inline styles programatically, it does not violate stricter Content-Security-Policy settings for thestyle-srcpolicy. In this way, users can avoid CSP issues discussed in #58629.The existing
UserSpecifiedDisplaycode was updated in two ways:components-reconnect-modal, it now also dispatches a custom eventcomponents-reconnect-state-changedthat can be listened for on the modal element.These changes were needed for the
UserSpecifiedDisplayimplementation to be on par withDefaultReconnectDisplaybut they also makes customization of the reconnection UI more flexible in general.The PR also adds new E2E tests that check that the UI is displayed and that no style-related CSP errors are logged in the browser.
Fixes #57453
Fixes #58629