fix(app): editor review fixes for saving, undo, preview, commands and layout
- Undo/redo snapshots take outside changes (advice, merged edits) on Replace; a drag, click or key press ends a merged run; Reset to Auto is its own step. - A failed save stays pending and is retried with backoff; closing or switching asks before discarding it; the local source throws unless the index took it. - Opening a sequence survives any failure; the window title follows the editor; the job bar hides when idle in the editor. - Render, Add to queue and Batch re-read their state; disabled commands say why; Analyse is disabled while queued and announces its cost and Ctrl+Shift+A. - Preview: 1:1 and wheel zoom render the source's own pixels, the view keeps its place across resolutions, crop mask result mode, unreadable frames say so, labelled tools, keyboard focus on open, tools hidden on Export lose their effect. - Preparation re-solves from measured series (no re-decode per slider step) with a half-precision frame cache. - Exposure flicker and waveform charts, Time plan chart, Camera crop margins, sortable frame table, wrapped findings, responsive preset cards, render-done follow-up, Jobs history filtered on the sequence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
32 files changed
+1612
-369
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Video;
|
||||
@@ -35,7 +36,7 @@ public sealed class EditorSession : IAsyncDisposable
|
||||
History = new ProjectHistory(content.Project);
|
||||
History.Changed += OnProjectChanged;
|
||||
_saver = new ProjectSaver(SaveAsync, saveDelay ?? DefaultSaveDelay);
|
||||
_saver.Failed += ex => SaveFailed?.Invoke(ex);
|
||||
_saver.Failed += OnSaveFailed;
|
||||
(Content, Context, Advice, Presets) = Analyse(content, _codecs);
|
||||
}
|
||||
|
||||
@@ -45,7 +46,7 @@ public sealed class EditorSession : IAsyncDisposable
|
||||
/// <summary>The sequence was read again (after an analysis): frames, reports, advice and presets.</summary>
|
||||
public event Action? ContentChanged;
|
||||
|
||||
/// <summary>Saving the project failed; the next change tries again.</summary>
|
||||
/// <summary>Saving the project failed (raised once per run of failures; the save is retried until it succeeds).</summary>
|
||||
public event Action<Exception>? SaveFailed;
|
||||
|
||||
public ISequenceSource Source { get; }
|
||||
@@ -64,9 +65,12 @@ public sealed class EditorSession : IAsyncDisposable
|
||||
|
||||
public ProjectSettings Project => History.Current;
|
||||
|
||||
/// <summary>A change is waiting for its save or being saved.</summary>
|
||||
/// <summary>A change is waiting for its save, being saved, or waiting for a retry after a failed save.</summary>
|
||||
public bool HasPendingSave => _saver.HasPendingChanges;
|
||||
|
||||
/// <summary>Why the pending change could not be stored; null when the last save succeeded.</summary>
|
||||
public Exception? LastSaveError => _saver.LastError;
|
||||
|
||||
/// <summary>Applies <paramref name="change"/> as an undoable step; false when it changes nothing.</summary>
|
||||
/// <param name="mergeKey">Consecutive edits with the same key are one undo step (a slider drag).</param>
|
||||
public bool Edit(Func<ProjectSettings, ProjectSettings> change, string? mergeKey = null)
|
||||
@@ -75,6 +79,9 @@ public sealed class EditorSession : IAsyncDisposable
|
||||
return History.Apply(change(Project), mergeKey);
|
||||
}
|
||||
|
||||
/// <summary>The drag or key press behind a run of merged edits ended (<see cref="ProjectHistory.EndRun"/>).</summary>
|
||||
public void EndEditRun() => History.EndRun();
|
||||
|
||||
public bool Undo() => History.Undo();
|
||||
|
||||
public bool Redo() => History.Redo();
|
||||
@@ -146,13 +153,14 @@ public sealed class EditorSession : IAsyncDisposable
|
||||
ContentChanged?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>Stores pending changes now.</summary>
|
||||
public Task FlushAsync() => _saver.FlushAsync();
|
||||
/// <summary>Stores pending changes now; false when the save failed (the change stays pending and is retried).</summary>
|
||||
public Task<bool> FlushAsync() => _saver.FlushAsync();
|
||||
|
||||
/// <summary>Stores what is pending one last time and releases the source; callers that must not lose an edit flush and ask first.</summary>
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
History.Changed -= OnProjectChanged;
|
||||
await _saver.FlushAsync();
|
||||
if (!await _saver.FlushAsync()) Log.Warning("editor", $"The last change of {Content.Sequence.DisplayTitle} was not saved", _saver.LastError);
|
||||
await Source.DisposeAsync();
|
||||
}
|
||||
|
||||
@@ -177,6 +185,12 @@ public sealed class EditorSession : IAsyncDisposable
|
||||
return changes;
|
||||
}
|
||||
|
||||
private void OnSaveFailed(Exception ex, int failures)
|
||||
{
|
||||
Log.Warning("editor", $"Saving the project of {Content.Sequence.DisplayTitle} failed (attempt {failures})", ex);
|
||||
if (failures == 1) SaveFailed?.Invoke(ex);
|
||||
}
|
||||
|
||||
private void OnProjectChanged()
|
||||
{
|
||||
_saver.Schedule(Project);
|
||||
|
||||
Reference in new issue
Block a user