refactor(ui): alert rows are two lines of text — the heading line was redundant
Creator: system messages are limited to two lines; the label above the message ('STEAM ID NOT
PRESENT', 'STREAM') was repeating what the row already said and pushing the stack past its budget.
AttentionAlert loses Label; rows render Text only. The licence row is now exactly:
Steam ID Limit: 30fps
Click for More Info
(60fps with a close control once owned). Rows are identified by Id internally, so nothing in the UI
depends on the removed text. Tests updated to assert position/text rather than the heading.
This commit is contained in:
@@ -99,7 +99,7 @@ public sealed class AboutHubTests
|
||||
// The old red panel under the quality picker is gone (2026-11-05): the licence state
|
||||
// lives in the left panel's alert stack now, as a pinned status indicator.
|
||||
Assert.Null(window.FindName("EntitlementErrorPanel"));
|
||||
var licenceRow = vm.AttentionAlerts.Single(alert => alert.Label == "STEAM ID NOT PRESENT");
|
||||
var licenceRow = vm.AttentionAlerts.Single(alert => alert.Id == "steam-licence");
|
||||
Assert.True(licenceRow.IsPinned);
|
||||
Assert.Contains("Steam ID Limit: 30fps", licenceRow.Text);
|
||||
Assert.Contains("Click for More Info", licenceRow.Text);
|
||||
|
||||
@@ -32,11 +32,13 @@ public sealed class AttentionAlertStackTests
|
||||
vm.EntitlementOverride = new FakeEntitlement(false, "Steam licensing is not configured in this build.");
|
||||
|
||||
var row = Assert.Single(vm.AttentionAlerts);
|
||||
Assert.Equal("STEAM ID NOT PRESENT", row.Label);
|
||||
Assert.Equal("steam-licence", row.Id);
|
||||
Assert.True(row.IsPinned);
|
||||
Assert.True(row.ShowsPin);
|
||||
Assert.False(row.CanDismiss);
|
||||
Assert.Equal(AttentionAlertAction.About, row.Action);
|
||||
// Two lines at most: the heading above the message was redundant.
|
||||
Assert.DoesNotContain("\n\n", row.Text);
|
||||
|
||||
// Creator wording: the limit this build runs at, and where to find out why.
|
||||
Assert.Contains("Steam ID Limit: 30fps", row.Text);
|
||||
@@ -63,11 +65,11 @@ public sealed class AttentionAlertStackTests
|
||||
|
||||
// Permanent: a fresh view-model on the same profile must not bring it back…
|
||||
var reloaded = new MainViewModel();
|
||||
Assert.DoesNotContain(reloaded.AttentionAlerts, alert => alert.Label.StartsWith("STEAM ID"));
|
||||
Assert.DoesNotContain(reloaded.AttentionAlerts, alert => alert.Id == "steam-licence");
|
||||
|
||||
// …but losing ownership restores it as a pinned indicator: a change of state, not a preference.
|
||||
reloaded.EntitlementOverride = new FakeEntitlement(false, "Steam licensing is not configured in this build.");
|
||||
var restored = reloaded.AttentionAlerts.First(alert => alert.Label == "STEAM ID NOT PRESENT");
|
||||
var restored = reloaded.AttentionAlerts.First(alert => alert.Id == "steam-licence");
|
||||
Assert.True(restored.IsPinned);
|
||||
});
|
||||
}
|
||||
@@ -90,22 +92,22 @@ public sealed class AttentionAlertStackTests
|
||||
WithVm(vm =>
|
||||
{
|
||||
vm.EntitlementOverride = new FakeEntitlement(false, "Steam licensing is not configured in this build.");
|
||||
vm.PushAttentionAlertForTest("drop-1", "STREAM", "Stream dropped — reconnecting (attempt 1 of 4)", 10, 12);
|
||||
vm.PushAttentionAlertForTest("drop-2", "STREAM", "Stream dropped — reconnecting (attempt 2 of 4)", 13, 15);
|
||||
vm.PushAttentionAlertForTest("drop-1", "Stream dropped — reconnecting (attempt 1 of 4)", 10, 12);
|
||||
vm.PushAttentionAlertForTest("drop-2", "Stream dropped — reconnecting (attempt 2 of 4)", 13, 15);
|
||||
|
||||
Assert.Equal(new[] { "STEAM ID NOT PRESENT", "STREAM", "STREAM" }, vm.AttentionAlerts.Select(a => a.Label));
|
||||
Assert.Equal(new[] { "steam-licence", "drop-2", "drop-1" }, vm.AttentionAlerts.Select(a => a.Id));
|
||||
// Newest event sits directly under the indicator.
|
||||
Assert.Contains("attempt 2", vm.AttentionAlerts[1].Text);
|
||||
Assert.Contains("attempt 1", vm.AttentionAlerts[2].Text);
|
||||
|
||||
// The same event advancing updates its row instead of adding another.
|
||||
vm.PushAttentionAlertForTest("drop-2", "STREAM", "Stream recovered after 1.4 s", 13, 16);
|
||||
vm.PushAttentionAlertForTest("drop-2", "Stream recovered after 1.4 s", 13, 16);
|
||||
Assert.Equal(3, vm.AttentionAlerts.Count);
|
||||
Assert.Contains("recovered", vm.AttentionAlerts[1].Text);
|
||||
|
||||
vm.DismissAlertCommand.Execute(vm.AttentionAlerts[1]);
|
||||
Assert.Equal(2, vm.AttentionAlerts.Count);
|
||||
Assert.Equal("STEAM ID NOT PRESENT", vm.AttentionAlerts[0].Label);
|
||||
Assert.Equal("steam-licence", vm.AttentionAlerts[0].Id);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -114,7 +116,7 @@ public sealed class AttentionAlertStackTests
|
||||
{
|
||||
WithVm(vm =>
|
||||
{
|
||||
vm.PushAttentionAlertForTest("drop-1", "STREAM", "Stream dropped", 41, 47);
|
||||
vm.PushAttentionAlertForTest("drop-1", "Stream dropped", 41, 47);
|
||||
|
||||
vm.ActivateAlertCommand.Execute(vm.AttentionAlerts[1]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user