refactor(debugview): cosmetic polish — test-seam comment, default-arm comment, tighten severity assertion

This commit is contained in:
Joseph Doherty
2026-06-17 15:30:18 -04:00
parent 50ce26f2e6
commit ef86a2db28
2 changed files with 5 additions and 7 deletions
@@ -306,12 +306,9 @@
private TreeView<DebugTreeNode>? _attrTree; private TreeView<DebugTreeNode>? _attrTree;
private TreeView<DebugTreeNode>? _alarmTree; private TreeView<DebugTreeNode>? _alarmTree;
/// <summary> // Retained as a named enumeration target for DebugViewStreamRaceTests (reflection-based);
/// Current-status enumeration of the live attribute dictionary. Read only on // not consumed in the Blazor markup — the trees render from AttributeForest/AlarmForest.
/// the render thread (CentralUI-021) — see <see cref="HandleStreamEvent"/>. // Still enumerates the live _attributeValues dict on the render thread (CentralUI-021).
/// The trees render from <see cref="AttributeForest"/>; this ordered view is
/// the single render-thread reader of the raw dictionary.
/// </summary>
private IReadOnlyList<AttributeValueChanged> FilteredAttributeValues => private IReadOnlyList<AttributeValueChanged> FilteredAttributeValues =>
string.IsNullOrWhiteSpace(_attrFilter) string.IsNullOrWhiteSpace(_attrFilter)
? _attributeValues.Values.OrderBy(a => a.AttributeName).ToList() ? _attributeValues.Values.OrderBy(a => a.AttributeName).ToList()
@@ -565,6 +562,7 @@
_alarmStates[al.AlarmName] = al; _alarmStates[al.AlarmName] = al;
break; break;
default: default:
// Unknown event type — no re-render needed.
return; return;
} }
StateHasChanged(); StateHasChanged();
@@ -202,7 +202,7 @@ public class DebugViewAlarmTableTests : BunitContext
var leaf = binding.QuerySelector("ul[role='group'] li[role='treeitem']"); var leaf = binding.QuerySelector("ul[role='group'] li[role='treeitem']");
Assert.NotNull(leaf); Assert.NotNull(leaf);
var leafMarkup = leaf!.OuterHtml; var leafMarkup = leaf!.OuterHtml;
Assert.Contains("800", leafMarkup); // severity surfaced Assert.Contains("sev 800", leafMarkup); // severity surfaced
Assert.Contains("Shelved", leafMarkup); // composite condition badge Assert.Contains("Shelved", leafMarkup); // composite condition badge
Assert.Contains("OPC UA", leafMarkup); // native kind badge Assert.Contains("OPC UA", leafMarkup); // native kind badge
Assert.Contains("Unacked", leafMarkup); // active + unacknowledged Assert.Contains("Unacked", leafMarkup); // active + unacknowledged