docs+ui: backfill XML doc comments and finish dashboard layout pass

Adds missing <summary>/<param> XML docs across 99 server, worker, and test
files so CommentChecker reports zero issues (TreatWarningsAsErrors needs the
analyzer clean). Bundles in WIP dashboard work: NavSection extraction,
MainLayout/site.css/js styling alignment, and DashboardOptions/Auth tweaks.
This commit is contained in:
Joseph Doherty
2026-05-27 14:20:10 -04:00
parent 382861c602
commit 615b487a77
110 changed files with 1473 additions and 192 deletions
@@ -17,6 +17,7 @@ public sealed class AlarmDispatcherTests
{
private const string SessionId = "session-001";
/// <summary>Verifies that alarm transitions land in the queue with correctly mapped fields.</summary>
[Fact]
public void OnTransition_WhenAlarmTransitionRaised_LandsInQueueWithMappedFields()
{
@@ -63,6 +64,7 @@ public sealed class AlarmDispatcherTests
Assert.Equal(ts, body.TransitionTimestamp.ToDateTime());
}
/// <summary>Verifies that unchanged alarm states do not emit transitions.</summary>
[Fact]
public void OnTransition_WithConsecutiveUnchangedState_DoesNotEmitTransition()
{
@@ -89,6 +91,10 @@ public sealed class AlarmDispatcherTests
Assert.Equal(0, queue.Count);
}
/// <summary>Verifies that state transitions are mapped according to the state table.</summary>
/// <param name="previous">The previous alarm state.</param>
/// <param name="current">The current alarm state.</param>
/// <param name="expected">The expected transition kind.</param>
[Theory]
[InlineData(MxAlarmStateKind.Unspecified, MxAlarmStateKind.UnackAlm, AlarmTransitionKind.Raise)]
[InlineData(MxAlarmStateKind.UnackAlm, MxAlarmStateKind.AckAlm, AlarmTransitionKind.Acknowledge)]
@@ -122,6 +128,7 @@ public sealed class AlarmDispatcherTests
Assert.Equal(expected, evt!.Event.OnAlarmTransition.TransitionKind);
}
/// <summary>Verifies that subscribe calls are forwarded to the consumer.</summary>
[Fact]
public void Subscribe_WhenInvoked_ForwardsToConsumer()
{
@@ -135,6 +142,7 @@ public sealed class AlarmDispatcherTests
Assert.Equal(@"\\HOST\Galaxy!Area1", consumer.LastSubscription);
}
/// <summary>Verifies that acknowledge calls are forwarded to the consumer with operator identity.</summary>
[Fact]
public void Acknowledge_WhenInvoked_ForwardsToConsumerWithFullOperatorIdentity()
{
@@ -158,6 +166,7 @@ public sealed class AlarmDispatcherTests
Assert.Equal("Alice Smith", consumer.LastAckOperatorFullName);
}
/// <summary>Verifies that acknowledge-by-name calls are forwarded to the consumer.</summary>
[Fact]
public void AcknowledgeByName_WhenInvoked_ForwardsToConsumerWithFullTuple()
{
@@ -184,6 +193,7 @@ public sealed class AlarmDispatcherTests
Assert.Equal("TestArea", consumer.LastAckByNameTuple!.Value.Group);
}
/// <summary>Verifies that consumer alarm records are mapped to proto snapshots.</summary>
[Fact]
public void SnapshotActiveAlarms_WhenConsumerHasRecords_MapsRecordsToProtos()
{
@@ -232,6 +242,7 @@ public sealed class AlarmDispatcherTests
Assert.Equal(AlarmConditionState.ActiveAcked, snapshots[1].CurrentState);
}
/// <summary>Verifies that dispose unsubscribes the handler and disposes the consumer.</summary>
[Fact]
public void Dispose_WhenSubscribed_UnsubscribesHandlerAndDisposesConsumer()
{
@@ -260,30 +271,52 @@ public sealed class AlarmDispatcherTests
private sealed class FakeAlarmConsumer : IMxAccessAlarmConsumer
{
/// <summary>Raised when an alarm transition occurs.</summary>
public event EventHandler<MxAlarmTransitionEvent>? AlarmTransitionEmitted;
/// <summary>Gets the last subscription reference.</summary>
public string? LastSubscription { get; private set; }
/// <summary>Gets the GUID from the last acknowledge call.</summary>
public Guid LastAckGuid { get; private set; }
/// <summary>Gets the comment from the last acknowledge call.</summary>
public string? LastAckComment { get; private set; }
/// <summary>Gets the operator name from the last acknowledge call.</summary>
public string? LastAckOperatorName { get; private set; }
/// <summary>Gets the operator node from the last acknowledge call.</summary>
public string? LastAckOperatorNode { get; private set; }
/// <summary>Gets the operator domain from the last acknowledge call.</summary>
public string? LastAckOperatorDomain { get; private set; }
/// <summary>Gets the operator full name from the last acknowledge call.</summary>
public string? LastAckOperatorFullName { get; private set; }
/// <summary>Gets or sets the return code for acknowledge operations.</summary>
public int AcknowledgeReturn { get; set; }
/// <summary>Gets or sets the result collection for snapshot operations.</summary>
public IReadOnlyList<MxAlarmSnapshotRecord> SnapshotResult { get; set; } =
Array.Empty<MxAlarmSnapshotRecord>();
/// <summary>Gets a value indicating whether this instance has been disposed.</summary>
public bool Disposed { get; private set; }
/// <summary>Raises an alarm transition event.</summary>
/// <param name="transition">The alarm transition event.</param>
public void RaiseTransition(MxAlarmTransitionEvent transition)
{
AlarmTransitionEmitted?.Invoke(this, transition);
}
/// <summary>Records the subscription reference.</summary>
/// <param name="subscription">The subscription reference.</param>
public void Subscribe(string subscription)
{
LastSubscription = subscription;
}
/// <summary>Records an acknowledge-by-GUID call with operator identity.</summary>
/// <param name="alarmGuid">The alarm GUID.</param>
/// <param name="ackComment">The acknowledgment comment.</param>
/// <param name="ackOperatorName">The operator name.</param>
/// <param name="ackOperatorNode">The operator node.</param>
/// <param name="ackOperatorDomain">The operator domain.</param>
/// <param name="ackOperatorFullName">The operator full name.</param>
public int AcknowledgeByGuid(
Guid alarmGuid,
string ackComment,
@@ -301,6 +334,15 @@ public sealed class AlarmDispatcherTests
return AcknowledgeReturn;
}
/// <summary>Records an acknowledge-by-name call with alarm name, provider, and group.</summary>
/// <param name="alarmName">The alarm name.</param>
/// <param name="providerName">The provider name.</param>
/// <param name="groupName">The alarm group name.</param>
/// <param name="ackComment">The acknowledgment comment.</param>
/// <param name="ackOperatorName">The operator name.</param>
/// <param name="ackOperatorNode">The operator node.</param>
/// <param name="ackOperatorDomain">The operator domain.</param>
/// <param name="ackOperatorFullName">The operator full name.</param>
public int AcknowledgeByName(
string alarmName, string providerName, string groupName,
string ackComment, string ackOperatorName, string ackOperatorNode,
@@ -311,20 +353,25 @@ public sealed class AlarmDispatcherTests
return AcknowledgeReturn;
}
/// <summary>Gets the last acknowledge-by-name tuple (alarm name, provider, group).</summary>
public (string Name, string Provider, string Group)? LastAckByNameTuple { get; private set; }
/// <summary>Returns the current snapshot result collection.</summary>
public IReadOnlyList<MxAlarmSnapshotRecord> SnapshotActiveAlarms()
{
return SnapshotResult;
}
/// <summary>Gets the count of poll operations.</summary>
public int PollCount { get; private set; }
/// <summary>Increments the poll count.</summary>
public void PollOnce()
{
PollCount++;
}
/// <inheritdoc />
public void Dispose()
{
Disposed = true;