feat(editor): visual crop, rotate/mirror/flip/straighten, colour looks (owner review 1 phase 4) (#26)
CI / Build and test (push) Successful in 8m19s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 12m9s
CI / PostgreSQL 16 integration (push) Successful in 7m49s
CI / PostgreSQL 17 integration (push) Successful in 7m19s
CI / Docker image (push) Successful in 46s
Release / Server image (push) Successful in 1m14s

Owner review 1 R5 + R6. Camera rotation, mirror, flip, straighten and crop handles locked to the output; an Exposure Look group; Export output size ("proportions win"); settings format 2 with older-node gates. Also fixes project text and hashes differing between Windows and Linux.

Closes #19
Closes #20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #26.
This commit is contained in:
Alby96andClaude Opus 5.5 authored and Alby96 committed 2026-11-05 01:09:09 +01:00
1 parent db389a54f2
commit 188b2c2e55
355 files changed
+10549 -1061

No files matched your search

+30
View File
@@ -85,8 +85,21 @@ public interface ISyncRemote : IDisposable
/// <summary>The sequence's deep-analysis report (<c>analysis.json</c>); null when it was never deep-analysed, or the remote has no such call.</summary>
Task<string?> GetAnalysisReportAsync(Guid sequenceId, CancellationToken cancellationToken) => Task.FromResult<string?>(null);
/// <summary>
/// The highest project settings format the server reads (<see cref="ServerInfo.SettingsFormat"/>; 1 for an older server,
/// which announces none). Settings that need more are never sent to it (owner review 1, phase 4): it would store them and
/// then fail every render of them. A remote that cannot say reads this Chronos's.
/// </summary>
Task<int> SettingsFormatAsync(CancellationToken cancellationToken) => Task.FromResult(Core.Project.ProjectSettings.CurrentVersion);
}
/// <summary>
/// Settings that need a newer settings format than the server reads (an older Chronos Server; owner review 1, phase 4): kept
/// on this PC, nothing sent. Its message is the sentence the sync row shows.
/// </summary>
public sealed class ServerFormatException(string message) : IOException(message);
/// <summary>Where sync jobs find their server connection.</summary>
public interface ISyncConnector
{
@@ -107,6 +120,23 @@ public sealed class ChronosSyncRemote(ChronosClient client, bool ownsClient) : I
private const int SequencePage = 500;
private const int FramePage = 1000;
/// <summary>How long the server's announced settings format is taken as it was read (an update of the server restarts it).</summary>
private static readonly TimeSpan FormatAge = TimeSpan.FromMinutes(1);
private KnownFormat? _format;
public async Task<int> SettingsFormatAsync(CancellationToken cancellationToken)
{
if (Volatile.Read(ref _format) is { } known && System.Diagnostics.Stopwatch.GetElapsedTime(known.Read) < FormatAge) return known.Format;
var info = await client.GetInfoAsync(cancellationToken).ConfigureAwait(false);
var format = info.SettingsFormat is > 0 and var announced ? announced : Core.Project.ProjectSettings.BaseVersion;
Volatile.Write(ref _format, new KnownFormat(format, System.Diagnostics.Stopwatch.GetTimestamp()));
return format;
}
/// <summary>The settings format the server announced, and when it was read (a <see cref="System.Diagnostics.Stopwatch"/> timestamp).</summary>
private sealed record KnownFormat(int Format, long Read);
public string Server { get; } = SyncService.ServerKey(client.BaseAddress);
public async Task<IReadOnlyList<SequenceDto>> ListSequencesAsync(CancellationToken cancellationToken)
+12
View File
@@ -267,6 +267,17 @@ public static class SyncRules
}
}
/// <summary>
/// The project's "version" while both sides are of a format this Chronos writes (owner review 1, phase 4): it follows the
/// other members (format 2 only while a turn or a look is set), so it is no difference of its own; one of a newer Chronos
/// still is.
/// </summary>
private static bool Derived(string name, JsonNode? a, JsonNode? b) =>
name == "version" && FormatOf(a) <= ProjectSettings.CurrentVersion && FormatOf(b) <= ProjectSettings.CurrentVersion;
private static int FormatOf(JsonNode? value) =>
value is null ? ProjectSettings.BaseVersion : value is JsonValue v && v.TryGetValue<int>(out var format) ? format : int.MaxValue;
private static void Collect(JsonNode? a, JsonNode? b, string path, List<SettingsDifference> differences, int max)
{
if (differences.Count >= max) return;
@@ -276,6 +287,7 @@ public static class SyncRules
{
left.TryGetPropertyValue(name, out var x);
right.TryGetPropertyValue(name, out var y);
if (path.Length == 0 && Derived(name, x, y)) continue;
Collect(x, y, path.Length == 0 ? name : path + "." + name, differences, max);
if (differences.Count >= max) return;
}
+4
View File
@@ -664,6 +664,10 @@ public sealed class SyncService
{
var positions = Positions(remote, local, manifest);
if (await positions.ToServerAsync(local.SettingsVersion, cancellationToken).ConfigureAwait(false) is not { } translated) return null;
// Settings an older server cannot read (owner review 1, phase 4: a turn, a mirror, a look) stay here, the sync row
// saying why: the server would store them and then fail every render of them.
if (ProjectContent.FormatOf(translated.SettingsJson) > await remote.SettingsFormatAsync(cancellationToken).ConfigureAwait(false))
throw new ServerFormatException(Loc.L("Tooltips.Server.NeedsNewerServer"));
var frames = ProjectSettings.NamesFrames(translated.Local.SettingsJson) ? positions.ServerFrames : (int?)null;
return (SyncPayload.Of(translated.Local) with { SettingsJson = translated.SettingsJson }).ToRequest(expected, frames);
}