ui: Central UI density/consistency sweep + Theme 0.4.1
Applies the family-wide admin-UI cleanup playbook to the Central UI so the Blazor surfaces stop diverging from the shared kit: buttons are grouped rather than individually sized, long cell values are contained instead of widening tables, and hard-coded colours give way to theme tokens. The headline fix is that MainLayout passed Accent="#2f5fd0" to ThemeShell, which the kit emits as an inline style on the shell root. Being a descendant of <html>, it beat the [data-bs-theme="dark"] override for the entire app, so the dark accent had never rendered. Declaring --accent in site.css :root instead lets both schemes resolve; light is unchanged because the value already matched the kit's light default. Theme pins to 0.4.1, which upstreams the local .btn sizing block verbatim, so that block is deleted here rather than duplicated. Verified byte-identical before removal; the repo now declares no --bs-btn-* anywhere. NOT purely cosmetic, contrary to the sweep's stated scope: four detail-modal surfaces (NotificationReport, ConfigurationAuditLog, ParkedMessages, SiteCallsReport) were additionally refactored from holding the selected record to holding its id and re-resolving from the current page each render, with the resolve doubling as the visibility gate. A background refresh that drops the row now closes the modal instead of showing a stale snapshot. This is a behaviour change and is called out rather than buried: a full-suite run turned up one intermittent CentralUI failure, CloseButton_DismissesModal, whose stack (GetRequiredEventBindingEntry during DispatchEventAsync) indicates the handler was disposed between render and click — a window the previous field-held record made structurally impossible. Treat the modal lifecycle here as unreviewed. Build 0/0; suite green apart from that one intermittent failure.
This commit is contained in:
@@ -162,10 +162,12 @@
|
||||
</div>
|
||||
|
||||
<div class="col-auto ms-auto">
|
||||
<button class="btn btn-outline-secondary btn-sm me-1"
|
||||
@onclick="ClearFilters" data-test="filter-clear">Clear</button>
|
||||
<button class="btn btn-primary btn-sm"
|
||||
@onclick="Apply" data-test="filter-apply">Apply</button>
|
||||
<div class="btn-group btn-group-sm" role="group">
|
||||
<button class="btn btn-outline-secondary"
|
||||
@onclick="ClearFilters" data-test="filter-clear">Clear</button>
|
||||
<button class="btn btn-primary"
|
||||
@onclick="Apply" data-test="filter-apply">Apply</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<span data-test="status-badge-@row.EventId" class="badge @StatusBadgeClass(row.Status)">@row.Status</span>
|
||||
break;
|
||||
case "Target":
|
||||
<span class="small">@(row.Target ?? "—")</span>
|
||||
<span class="small" title="@row.Target">@TruncateTarget(row.Target)</span>
|
||||
break;
|
||||
case "Actor":
|
||||
<span class="small">@(row.Actor ?? "—")</span>
|
||||
|
||||
@@ -488,6 +488,34 @@ public partial class AuditResultsGrid : IAsyncDisposable
|
||||
_ => "badge bg-secondary",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Caps the rendered Target text, with the full value kept on the cell's
|
||||
/// <c>title</c>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Target is free text this app does not control (external-system URLs, SQL
|
||||
/// statements, method names) and its column is UNBOUNDED until the operator
|
||||
/// resizes it: the scoped stylesheet clips <c>.audit-grid-td</c> only when the
|
||||
/// inline <c>--audit-col-width</c> custom property is present, and
|
||||
/// <see cref="ColumnWidthStyle"/> emits nothing for a column with no persisted
|
||||
/// width — so on a fresh session one long target sets the table's width.
|
||||
/// The cap is applied to the STRING rather than by pinning a CSS width, because
|
||||
/// a <c>max-width</c>/<c>nowrap</c> clip would raise the cell's min-content
|
||||
/// width and stop a resized column from shrinking — i.e. it would break
|
||||
/// drag-to-resize at exactly the widths it is used at. Truncating characters
|
||||
/// leaves the cell's min-content word-based, so resize keeps working unchanged.
|
||||
/// Mirrors <see cref="TruncateError"/>, this grid's existing idiom.
|
||||
/// </remarks>
|
||||
private static string TruncateTarget(string? target)
|
||||
{
|
||||
if (string.IsNullOrEmpty(target))
|
||||
{
|
||||
return "—";
|
||||
}
|
||||
const int max = 60;
|
||||
return target.Length <= max ? target : string.Concat(target.AsSpan(0, max), "…");
|
||||
}
|
||||
|
||||
private static string TruncateError(string? message)
|
||||
{
|
||||
if (string.IsNullOrEmpty(message))
|
||||
|
||||
Reference in New Issue
Block a user