feat: owner review 2 phase 5a: workspace and projects with a local home (#14)
CI / Build and test (push) Successful in 9m43s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 27s
CI / PostgreSQL 16 integration (push) Failing after 8m41s
CI / PostgreSQL 17 integration (push) Successful in 12m37s
CI / Docker image (push) Successful in 56s
Release / Build, test and publish (push) Successful in 14m59s
Release / Server image (push) Successful in 1m51s
CI / Build and test (push) Successful in 9m43s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 27s
CI / PostgreSQL 16 integration (push) Failing after 8m41s
CI / PostgreSQL 17 integration (push) Successful in 12m37s
CI / Docker image (push) Successful in 56s
Release / Build, test and publish (push) Successful in 14m59s
Release / Server image (push) Successful in 1m51s
Edit opens a sequence as a project of a workspace folder outside the library. Projects have linear version histories kept as sidecars in .chronos/projects/, Main mirrors the sequence's settings, and sync merges setting by setting. Migration 0009, JobKind.WorkspaceCopy = 20, Settings › Workspace, and 241 new strings in 38 languages. 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 #14.
This commit is contained in:
1 parent
efa87f68ce
commit
9b24cf74fc
370 files changed
+29237
-287
No files matched your search
@@ -158,6 +158,127 @@ public sealed record Render
|
||||
public long Bytes { get; init; }
|
||||
public DateTimeOffset Created { get; init; }
|
||||
public string? ProducedBy { get; init; }
|
||||
|
||||
/// <summary>The project whose version was rendered (owner review 2, R8); null for a render of the sequence's settings.</summary>
|
||||
public Guid? ProjectId { get; init; }
|
||||
|
||||
/// <summary>The project version rendered; null for a render of the sequence's settings.</summary>
|
||||
public Guid? ProjectVersionId { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A project of a sequence (owner review 2, R8): a named set of render settings ("4K landscape", "Vertical social") with a
|
||||
/// linear history of versions. Every sequence has one Main project, whose head is the sequence's own settings
|
||||
/// (<see cref="Sequence.SettingsJson"/>). Its sidecar (<c>.chronos/projects/<id>/project.json</c>) is the truth; the
|
||||
/// index row is derived.
|
||||
/// </summary>
|
||||
public sealed record SequenceProject
|
||||
{
|
||||
public required Guid Id { get; init; }
|
||||
public required Guid SequenceId { get; init; }
|
||||
public required string Name { get; init; }
|
||||
|
||||
/// <summary>The sequence's Main project: its head is mirrored into the sequence's settings and drives its hero frame.</summary>
|
||||
public bool IsMain { get; init; }
|
||||
|
||||
/// <summary>The newest version; null before the first.</summary>
|
||||
public Guid? HeadVersionId { get; init; }
|
||||
|
||||
/// <summary>The newest version's number (1, 2, …); 0 before the first.</summary>
|
||||
public int HeadNumber { get; init; }
|
||||
|
||||
/// <summary>Main only: the sequence's settings version its head was last mirrored to or taken from.</summary>
|
||||
public int? MirroredSettingsVersion { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Main only: the version last mirrored to or taken from the sequence's settings; another than the head while a mirror
|
||||
/// is to complete (a push a crash cut short), null when unknown (an index rebuilt from the sidecars).
|
||||
/// </summary>
|
||||
public Guid? MirroredVersionId { get; init; }
|
||||
|
||||
public string? CreatedBy { get; init; }
|
||||
public DateTimeOffset CreatedAt { get; init; }
|
||||
public DateTimeOffset UpdatedAt { get; init; }
|
||||
|
||||
/// <summary>When the project was deleted (its folder moved to <c>.chronos/projects/.trash</c>); null while it exists.</summary>
|
||||
public DateTimeOffset? DeletedAt { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>How a project version came to be (stored as its wire name, <see cref="ProjectVersionKinds"/>).</summary>
|
||||
public enum ProjectVersionKind
|
||||
{
|
||||
/// <summary>Saved by a user in a workspace.</summary>
|
||||
Commit,
|
||||
|
||||
/// <summary>A working state merged with versions stored meanwhile.</summary>
|
||||
Merge,
|
||||
|
||||
/// <summary>An earlier version brought back (<see cref="ProjectVersion.RestoredFrom"/>).</summary>
|
||||
Restore,
|
||||
|
||||
/// <summary>The first version of a project made from settings that were there (Main from the sequence's settings, a copy of another project).</summary>
|
||||
Imported,
|
||||
|
||||
/// <summary>Main only: settings written by a path outside the projects (an analysis, the server's API, an older Chronos).</summary>
|
||||
External,
|
||||
}
|
||||
|
||||
/// <summary>Wire names of <see cref="ProjectVersionKind"/>: <c>commit</c>, <c>merge</c>, <c>restore</c>, <c>imported</c>, <c>external</c>.</summary>
|
||||
public static class ProjectVersionKinds
|
||||
{
|
||||
public static string Name(ProjectVersionKind kind) => kind.ToString().ToLowerInvariant();
|
||||
|
||||
/// <summary>The kind a wire name stands for; <see cref="ProjectVersionKind.Commit"/> for one this build does not know.</summary>
|
||||
public static ProjectVersionKind Parse(string? name)
|
||||
{
|
||||
foreach (var kind in Enum.GetValues<ProjectVersionKind>())
|
||||
{
|
||||
if (string.Equals(Name(kind), name, StringComparison.OrdinalIgnoreCase)) return kind;
|
||||
}
|
||||
return ProjectVersionKind.Commit;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// One version of a project (owner review 2, R8): immutable once stored. <see cref="SettingsJson"/> is the portable form
|
||||
/// of the settings (frame positions parked by photo, <c>ProjectContent</c>) and <see cref="ContentHash"/> the SHA-256 of
|
||||
/// its UTF-8 bytes, checked wherever it is stored or read.
|
||||
/// </summary>
|
||||
public sealed record ProjectVersion
|
||||
{
|
||||
public required Guid Id { get; init; }
|
||||
public required Guid ProjectId { get; init; }
|
||||
|
||||
/// <summary>The version it was made from; null for a project's first.</summary>
|
||||
public Guid? ParentId { get; init; }
|
||||
|
||||
/// <summary>1 for the first version of a project, then one more for each.</summary>
|
||||
public required int Number { get; init; }
|
||||
|
||||
public ProjectVersionKind Kind { get; init; }
|
||||
public string? Author { get; init; }
|
||||
|
||||
/// <summary>The PC it was made on ("STUDIO-PC" from a workspace; the archive's own versions carry its lease owner, "chronos@STUDIO-PC").</summary>
|
||||
public string? ClientName { get; init; }
|
||||
|
||||
public string? Note { get; init; }
|
||||
public required string SettingsJson { get; init; }
|
||||
public required string ContentHash { get; init; }
|
||||
|
||||
/// <summary>The settings format (<c>ProjectSettings.Version</c>) of <see cref="SettingsJson"/>; a newer one opens read-only.</summary>
|
||||
public int SettingsFormat { get; init; } = 1;
|
||||
|
||||
/// <summary>The frames version of the sequence the settings were made against.</summary>
|
||||
public int FramesVersion { get; init; }
|
||||
|
||||
/// <summary>For a <see cref="ProjectVersionKind.Restore"/>: the version brought back.</summary>
|
||||
public Guid? RestoredFrom { get; init; }
|
||||
|
||||
/// <summary>When it was made (in a workspace).</summary>
|
||||
public DateTimeOffset CreatedAt { get; init; }
|
||||
|
||||
/// <summary>When its home stored it; null for a workspace's version not pushed yet.</summary>
|
||||
public DateTimeOffset? StoredAt { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>Any long operation: resumable, cancellable, logged (BRIEF §5, §14.6).</summary>
|
||||
|
||||
Reference in new issue
Block a user