fix(editor): server jobs, stale proxies and read-only accounts in the remote editor

- A server sequence whose cached frames are no longer the server's (a load, a 409
  merge or a frames change event finds other frame ids) turns read-only and says
  why; opening it, or a sequence without cached proxies, queues the proxy
  download and opens it when done. Signed out reads "Connect to the server".
- Server jobs show queued, running (with a bar), paused and analysing glyphs in
  the header with Cancel; a failed or cancelled one raises a toast with Retry.
  Progress alone no longer refreshes the whole editor.
- The server job list is read by state and kind to its last page; "Add to queue"
  sets the job's priority; the event listener survives any failure and always
  releases its frames and connection.
- An account that may render but not edit picks the preset to render without
  changing the project; preset cards and their batch boxes say why they wait.
- Export tab of a server sequence: no local encoder, notices or folder; no Jobs
  history link. Sync at 12 px beside a folder that keeps 96 px and trims.
- Restore's Undo puts back the project from before the restore, only while that
  restore is the editor's last change.
- Export "Sync" of a render that ends while the session is down is queued for the
  saved session's server; skips are logged; sync follows the engine before it
  starts.
- Capture: sequence-remote-export, -running and -readonly, and
  sequence-export-copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-05 22:15:34 +00:00
1 parent 2813184b85
commit 757695f037
27 files changed
+932 -173

No files matched your search

+57 -4
View File
@@ -18,7 +18,8 @@ namespace Titano.App.Shell;
/// <c>Titano.exe --capture &lt;dir&gt;</c>: renders every client screen at 1440×900 in the dark and light themes to
/// <c>&lt;screen&gt;-&lt;theme&gt;.png</c> from <see cref="SampleData"/> (first run on an empty index, then a populated
/// one, then the sync table with transfers, a conflict and its confirmation, then the sequence editor on an archive
/// sequence and on a server sequence with proxies), for visual review and phase reports (BRIEF §20.2), then exits.
/// sequence and on a server sequence with proxies, its server job and a read-only account), for visual review and phase
/// reports (BRIEF §20.2), then exits.
/// </summary>
public static class ScreenCapture
{
@@ -175,7 +176,8 @@ public static class ScreenCapture
/// <summary>
/// The sequence editor on the synthetic sunset: every section in both themes (<c>sequence-&lt;tab&gt;-&lt;theme&gt;.png</c>,
/// the Camera tab with a keyframe selected, the Export tab as Export.html with the crop mask and no compare), then
/// the preview overlays, the waveform, the "what changed" toast of Optimise all and the busy state.
/// the preview overlays, the waveform, the "what changed" toast of Optimise all, the Export tab of the sequence once
/// the server has it (Sync on) with two "Save both" copies to restore, and the busy state.
/// </summary>
private static async Task<int> CaptureEditorAsync(MainWindow window, ShellViewModel shell, SampleData sample, string directory)
{
@@ -215,6 +217,23 @@ public static class ScreenCapture
foreach (var toast in window.Toasts.Toasts.ToList()) window.Toasts.Dismiss(toast);
}
// The server has the sequence (Sync can be ticked) and two copies of this PC's settings were kept by "Save both".
await sample.KeepEditorCopiesAsync(id);
await editor.Session.ReloadAsync();
await editor.RefreshSyncGateAsync();
var export = editor.Tabs.OfType<ExportTab>().Single();
export.SyncToServer = true;
editor.SelectedTab = export;
editor.IsCompare = false;
foreach (var theme in Themes)
{
ThemeManager.Apply(theme);
written += await SaveEditorAsync(window, editor, directory, "sequence-export-copies", theme);
}
export.SyncToServer = false;
editor.SelectedTab = editor.Exposure;
editor.IsCompare = true;
// Last, as it stays: an analysis of the sequence running (settings disabled, viewing tools live).
await sample.MarkAnalysingAsync(id);
await editor.AttachJobsAsync();
@@ -228,7 +247,10 @@ public static class ScreenCapture
/// <summary>
/// A server sequence open with this PC's proxies (Sunrise over Superga, cached by the sync captures): the server in
/// the header, the preview from the proxies, the project from the server (<c>sequence-remote-&lt;theme&gt;.png</c>).
/// the header, the preview from the proxies, the project from the server (<c>sequence-remote</c>); its Export tab,
/// where the server picks the encoder and keeps the renders (<c>sequence-remote-export</c>); a render running on the
/// server with its bar and Cancel (<c>sequence-remote-running</c>); then, last as it stays, the sequence opened by an
/// account without the Edit right (<c>sequence-remote-readonly</c>).
/// </summary>
private static async Task<int> CaptureRemoteEditorAsync(MainWindow window, ShellViewModel shell, SampleData sample, string directory)
{
@@ -242,11 +264,42 @@ public static class ScreenCapture
return 0;
}
DismissToasts(window);
editor.SelectedTab = editor.Exposure;
var export = editor.Tabs.OfType<ExportTab>().Single();
foreach (var theme in Themes)
{
ThemeManager.Apply(theme);
editor.SelectedTab = editor.Exposure;
editor.IsCompare = true;
written += await SaveEditorAsync(window, editor, directory, "sequence-remote", theme);
editor.SelectedTab = export;
editor.IsCompare = false;
written += await SaveEditorAsync(window, editor, directory, "sequence-remote-export", theme);
}
sample.RunServerRender();
await editor.AttachJobsAsync();
editor.SelectedTab = editor.Exposure;
editor.IsCompare = true;
foreach (var theme in Themes)
{
ThemeManager.Apply(theme);
written += await SaveEditorAsync(window, editor, directory, "sequence-remote-running", theme);
}
sample.EndServerJobs();
await sample.RestrictAccountAsync();
await shell.Sequence.OpenAsync(id, reload: true);
if (shell.Sequence.Editor is not { IsReadOnly: true } viewer)
{
Log.Warning("capture", "The server sequence did not open read-only");
return written;
}
DismissToasts(window);
viewer.SelectedTab = viewer.Exposure;
foreach (var theme in Themes)
{
ThemeManager.Apply(theme);
written += await SaveEditorAsync(window, viewer, directory, "sequence-remote-readonly", theme);
}
return written;
}