merge: integration branch claude/keen-knuth-uhxv8w (remote editor after review) into the Library workstream

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-06 20:38:30 +00:00
commit a4ceb89247
81 files changed
+3827 -263

No files matched your search

@@ -74,6 +74,12 @@ public sealed record SequenceEdit
public int? Rating { get; init; }
public string? Notes { get; init; }
public string? SettingsJson { get; init; }
/// <summary>
/// The frame the Library shows for the sequence (the project's hero frame); <see cref="Guid.Empty"/> clears it, so
/// the first frame shows. A frame of another sequence is ignored.
/// </summary>
public Guid? HeroFrameId { get; init; }
}
public enum SequenceEditOutcome
@@ -233,12 +239,17 @@ public sealed class SequenceRepository
if (current is null) return new SequenceEditResult(SequenceEditOutcome.NotFound, null);
if (expectedSettingsVersion is { } expected && expected != current.SettingsVersion)
return new SequenceEditResult(SequenceEditOutcome.Conflict, current);
var hero = current.HeroFrameId;
if (edit.HeroFrameId == Guid.Empty) hero = null;
else if (edit.HeroFrameId is { } frame && await session.ScalarAsync<long>("SELECT count(*) FROM frames WHERE id = $1 AND sequence_id = $2",
[frame, id], cancellationToken).ConfigureAwait(false) > 0) hero = frame;
var updated = current with
{
Title = edit.Title is null ? current.Title : NullIfEmpty(edit.Title),
Notes = edit.Notes is null ? current.Notes : NullIfEmpty(edit.Notes),
Rating = edit.Rating ?? current.Rating,
SettingsJson = edit.SettingsJson ?? current.SettingsJson,
HeroFrameId = hero,
SettingsVersion = current.SettingsVersion + 1,
UpdatedAt = DateTimeOffset.UtcNow,
};