Expose complete diagnostic text through native disclosures

This commit is contained in:
Joseph Doherty
2026-11-13 22:14:57 -05:00
parent 3ef919a71d
commit 78bad3a6c9
63 changed files with 1792 additions and 21 deletions
@@ -0,0 +1,19 @@
@if (string.IsNullOrEmpty(Text))
{
<span class="text-muted small">No detail recorded.</span>
}
else
{
<details class="diagnostic-details">
<summary>@Summary</summary>
<pre class="mono small" role="region" tabindex="0" aria-label="@Summary">@Text</pre>
</details>
}
@code {
/// <summary>The domain-specific label for this native disclosure and its full diagnostic text.</summary>
[Parameter] public string Summary { get; set; } = "Full details";
/// <summary>Complete diagnostic text rendered as escaped text, never executable markup.</summary>
[Parameter] public string? Text { get; set; }
}
@@ -0,0 +1,3 @@
.diagnostic-details { min-width: 0; max-width: 100%; }
.diagnostic-details summary { overflow-wrap: anywhere; cursor: pointer; color: var(--accent-deep); text-decoration: underline; text-underline-offset: .16em; }
.diagnostic-details pre { margin: .5rem 0 0; padding: .5rem; color: var(--ink); background: var(--zebra-bg); max-width: 100%; max-height: 18rem; overflow: auto; text-align: start; white-space: pre-wrap; overflow-wrap: anywhere; }
@@ -46,7 +46,7 @@
}
else if (_error is not null)
{
<p class="mb-0" style="color:var(--bad)" title="@_error">SignalR error: @DisplayText.Abbreviate(_error, 60)</p>
<DiagnosticDetails Summary="@($"Status read error: {DisplayText.Abbreviate(_error, 60)}")" Text="@_error" />
}
else if (nodes.Count == 0)
{
@@ -87,10 +87,7 @@
@if (snap.LastError is { Length: > 0 } lastError)
{
<details class="mt-2" style="font-size:0.85rem">
<summary style="cursor:pointer; color:var(--ink-soft)">Last error</summary>
<pre class="mt-1 mb-0" style="white-space:pre-wrap; word-break:break-word; color:var(--bad); font-size:0.8rem">@lastError</pre>
</details>
<div class="mt-2"><DiagnosticDetails Summary="@($"Last error · {n.Label}")" Text="@lastError" /></div>
}
</div>
}
@@ -188,7 +185,11 @@
@if (_opResultMessage is not null)
{
<span class="chip @(_opResultOk ? "chip-ok" : "chip-bad")" style="font-size:0.8rem" title="@_opResultMessageFull">@_opResultMessage</span>
<span class="chip @(_opResultOk ? "chip-ok" : "chip-bad")" style="font-size:0.8rem">@_opResultMessage</span>
@if (!string.Equals(_opResultMessage, _opResultMessageFull, StringComparison.Ordinal))
{
<DiagnosticDetails Summary="Operation details" Text="@_opResultMessageFull" />
}
}
</div>
@@ -235,9 +236,7 @@
private bool _busyReconnect;
private bool _busyRestart;
private bool _showRestartConfirm;
// Display text for the op-result chip (truncated at the ShowOpResult choke point) plus the
// untruncated original, which rides the chip's title attribute so the full message stays
// reachable on hover.
// Keep the outcome chip compact; complete metadata is available in a native disclosure.
private string? _opResultMessage;
private string? _opResultMessageFull;
private bool _opResultOk;