fix(app): the job bar and the connection state are live regions; error toasts interrupt
- The job bar is a status bar for screen readers; it announces which job starts and when the queue empties (ShellViewModel.JobAnnouncement), never its progress ticks. - The status strip's connection text announces a change of server state. - Toast.IsError: error notices are announced at once; other notices queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
5 files changed
+56
-9
No files matched your search
@@ -16,6 +16,7 @@ public sealed class ShellViewModel : LocalizedViewModel
|
||||
private SectionViewModel _current;
|
||||
private bool _isRailCollapsed;
|
||||
private string? _jobText;
|
||||
private string? _jobName;
|
||||
private double _jobProgress;
|
||||
private bool _jobActive;
|
||||
private bool _jobIndeterminate;
|
||||
@@ -184,14 +185,25 @@ public sealed class ShellViewModel : LocalizedViewModel
|
||||
/// <summary>Pauses the job the bar shows.</summary>
|
||||
public ICommand? StopJobCommand => Jobs.PauseCurrentCommand;
|
||||
|
||||
/// <summary>Updates the global job bar (and the taskbar progress through the window).</summary>
|
||||
public void SetJob(string? text, double progress, bool indeterminate = false)
|
||||
/// <summary>
|
||||
/// What screen readers hear from the job bar: the job when one starts, the idle line when the last one ends; not its
|
||||
/// progress, speed or time left, which change every second.
|
||||
/// </summary>
|
||||
public string JobAnnouncement => _jobActive && _jobName is not null ? _jobName : JobText;
|
||||
|
||||
/// <summary>
|
||||
/// Updates the global job bar (and the taskbar progress through the window). <paramref name="name"/> says which job
|
||||
/// it is without its progress ("Render: Harbour sunset"); null reads <paramref name="text"/>.
|
||||
/// </summary>
|
||||
public void SetJob(string? text, double progress, bool indeterminate = false, string? name = null)
|
||||
{
|
||||
_jobText = text;
|
||||
_jobName = text is null ? null : name ?? text;
|
||||
IsJobActive = text is not null;
|
||||
JobProgress = progress;
|
||||
IsJobIndeterminate = indeterminate;
|
||||
OnPropertyChanged(nameof(JobText));
|
||||
OnPropertyChanged(nameof(JobAnnouncement));
|
||||
}
|
||||
|
||||
// ---- Status strip ----
|
||||
@@ -227,6 +239,7 @@ public sealed class ShellViewModel : LocalizedViewModel
|
||||
_queuedCount = queued;
|
||||
OnPropertyChanged(nameof(JobsText));
|
||||
OnPropertyChanged(nameof(JobText));
|
||||
OnPropertyChanged(nameof(JobAnnouncement));
|
||||
}
|
||||
|
||||
public void Navigate(SectionKey key)
|
||||
@@ -262,6 +275,7 @@ public sealed class ShellViewModel : LocalizedViewModel
|
||||
ShowToast(new Toast
|
||||
{
|
||||
Title = ErrorText.For(ex),
|
||||
IsError = true,
|
||||
ActionText = Loc.L("Common.OpenLogs"),
|
||||
ActionToolTip = Loc.L("Tooltips.Common.OpenLogs"),
|
||||
ActionCommand = new RelayCommand(() => ShellActions.Reveal(Services.Environment.LogDirectory)),
|
||||
|
||||
Reference in new issue
Block a user