feat(alerts): a Test alert button in the alert properties
Sits to the right of the Built-in video pill, labelled "Test alert". It enqueues one synthetic Super Chat through the real AlertOverlayLayer, so what plays is exactly what a viewer triggers — the custom clip when one is set, the built-in clip otherwise — and it goes through the same output path (preview and encoder) as a live alert. Local only: nothing reaches YouTube and no chat row is invented.
This commit is contained in:
@@ -119,6 +119,30 @@ public partial class MainViewModel : ViewModelBase
|
||||
set => SetProperty(ref _featureRequestEmail, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Properties-panel "Test alert" (creator ruling 2026-11-01): fire one synthetic Super Chat
|
||||
/// through the REAL alert layer, so what plays is exactly what a viewer would trigger — the
|
||||
/// custom clip if one is set, the built-in clip otherwise. Local only; nothing is sent to
|
||||
/// YouTube and no chat row is invented.
|
||||
/// </summary>
|
||||
public RelayCommand TestAlertCommand { get; private set; } = null!;
|
||||
|
||||
private void TestAlert()
|
||||
{
|
||||
_alertLayer.Enqueue(new Models.ChatMessage
|
||||
{
|
||||
AuthorName = "Test viewer",
|
||||
Message = "Test alert — this is what a Super Chat looks like.",
|
||||
Timestamp = System.DateTime.Now,
|
||||
IsSimulated = true,
|
||||
IsSuperChat = true,
|
||||
SuperChatAmount = 5.00,
|
||||
SuperChatCurrency = "$",
|
||||
SuperChatDisplayString = "$5.00",
|
||||
Kind = Models.ChatEventKind.SuperChat,
|
||||
});
|
||||
}
|
||||
|
||||
public ICommand OpenSettingsCommand { get; }
|
||||
public ICommand OpenBugCommand { get; }
|
||||
public ICommand OpenFeatureCommand { get; }
|
||||
|
||||
@@ -235,6 +235,7 @@ public partial class MainViewModel : ViewModelBase
|
||||
OpenMicPickerCommand = new RelayCommand(_ => PickMicrophone());
|
||||
OpenSettingsCommand = new RelayCommand(_ => ToggleSettingsDrawer());
|
||||
InitPreviewHistory();
|
||||
TestAlertCommand = new RelayCommand(_ => TestAlert());
|
||||
OpenBugCommand = new RelayCommand(_ => ShowOverlay(nameof(IsBugOpen), "Report Bug"));
|
||||
OpenFeatureCommand = new RelayCommand(_ => ShowOverlay(nameof(IsFeatureOpen), "Feature Request"));
|
||||
OpenAboutCommand = new RelayCommand(_ => ShowOverlay(nameof(IsAboutOpen), "About"));
|
||||
|
||||
Reference in New Issue
Block a user