fix(overview): expose complete diagnostics on keyboard and touch
This commit is contained in:
@@ -66,8 +66,12 @@
|
||||
{
|
||||
<div class="kv">
|
||||
<span class="k">Error</span>
|
||||
<span class="v bad" title="@error">@Truncate(error, 48)</span>
|
||||
<span class="v bad probe-error-summary" title="@error">@Truncate(error, 48)</span>
|
||||
</div>
|
||||
<details class="probe-error">
|
||||
<summary>Full probe error for @Instance.Instance</summary>
|
||||
<pre tabindex="0" role="region" aria-label="@($"Probe diagnostic for {Instance.Instance}")">@error</pre>
|
||||
</details>
|
||||
}
|
||||
|
||||
@if (Entries.Count > 0)
|
||||
@@ -88,7 +92,7 @@
|
||||
@* The cluster view, rendered verbatim rather than interpreted: when a pair
|
||||
disagrees about the leader this line is the raw evidence an operator needs
|
||||
to see, not a summary of it. *@
|
||||
<div class="check-data">@((MarkupString)clusterData)</div>
|
||||
<div class="check-data" tabindex="0" role="region" aria-label="@($"Cluster evidence for {Instance.Instance}")">@((MarkupString)clusterData)</div>
|
||||
}
|
||||
</details>
|
||||
}
|
||||
@@ -123,9 +127,8 @@
|
||||
Instance.Report?.Entries.OrderBy(e => e.Key, StringComparer.Ordinal).ToList() ?? [];
|
||||
|
||||
/// <summary>
|
||||
/// Stale wins over the stored status in the class, so the card visibly greys out. What it
|
||||
/// shows is still the last real reading — the point is to mark it as no longer current, not
|
||||
/// to replace it with a guess.
|
||||
/// Stale adds a neutral stripe and explicit label while retaining readable last-known
|
||||
/// values and the stored status class. Observation age does not fabricate a new status.
|
||||
/// </summary>
|
||||
private string StateClass => Instance.Status switch
|
||||
{
|
||||
|
||||
@@ -85,10 +85,14 @@ details.checks summary::before { content: '\25B6'; font-size: 0.55rem; margin-ri
|
||||
details.checks[open] summary::before { content: '\25BC'; }
|
||||
details.checks summary:hover { color: var(--ink); }
|
||||
|
||||
.check-row { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.28rem 0.9rem; font-size: 0.8rem; }
|
||||
.check-row {
|
||||
display: grid; grid-template-columns: 8px minmax(0, 9.5rem) auto minmax(0, 1fr);
|
||||
align-items: baseline; gap: 0.5rem; padding: 0.28rem 0.9rem; font-size: 0.8rem;
|
||||
}
|
||||
.check-row:nth-child(even) { background: var(--zebra-bg); }
|
||||
.check-name { font-family: var(--mono); font-size: 0.78rem; min-width: 9.5rem; }
|
||||
.check-desc { color: var(--ink-soft); font-size: 0.78rem; }
|
||||
.check-name { font-family: var(--mono); font-size: 0.78rem; min-width: 0; overflow-wrap: anywhere; }
|
||||
.check-state { font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
|
||||
.check-desc { color: var(--ink-soft); font-size: 0.78rem; min-width: 0; overflow-wrap: anywhere; }
|
||||
.check-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; align-self: center; }
|
||||
.check-dot.ok { background: var(--ok); }
|
||||
.check-dot.warn { background: var(--warn); }
|
||||
@@ -109,3 +113,20 @@ details.checks summary:hover { color: var(--ink); }
|
||||
padding: 0 0.6rem 0.6rem; font-family: var(--mono); font-size: 0.72rem;
|
||||
color: var(--ink-faint); line-height: 1.5;
|
||||
}
|
||||
|
||||
/* Readable complete diagnostics remain available to keyboard and touch users. */
|
||||
.inst-head > div:first-child { min-width: 0; }
|
||||
.inst-name, .inst-host, .probe-error-summary { overflow-wrap: anywhere; }
|
||||
.kv .v { min-width: 0; overflow-wrap: anywhere; }
|
||||
.probe-error { margin: .35rem .9rem .6rem; }
|
||||
.probe-error summary { color: var(--bad-ink); font-size: .78rem; cursor: pointer; overflow-wrap: anywhere; }
|
||||
.probe-error pre {
|
||||
margin: .4rem 0 0; padding: .6rem; max-height: 16rem; overflow: auto;
|
||||
white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono);
|
||||
font-size: .74rem; color: var(--ink); background: var(--zebra-bg);
|
||||
border: 1px solid var(--rule); border-radius: 4px;
|
||||
}
|
||||
@media (max-width: 620px) {
|
||||
.check-row { grid-template-columns: 8px minmax(0, 1fr) auto; }
|
||||
.check-desc { grid-column: 2 / -1; }
|
||||
}
|
||||
|
||||
@@ -49,6 +49,37 @@ public class InstanceCardTests : BunitContext
|
||||
.Add(c => c.Now, Now)
|
||||
.Add(c => c.IsLeader, isLeader));
|
||||
|
||||
[Fact]
|
||||
public void FullError_IsAvailableWithoutHoverAndRemainsEscaped()
|
||||
{
|
||||
var error = "Probe failed: <script>invalid</script> " + new string('x', 2000) + " diagnostic end";
|
||||
var cut = Render(Card(InstanceStatus.Unreachable, error: error));
|
||||
var disclosure = cut.Find("details.probe-error");
|
||||
Assert.Contains("site-a-a", disclosure.QuerySelector("summary")!.TextContent, StringComparison.Ordinal);
|
||||
Assert.False(disclosure.HasAttribute("open"));
|
||||
Assert.Equal(error, disclosure.QuerySelector("pre")!.TextContent);
|
||||
Assert.Empty(disclosure.QuerySelectorAll("script"));
|
||||
Assert.Contains("…", cut.Find(".probe-error-summary").TextContent, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
public void MissingError_HasNoDiagnosticDisclosure(string? error)
|
||||
{
|
||||
Assert.Empty(Render(Card(error: error)).FindAll("details.probe-error"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ClusterEvidence_IsANamedKeyboardScrollableRegion()
|
||||
{
|
||||
var card = Render(Card(report: Report(("akka-cluster", "Healthy", "akka.tcp://scadabridge@site-a-a:8082"))));
|
||||
var evidence = card.Find(".check-data");
|
||||
Assert.Equal("0", evidence.GetAttribute("tabindex"));
|
||||
Assert.Equal("region", evidence.GetAttribute("role"));
|
||||
Assert.Contains("site-a-a", evidence.GetAttribute("aria-label"), StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Healthy", "Healthy", "ok")]
|
||||
[InlineData("Degraded", "Degraded", "warn")]
|
||||
|
||||
Reference in New Issue
Block a user