fix(app): failure toasts are announced at once
Shell.Notify takes isError; every toast that reports a failure or a refusal sets it (archive actions and fixes, sync, settings import and cache, proxy fetch, welcome folder check, card check, erase, format and eject). The Uploader marks its unexpected-error, sign-out and choose-a-sequence toasts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
9 files changed
+27
-20
No files matched your search
@@ -346,7 +346,7 @@ public sealed class MainViewModel : LocalizedViewModel
|
||||
if (paths.Count == 0) return;
|
||||
if (_target == UploadTargetMode.Sequence && SelectedSequence is null)
|
||||
{
|
||||
ShowToast(Loc.L("Uploader.Toast.ChooseSequence"));
|
||||
ShowToast(Loc.L("Uploader.Toast.ChooseSequence"), isError: true);
|
||||
return;
|
||||
}
|
||||
var found = await Task.Run(() => PhotoScanner.Scan(paths));
|
||||
@@ -394,7 +394,7 @@ public sealed class MainViewModel : LocalizedViewModel
|
||||
public void ReportError(Exception ex)
|
||||
{
|
||||
Log.Error("ui", "Operation failed", ex);
|
||||
ShowToast(Loc.L("Errors.Unexpected"), Loc.L("Common.OpenLogs"), Loc.L("Tooltips.Common.OpenLogs"), new RelayCommand(OpenLogs));
|
||||
ShowToast(Loc.L("Errors.Unexpected"), Loc.L("Common.OpenLogs"), Loc.L("Tooltips.Common.OpenLogs"), new RelayCommand(OpenLogs), isError: true);
|
||||
}
|
||||
|
||||
public void TogglePause()
|
||||
@@ -574,7 +574,8 @@ public sealed class MainViewModel : LocalizedViewModel
|
||||
/// <summary>One sentence plus one action (BRIEF §0.2 rule 6): "Sign in" takes the user to the password box.</summary>
|
||||
private void OnSessionEnded(object? sender, ServerProblem problem) =>
|
||||
ShowToast(Loc.L(problem == ServerProblem.CertificateChanged ? "Uploader.Toast.CertificateChanged" : "Uploader.Toast.SignedOut"),
|
||||
Loc.L("Uploader.Connect.SignIn"), Loc.L("Tooltips.Uploader.SignIn"), new RelayCommand(() => SignInRequested?.Invoke(this, EventArgs.Empty)));
|
||||
Loc.L("Uploader.Connect.SignIn"), Loc.L("Tooltips.Uploader.SignIn"), new RelayCommand(() => SignInRequested?.Invoke(this, EventArgs.Empty)),
|
||||
isError: true);
|
||||
|
||||
private void OnDrained(object? sender, EventArgs e)
|
||||
{
|
||||
@@ -585,8 +586,9 @@ public sealed class MainViewModel : LocalizedViewModel
|
||||
if (confirmed > 0) UploadsCompleted?.Invoke(confirmed);
|
||||
}
|
||||
|
||||
private void ShowToast(string title, string? actionText = null, string? actionToolTip = null, ICommand? action = null) =>
|
||||
PendingToasts.Add(new Toast { Title = title, ActionText = actionText, ActionToolTip = actionToolTip, ActionCommand = action });
|
||||
/// <summary>One sentence and at most one action; <paramref name="isError"/> marks a failure or refusal, which screen readers say at once.</summary>
|
||||
private void ShowToast(string title, string? actionText = null, string? actionToolTip = null, ICommand? action = null, bool isError = false) =>
|
||||
PendingToasts.Add(new Toast { Title = title, ActionText = actionText, ActionToolTip = actionToolTip, ActionCommand = action, IsError = isError });
|
||||
|
||||
private void OpenLogs()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user