Merge branch 'review2-p5a-fix2-merge' into review2-p5a-int2

This commit is contained in:
Alby96 committed 2026-11-03 12:10:16 +01:00
commit fd35e83dfc
10 files changed
+321 -19

No files matched your search

+12 -1
View File
@@ -69,12 +69,23 @@ public sealed class ProjectHistory(ProjectSettings initial, int capacity = 200,
/// <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.
/// and never brings back a value that predates the adopted change. Settings of a newer Chronos on either side (a pull
/// took them: the project is shown read-only) are never merged with this one's (<see cref="ProjectMerge"/>), so no step
/// can take that change: the undo and redo steps go instead, and undo never brings back values from before it.
/// </summary>
public void Replace(ProjectSettings current)
{
ArgumentNullException.ThrowIfNull(current);
if (ProjectMerge.SameValues(current, Current)) return;
if (current.IsNewerFormat || Current.IsNewerFormat || _undo.Any(s => s.IsNewerFormat) || _redo.Any(s => s.IsNewerFormat))
{
_undo.Clear();
_redo.Clear();
_runKey = null;
Current = current;
Changed?.Invoke();
return;
}
var (basis, theirs) = (Current, current);
Func<ProjectSettings, ProjectSettings> rebase = merge is null ? new ProjectMerge.Rebase(basis, theirs).Apply : step => merge(basis, step, theirs);
Rebase(_undo, rebase);
@@ -170,7 +170,8 @@ public sealed class ProjectMenuViewModel : LocalizedViewModel
var status = await _host.StatusAsync(ProjectId);
var moved = await _source.HomeFramesChangedAsync(CancellationToken.None);
if (_disposed) return;
_homeFramesChanged = moved;
// Also photos the library named otherwise since the copy (hashed, converted) while the media could not learn it.
_homeFramesChanged = moved || status.MediaOutdated;
Apply(status);
}
catch (Exception ex) when (ex is not OutOfMemoryException)