From b3a6287d4b25e3cf575b8f5855c79aedeb306109 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 08:19:55 +0000 Subject: [PATCH] fix(app): the Render quick action reads the project as stored now The card may predate an edit made in the editor, so the render takes the sequence's current row. Whitespace of a catalog test follows the formatter. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC --- src/Titano.App/Library/LibraryActions.cs | 6 ++++-- .../Repositories/CatalogRepositoryTests.cs | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Titano.App/Library/LibraryActions.cs b/src/Titano.App/Library/LibraryActions.cs index e6a352f3..e3238fe9 100644 --- a/src/Titano.App/Library/LibraryActions.cs +++ b/src/Titano.App/Library/LibraryActions.cs @@ -87,10 +87,12 @@ public sealed class LibraryActions(ShellViewModel shell) return; } if (Services.Database is not { } db) return; + // The project as stored now: the editor may have changed it since the card was read. + var current = await db.Sequences.GetAsync(sequence.Id) ?? sequence; var first = (await db.Frames.ListBySequenceAsync(sequence.Id, -1, 1)).FirstOrDefault(); var (w, h) = first is null ? (0, 0) : first.Orientation is >= 5 and <= 8 ? (first.Height, first.Width) : (first.Width, first.Height); - var export = Project(sequence.SettingsJson).Export with { Batch = [] }; - await QueueAsync(ProcessingJobs.Render(sequence, export, w, h)); + var export = Project(current.SettingsJson).Export with { Batch = [] }; + await QueueAsync(ProcessingJobs.Render(current, export, w, h)); } /// Runs one row action of the sync table on a sequence (the card's Sync, a mass Upload or Download); false when it could not start. diff --git a/tests/Titano.Data.Tests/Repositories/CatalogRepositoryTests.cs b/tests/Titano.Data.Tests/Repositories/CatalogRepositoryTests.cs index 3b0b29a0..968fbcd7 100644 --- a/tests/Titano.Data.Tests/Repositories/CatalogRepositoryTests.cs +++ b/tests/Titano.Data.Tests/Repositories/CatalogRepositoryTests.cs @@ -98,11 +98,17 @@ public abstract class CatalogRepositoryTests(TestContext context) : RepositoryTe var owner = Guid.CreateVersion7(); var harbour = TestData.Sequence(main.Id, new DateTime(2024, 6, 1), "Porto di CITTÀ vecchia") with { - Status = SequenceStatus.AnalyzedLight, Tags = ["sea"], RenderedCount = 2, + Status = SequenceStatus.AnalyzedLight, + Tags = ["sea"], + RenderedCount = 2, }; var stars = TestData.Sequence(main.Id, new DateTime(2025, 1, 2), "Milky way", "Z8") with { - CameraMake = "Nikon", Tags = ["Night Sky"], OwnerUserId = owner, Origin = SequenceOrigin.Server, SyncState = SyncState.LocalAhead, + CameraMake = "Nikon", + Tags = ["Night Sky"], + OwnerUserId = owner, + Origin = SequenceOrigin.Server, + SyncState = SyncState.LocalAhead, }; var clouds = TestData.Sequence(main.Id, new DateTime(2024, 12, 31, 23, 59, 59), "50%_clouds") with { Status = SequenceStatus.AnalyzedLight | SequenceStatus.Verified }; var elsewhere = TestData.Sequence(other.Id, new DateTime(2024, 3, 3), "Elsewhere");