-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reconnect UI component to the Blazor template #60376
Add reconnect UI component to the Blazor template #60376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
src/Components/test/E2ETest/ServerExecutionTests/ServerReconnectionCustomUITest.cs
Outdated
Show resolved
Hide resolved
src/Components/test/testassets/Components.TestServer/ServerStartupWithCsp.cs
Outdated
Show resolved
Hide resolved
@javiercn There are two changes in behavior compared to
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
a30db8b
to
25f93fa
Compare
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-src
policy. In this way, users can avoid CSP issues discussed in #58629.The existing
UserSpecifiedDisplay
code was updated in two ways:components-reconnect-modal
, it now also dispatches a custom eventcomponents-reconnect-state-changed
that can be listened for on the modal element.These changes were needed for the
UserSpecifiedDisplay
implementation to be on par withDefaultReconnectDisplay
but 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