fix(editor): optimise lines point the reading way; failed saves and jobs are errors
EditorText.Change picks Editor.Optimise.ChangeRtl ('{0}: {1} ← {2}',
invariant) in right-to-left languages, as Import.Session.TimeRtl and
Jobs.Target.RenderRtl do. A failed save and a failed server job raise error
toasts; a cancelled job stays a notice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
4 files changed
+31
-3
No files matched your search
@@ -196,6 +196,14 @@ public static class EditorText
|
||||
_ => parameter,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// "Deflicker window: 21 frames → 41 frames", one line of the Optimise toast. Bidi never mirrors an arrow, so a
|
||||
/// right-to-left language reads it from its own resource, the arrow pointing from the old value to the new one.
|
||||
/// </summary>
|
||||
public static string Change(SettingChange change) =>
|
||||
Loc.L(Loc.IsRightToLeft ? "Editor.Optimise.ChangeRtl" : "Editor.Optimise.Change", ParameterLabel(change.Parameter), Value(change.Parameter, change.Before),
|
||||
Value(change.Parameter, change.After));
|
||||
|
||||
/// <summary>A value of an advisor parameter as its control shows it (the "what changed" toast of Optimise).</summary>
|
||||
public static string Value(string parameter, object? value) => (parameter, value) switch
|
||||
{
|
||||
|
||||
@@ -819,6 +819,7 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
|
||||
{
|
||||
Title = Loc.L("Editor.Save.Failed"),
|
||||
Message = ex.Message,
|
||||
IsError = true,
|
||||
ActionText = Loc.L("Editor.Save.Retry"),
|
||||
ActionToolTip = Loc.L("Tooltips.Editor.Save.Retry"),
|
||||
ActionCommand = new RelayCommand(() => _ = Session.FlushAsync()),
|
||||
@@ -893,9 +894,7 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
|
||||
Shell.Notify(Loc.L("Editor.Optimise.Nothing"));
|
||||
return;
|
||||
}
|
||||
var lines = changes.Select(c => Loc.L("Editor.Optimise.Change", EditorText.ParameterLabel(c.Parameter), EditorText.Value(c.Parameter, c.Before),
|
||||
EditorText.Value(c.Parameter, c.After)));
|
||||
Shell.Notify(Loc.Plural("Editor.Optimise.Done", changes.Count), string.Join(Environment.NewLine, lines));
|
||||
Shell.Notify(Loc.Plural("Editor.Optimise.Done", changes.Count), string.Join(Environment.NewLine, changes.Select(EditorText.Change)));
|
||||
}
|
||||
|
||||
private async Task AnalyseAsync()
|
||||
@@ -957,6 +956,7 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
|
||||
{
|
||||
Title = Loc.L("Editor.ServerJob.Ended", JobText.Kind(job.Kind), Loc.L("Jobs.State." + job.State), server),
|
||||
Message = job.Error ?? job.TargetLabel ?? Title,
|
||||
IsError = job.State == JobState.Failed,
|
||||
ActionText = Loc.L("Jobs.Action.Retry"),
|
||||
ActionToolTip = Loc.L("Tooltips.Editor.ServerJob.Retry", server),
|
||||
ActionCommand = new AsyncRelayCommand(() => Session.Source.RetryJobAsync(job.Id, CancellationToken.None), () => !_disposed),
|
||||
|
||||
Reference in new issue
Block a user