fix(workspace): newer-format editor stays usable; media learn the home's photo names
A pull onto a newer Chronos's settings made the editor throw: ProjectHistory.Replace rebased every undo and redo snapshot through ProjectMerge, which refuses to merge a newer format when both sides changed, so any non-empty undo stack broke the reload after a sync that had succeeded. Replace now drops the steps instead when either side (or a step) is of a newer format: the project is shown read-only and undo never brings back values from before the newer settings. The media learnt the home's hashes and conversion aliases only inside a replay, so a status or Save version before that compared a SHA-named base with photo-named media and read a false Modified or saved a version that only re-keyed photos. Now: - ProjectContent.SameChoices also compares the texts as placed on the frames, hashed or not (Bound), so status and commit without a home agree with the base; - a status asked of the home teaches the media its names (written under the lease, or when the lease is free), and so does a checkout of a project already here; - WorkspaceStatus.MediaOutdated reports frames moved at the home, or names the media could not learn yet, and the project menu offers Update media for it (tooltip text updated in en and it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8256b72913
commit
43b092bd5d
10 files changed
+321
-19
No files matched your search
@@ -135,6 +135,29 @@ public sealed class ProjectContentTests
|
||||
Assert.Equal(newer, ProjectContent.Rebind(newer, now));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ChoicesSavedWhereAPhotoWasHashedReadAsTheSameOnFramesCopiedBeforeIt()
|
||||
{
|
||||
// A workspace copied photo 1 before its home hashed it; a version the home made since names it by its SHA-256.
|
||||
var copied = Frames(Photo(1, hashed: false), Photo(2), Photo(3));
|
||||
var home = Frames(Photo(1), Photo(2), Photo(3));
|
||||
var choices = new ProjectSettings { ExcludedFrames = [0], Camera = new CameraSettings { Keyframes = [new CameraKey(0, 0.3, 0.5, 1.2, 0)] } };
|
||||
var atHome = ProjectContent.ToPortable(choices, home);
|
||||
var here = ProjectContent.ToPortable(choices, copied);
|
||||
Assert.NotEqual(atHome, here);
|
||||
|
||||
// The same choices on the frames held here: no change to show or to save as a version.
|
||||
Assert.True(ProjectContent.SameChoices(atHome, here, copied));
|
||||
Assert.True(ProjectContent.SameChoices(here, atHome, copied));
|
||||
// What is kept keeps the hash the frames do not know yet; a choice of its own still differs.
|
||||
Assert.Equal(atHome, ProjectContent.Rebind(atHome, copied));
|
||||
Assert.False(ProjectContent.SameChoices(atHome, ProjectContent.ToPortable(new ProjectSettings { ExcludedFrames = [1] }, copied), copied));
|
||||
Assert.False(ProjectContent.SameChoices(atHome, ProjectContent.ToPortable(choices with { ExcludedFrames = [] }, copied), copied));
|
||||
// A photo none of the frames holds is compared as it is named.
|
||||
var gone = ProjectContent.ToPortable(choices, Frames(Photo(4)));
|
||||
Assert.False(ProjectContent.SameChoices(gone, ProjectContent.ToPortable(choices, Frames(Photo(4, hashed: false))), copied));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void APhotoOfABurstToldApartByItsOrderKeepsItsPositionOnceHashed()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user