Files
Chronos/src/Titano.App/Editor/IRemoteSequenceApi.cs
T
Claude 757695f037 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
2026-10-05 22:15:34 +00:00

43 lines
2.3 KiB
C#

using Titano.Protocol;
using Titano.Protocol.Client;
namespace Titano.App.Editor;
/// <summary>
/// The server calls the editor of a server sequence makes (BRIEF §14.3): the sequence and its settings with their
/// version, the analysis report, jobs and events. Failures are <see cref="TitanoApiException"/>s (404 gone, 409 settings
/// changed meanwhile) or network exceptions. The editor disposes its connection when it closes.
/// </summary>
public interface IRemoteSequenceApi : IDisposable
{
Task<SequenceDto> GetSequenceAsync(Guid id, CancellationToken cancellationToken);
/// <summary>The settings JSON and its version, the frames and the renders.</summary>
Task<SequenceManifest> GetManifestAsync(Guid id, CancellationToken cancellationToken);
/// <summary>A 409 <see cref="TitanoApiException"/> means the settings version moved on the server.</summary>
Task<SequenceDto> UpdateSequenceAsync(Guid id, UpdateSequenceRequest request, CancellationToken cancellationToken);
/// <summary>The full deep-analysis report (<c>analysis.json</c>); null when the sequence was never deep-analysed.</summary>
Task<string?> GetAnalysisReportAsync(Guid id, CancellationToken cancellationToken);
Task<JobDto> CreateJobAsync(CreateJobRequest request, CancellationToken cancellationToken);
Task<JobDto> GetJobAsync(Guid id, CancellationToken cancellationToken);
/// <summary>Every analysis and render job waiting, running or paused on the server (all pages).</summary>
Task<IReadOnlyList<JobDto>> ListActiveJobsAsync(CancellationToken cancellationToken);
/// <summary>Cancels a waiting or running job; returns it as the server now has it.</summary>
Task<JobDto> CancelJobAsync(Guid id, CancellationToken cancellationToken);
/// <summary>Queues a failed or cancelled job again from its checkpoint; returns it as the server now has it.</summary>
Task<JobDto> RetryJobAsync(Guid id, CancellationToken cancellationToken);
/// <summary>Moves a waiting job up or down the queue (<paramref name="priority"/>: background, normal or user).</summary>
Task<JobDto> SetJobPriorityAsync(Guid id, string priority, CancellationToken cancellationToken);
/// <summary>Server events until cancelled or the socket closes.</summary>
IAsyncEnumerable<ServerEvent> EventsAsync(CancellationToken cancellationToken);
}