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:
Claude committed 2026-10-03 10:36:50 +00:00
1 parent 596b748c5c
commit 25e85aee57
32 files changed
+1612 -369

No files matched your search

+24 -7
View File
@@ -4,13 +4,14 @@ namespace Titano.App.Editor;
/// <summary>
/// Undo and redo of the editor's project (Ctrl+Z / Ctrl+Y). Projects are immutable, so each step is a snapshot.
/// Consecutive edits with the same <c>mergeKey</c> (one slider drag, typing in one field) form a single step; any
/// other edit, undo or redo ends the run. The oldest steps are dropped beyond <see cref="Capacity"/>.
/// Consecutive edits with the same <c>mergeKey</c> (one slider drag, typing in one field) form a single step until
/// <see cref="EndRun"/> (the drag or key press ended); any other edit, undo or redo also ends the run. The oldest steps
/// are dropped beyond <see cref="Capacity"/>.
/// </summary>
public sealed class ProjectHistory(ProjectSettings initial, int capacity = 200)
{
private readonly LinkedList<ProjectSettings> _undo = new();
private readonly Stack<ProjectSettings> _redo = new();
private readonly LinkedList<ProjectSettings> _redo = new();
private string? _runKey;
/// <summary>The project, after any edit, undo, redo or <see cref="Replace"/>.</summary>
@@ -41,31 +42,47 @@ public sealed class ProjectHistory(ProjectSettings initial, int capacity = 200)
return true;
}
/// <summary>The gesture behind a run of merged edits ended: the next edit is a new step even with the same key.</summary>
public void EndRun() => _runKey = null;
public bool Undo()
{
if (_undo.Last is not { } previous) return false;
_undo.RemoveLast();
_redo.Push(Current);
_redo.AddLast(Current);
return Move(previous.Value);
}
public bool Redo()
{
if (!_redo.TryPop(out var next)) return false;
if (_redo.Last is not { } next) return false;
_redo.RemoveLast();
_undo.AddLast(Current);
return Move(next);
return Move(next.Value);
}
/// <summary>Adopts a project changed outside the editor (analysis advice, a merge on save) without an undo step.</summary>
/// <summary>
/// Adopts a project changed outside the editor (analysis advice, another client's edit merged on save) without an
/// undo step. Every undo and redo snapshot takes the same outside change, so undo reverts only the user's own steps
/// and never brings back a value that predates the adopted change.
/// </summary>
public void Replace(ProjectSettings current)
{
ArgumentNullException.ThrowIfNull(current);
if (ProjectMerge.SameValues(current, Current)) return;
var rebase = new ProjectMerge.Rebase(Current, current);
Rebase(_undo, rebase);
Rebase(_redo, rebase);
_runKey = null;
Current = current;
Changed?.Invoke();
}
private static void Rebase(LinkedList<ProjectSettings> steps, ProjectMerge.Rebase rebase)
{
for (var node = steps.First; node is not null; node = node.Next) node.Value = rebase.Apply(node.Value);
}
private bool Move(ProjectSettings target)
{
_runKey = null;