From b376d217ddb65347da42085223eec9ceace62ff2 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Sat, 24 Oct 2026 14:00:49 -0400 Subject: [PATCH] feat(desktop): one Drawing Sets window with Sets and Releases tabs The drawing sets window now has two tabs. Releases hosts the release list (paging, nests, Undo Release, New Release) as a SetReleasesView control that replaces SetReleasesForm. File > Releases stays as a shortcut that opens the window on that tab. A set's Releases (Sets tab) and a library drawing's Releases (Drawing Library) open the tab filtered to it, with the filter shown above the list and Clear Filter to list every release. Releases re-reads its page whenever the tab is shown again, so a release made on Sets appears. The set editor gets History... for a saved set; the Sets tab keeps its History button until the browser's buttons are rearranged. Co-Authored-By: Claude Opus 5.5 --- OpenNest.Data/DrawingSetEditSession.cs | 3 + .../Forms/DrawingSetFormsTests.cs | 37 +++++ .../Forms/SetReleaseFormsTests.cs | 126 +++++++++++--- OpenNest/Controls/DrawingSetBrowser.cs | 14 +- .../SetReleasesView.Designer.cs} | 99 +++++++---- .../SetReleasesView.cs} | 154 +++++++++++------- OpenNest/Forms/DrawingLibraryForm.cs | 11 +- OpenNest/Forms/DrawingSetsForm.Designer.cs | 56 ++++++- OpenNest/Forms/DrawingSetsForm.cs | 75 ++++++++- OpenNest/Forms/EditDrawingSetForm.Designer.cs | 25 ++- OpenNest/Forms/EditDrawingSetForm.cs | 21 ++- OpenNest/Forms/MainForm.File.cs | 38 +---- docs/nest-storage.md | 60 ++++--- 13 files changed, 515 insertions(+), 204 deletions(-) rename OpenNest/{Forms/SetReleasesForm.Designer.cs => Controls/SetReleasesView.Designer.cs} (82%) rename OpenNest/{Forms/SetReleasesForm.cs => Controls/SetReleasesView.cs} (71%) diff --git a/OpenNest.Data/DrawingSetEditSession.cs b/OpenNest.Data/DrawingSetEditSession.cs index 620e1b07..e3324ba0 100644 --- a/OpenNest.Data/DrawingSetEditSession.cs +++ b/OpenNest.Data/DrawingSetEditSession.cs @@ -56,6 +56,9 @@ public sealed class DrawingSetEditSession public Guid Id { get; } + /// The store the set is read from and saved to; also reads its history. + public IDrawingSetStore Store => _sets; + public string SavedBy { get; } /// The set as last read or saved; null until a new set is first saved. diff --git a/OpenNest.WinForms.Tests/Forms/DrawingSetFormsTests.cs b/OpenNest.WinForms.Tests/Forms/DrawingSetFormsTests.cs index 1bc95d8b..5984d4b9 100644 --- a/OpenNest.WinForms.Tests/Forms/DrawingSetFormsTests.cs +++ b/OpenNest.WinForms.Tests/Forms/DrawingSetFormsTests.cs @@ -66,6 +66,43 @@ public class DrawingSetFormsTests "The new set test did not complete."); } + [Fact] + public void Editor_History_ShowsTheSavedSetsRevisions_AndIsHiddenForANewSet() + { + StaTestThread.Run( + () => + { + var library = new FakeLibrary(); + var a = library.Add("SYN-A", "Synthetic Steel", 0.25); + var sets = new InMemoryDrawingSets(); + var created = Run(sets.CreateAsync(new DrawingSetRecord + { + Id = Guid.NewGuid(), + Name = "Synthetic kit", + Members = new[] { new DrawingSetMember { DrawingId = a.Id, Quantity = 2, Drawing = a } }, + })); + var shown = new List(); + + using (var editor = new EditDrawingSetForm(new DrawingSetEditSession(sets, created, "Synthetic operator"), library, Server)) + { + editor.ShowHistory = shown.Add; + editor.Show(); + var history = Field