fix(editor): a server sequence's analyses and renders say where they run
Analyse no longer points to the Jobs screen for a server job, the Render and Batch tooltips name the server and its one job per preset, a server that does not answer in time is reported after a job, the Export Sync send logs any failure and follows a replaced job engine, and job states use the wire names. 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
+24
-8
No files matched your search
@@ -294,8 +294,9 @@
|
||||
ToolTip="{Binding HistoryText}" />
|
||||
</DockPanel>
|
||||
<!-- This PC's settings kept by "Save both" (sync conflicts): the newest, or another from the menu, becomes the project as one undo step. -->
|
||||
<v:SplitButton Margin="0,8,0,0" HorizontalAlignment="Left" Content="{Binding RestoreText}" Command="{Binding RestoreCommand}" ItemsSource="{Binding SavedCopies}" DisplayMemberPath="Label"
|
||||
SelectedItem="{Binding SelectedCopy}" ToolTip="{Binding RestoreToolTip}" ToolTipService.ShowOnDisabled="True"
|
||||
<v:SplitButton Margin="0,8,0,0" HorizontalAlignment="Left" Content="{Binding RestoreText}" Command="{Binding RestoreCommand}"
|
||||
ItemsSource="{Binding SavedCopies}" DisplayMemberPath="Label" SelectedItem="{Binding SelectedCopy}" ToolTip="{Binding RestoreToolTip}"
|
||||
ToolTipService.ShowOnDisabled="True"
|
||||
DropDownToolTip="{l:Loc Tooltips.Editor.Export.RestoreChoice}" AutomationProperties.Name="{l:Loc Editor.Export.RestoreName}"
|
||||
Visibility="{Binding HasSavedCopies, Converter={StaticResource BoolToVisibility}}" />
|
||||
</StackPanel>
|
||||
|
||||
@@ -377,7 +377,7 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
|
||||
/// <summary>"Render · 4K archive".</summary>
|
||||
public string RenderText => Loc.L("Editor.Render", Plan?.PresetName ?? string.Empty);
|
||||
|
||||
public string RenderToolTip => RenderBlockedReason ?? Loc.L("Tooltips.Editor.Render");
|
||||
public string RenderToolTip => RenderBlockedReason ?? (IsRemote ? Loc.L("Tooltips.Editor.RenderServer", RemoteText ?? string.Empty) : Loc.L("Tooltips.Editor.Render"));
|
||||
|
||||
public bool CanRender => RenderBlockedReason is null;
|
||||
|
||||
@@ -784,7 +784,9 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
|
||||
private async Task AnalyseAsync()
|
||||
{
|
||||
await Session.SubmitAsync(Session.AnalysisRequest());
|
||||
Shell.Notify(Loc.L("Editor.Analyse.Queued"), Title, Loc.L("Shell.Nav.Jobs"), Loc.L("Tooltips.Nav.Jobs"), () => Shell.Navigate(SectionKey.Jobs));
|
||||
// The Jobs screen lists this PC's jobs; a server's analysis shows beside the title.
|
||||
if (IsRemote) Shell.Notify(Loc.L("Editor.Analyse.QueuedServer", RemoteText ?? string.Empty), Title);
|
||||
else Shell.Notify(Loc.L("Editor.Analyse.Queued"), Title, Loc.L("Shell.Nav.Jobs"), Loc.L("Tooltips.Nav.Jobs"), () => Shell.Navigate(SectionKey.Jobs));
|
||||
}
|
||||
|
||||
private void OnJobChanged(Job job)
|
||||
@@ -838,8 +840,9 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
|
||||
await Session.ReloadAsync();
|
||||
}
|
||||
catch (Exception ex) when (ex is System.IO.IOException or System.IO.InvalidDataException or InvalidOperationException or UnauthorizedAccessException
|
||||
or System.Net.Http.HttpRequestException or Protocol.Client.TitanoApiException)
|
||||
or System.Net.Http.HttpRequestException or Protocol.Client.TitanoApiException or OperationCanceledException)
|
||||
{
|
||||
// A server that does not answer in time cancels the request (OperationCanceledException).
|
||||
Shell.ReportError(ex);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,9 @@ public sealed class ExportTab : EditorTab
|
||||
|
||||
public string AddToQueueToolTip => Editor.RenderBlockedReason ?? Loc.L("Tooltips.Editor.Export.AddToQueue");
|
||||
|
||||
public string BatchToolTip => Editor.RenderBlockedReason ?? Loc.L(Batch.Count > 0 ? "Tooltips.Editor.Export.Batch" : "Tooltips.Editor.Export.BatchEmpty");
|
||||
public string BatchToolTip => Editor.RenderBlockedReason ?? (Batch.Count == 0 ? Loc.L("Tooltips.Editor.Export.BatchEmpty")
|
||||
: Editor.IsRemote ? Loc.L("Tooltips.Editor.Export.BatchServer", Editor.RemoteText ?? string.Empty)
|
||||
: Loc.L("Tooltips.Editor.Export.Batch"));
|
||||
|
||||
public bool HasHistory => Editor.Session.Content.Renders.Count > 0;
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Titano.App.Editor;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data.Jobs;
|
||||
using Titano.Protocol;
|
||||
using Titano.Protocol.Client;
|
||||
|
||||
@@ -10,7 +12,7 @@ public delegate IRemoteSequenceApi RemoteSequenceApiFactory(Uri address, string
|
||||
/// <summary><see cref="IRemoteSequenceApi"/> over a signed-in <see cref="TitanoClient"/>, which it owns.</summary>
|
||||
public sealed class TitanoRemoteSequenceApi(TitanoClient client) : IRemoteSequenceApi
|
||||
{
|
||||
private static readonly string[] ActiveStates = ["queued", "running", "paused"];
|
||||
private static readonly string[] ActiveStates = [JobWire.State(JobState.Queued), JobWire.State(JobState.Running), JobWire.State(JobState.Paused)];
|
||||
|
||||
public Task<SequenceDto> GetSequenceAsync(Guid id, CancellationToken cancellationToken) => client.GetSequenceAsync(id, cancellationToken);
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ public sealed class SyncHost(AppServices services) : ISyncConnector, IAsyncDispo
|
||||
if (services.Engine is not { } engine) return;
|
||||
Uploads.Attach(engine);
|
||||
if (ReferenceEquals(_renders, engine)) return;
|
||||
if (_renders is not null) _renders.JobChanged -= OnJobChanged;
|
||||
_renders = engine;
|
||||
engine.JobChanged += OnJobChanged;
|
||||
}
|
||||
@@ -156,8 +157,9 @@ public sealed class SyncHost(AppServices services) : ISyncConnector, IAsyncDispo
|
||||
{
|
||||
if (await exports.SendAsync(job, Server, CanUpload) is { } send) Log.Info("sync", $"{job.TargetLabel} will be sent to the server (job {send.Id})");
|
||||
}
|
||||
catch (Exception ex) when (ex is Data.DatabaseException or InvalidOperationException)
|
||||
catch (Exception ex) when (ex is not OutOfMemoryException)
|
||||
{
|
||||
// Nobody awaits this: the render itself succeeded, and the send can be asked for again on the Server screen.
|
||||
Log.Warning("sync", $"The render {job.TargetLabel} could not be queued for the server", ex);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user