From 3dd1acd3cf6068ff0bdea1ed1a1aea3dc5e5b561 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Mon, 26 Oct 2026 10:26:56 -0400 Subject: [PATCH] feat(desktop): undo cut-offs, sequencing, lead-ins and cutting plans Cutting edits were unrecorded, so Undo skipped them or folded them into an anonymous "Change". Each is now one labelled step: Add Cut-Off, Move Cut-Off (one step per drag), Automatic Cut-Offs, Auto Sequence (current plate or all plates, only when the order changed), Set Sequence (per click), Sequence by Path (the whole tool session; Backspace and Ctrl+Z inside it still take back one line), Place Lead-In, Remove Lead-Ins (the tool's menu, the plate and the nest commands), Cutting Parameters (an edited lead-in panel when the tool closes), Plan Cutting and Clear Lead-ins and Cut-offs. Plan Cutting stages scrap cut-offs on the live plates before it plans, so its scope opens with the staging and records only when the plan is applied; closing without applying records nothing. Clearing applied work is its own step and no longer warns that it cannot be undone. Opening the lead-in tool used to give a plate without parameters the defaults straight away; the plate now takes the tool's parameters with its first lead-in, so opening and closing the tool changes nothing. Undo no longer waits while the tool has a part picked: it ends the tool. Co-Authored-By: Claude Opus 5.5 --- .../Forms/CuttingInspectionPanelTests.cs | 12 +- .../Forms/UndoRecordingTests.cs | 255 ++++++++++++++++++ OpenNest.WinForms.Tests/Forms/UndoTestEnv.cs | 11 +- OpenNest/Actions/ActionCutOff.cs | 3 + OpenNest/Actions/ActionLeadIn.cs | 30 ++- OpenNest/Actions/ActionSequenceByPath.cs | 11 + OpenNest/Actions/ActionSetSequence.cs | 11 +- OpenNest/Controls/CutOffHandler.cs | 11 + OpenNest/Forms/AutomaticCutOffForm.cs | 11 +- OpenNest/Forms/CuttingInspectionPanel.cs | 42 ++- OpenNest/Forms/EditNestForm.cs | 68 +++-- 11 files changed, 425 insertions(+), 40 deletions(-) diff --git a/OpenNest.WinForms.Tests/Forms/CuttingInspectionPanelTests.cs b/OpenNest.WinForms.Tests/Forms/CuttingInspectionPanelTests.cs index c8b5bafe..9a475422 100644 --- a/OpenNest.WinForms.Tests/Forms/CuttingInspectionPanelTests.cs +++ b/OpenNest.WinForms.Tests/Forms/CuttingInspectionPanelTests.cs @@ -327,7 +327,9 @@ public class CuttingInspectionPanelTests program.LineTo(2, 4); program.LineTo(2, 2); program.MoveTo(4, 2); program.LineTo(6, 2); program.LineTo(6, 4); program.LineTo(4, 4); program.LineTo(4, 2); - plate.Parts.Add(new Part(new Drawing("touching contours", program), new Vector(1, 1))); + var touching = new Drawing("touching contours", program); + editor.Nest.Drawings.Add(touching); + plate.Parts.Add(new Part(touching, new Vector(1, 1))); editor.Show(); editor.PlateManager.LoadAt(0); editor.OpenCuttingInspection(); @@ -772,6 +774,8 @@ public class CuttingInspectionPanelTests Assert.False(Field(first, "existingWorkBanner").Visible); Field