fix(adminui,client): error boundary inside the interactive scope, stale-commit OnSaved, AbCip browse delay emit, DisposeBridge cancel (review R3)
M1: PageErrorBoundary wraps the body of every InteractiveServer page; the inert layout boundary is removed. m1: DisposeBridge cancels its CTS when the 5 s wait times out. m2: a CSV import that commits after the modal closed still raises OnSaved. m3: document SecurityMode=None no-fallback in Client.CLI.md / Client.UI.md. m4: browsePageDelayMs written only when loaded or changed; negative flagged. Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
@inherits LayoutComponentBase
|
||||
@implements IDisposable
|
||||
@using System.Security.Claims
|
||||
|
||||
@* Thin delegation to the shared ZB.MOM.WW.Theme side-rail chassis. ThemeShell owns
|
||||
@@ -71,33 +70,9 @@
|
||||
</AuthorizeView>
|
||||
</RailFooter>
|
||||
<ChildContent>
|
||||
@* A throwing page would otherwise kill the whole circuit (blank "reload" bar). The boundary
|
||||
confines it to the page body and offers Recover; navigating away also recovers it. It does NOT
|
||||
catch exceptions from async-void handlers or timer callbacks. *@
|
||||
<ErrorBoundary @ref="_boundary">
|
||||
<ChildContent>@Body</ChildContent>
|
||||
<ErrorContent Context="ex">
|
||||
<div class="alert alert-danger m-3" role="alert">
|
||||
<strong>This page hit an unexpected error.</strong>
|
||||
<div class="small mono mt-1">@ex.GetType().Name: @ex.Message</div>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger mt-2" @onclick="() => _boundary?.Recover()">Try again</button>
|
||||
</div>
|
||||
</ErrorContent>
|
||||
</ErrorBoundary>
|
||||
@* No ErrorBoundary here: this layout renders statically (Routes is SSR), so it is not an ancestor
|
||||
of any @rendermode InteractiveServer page and a boundary here would never see their failures.
|
||||
Interactive pages wrap their body in <PageErrorBoundary> instead. *@
|
||||
@Body
|
||||
</ChildContent>
|
||||
</ThemeShell>
|
||||
|
||||
@code {
|
||||
private ErrorBoundary? _boundary;
|
||||
|
||||
[Inject] private NavigationManager Nav { get; set; } = default!;
|
||||
|
||||
protected override void OnInitialized() => Nav.LocationChanged += OnLocationChanged;
|
||||
|
||||
// A fresh navigation clears a tripped boundary so the next page isn't stuck behind the old error.
|
||||
private void OnLocationChanged(object? sender, Microsoft.AspNetCore.Components.Routing.LocationChangedEventArgs e)
|
||||
=> _boundary?.Recover();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Dispose() => Nav.LocationChanged -= OnLocationChanged;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user