Undo regenerates each restored plate's cut-offs, which removes the
cut-off parts first. A plate holding nothing but cut-offs became empty
for a moment, so the new-plate sentinel dropped a trailing plate while
the restore was still enumerating the plates, throwing "Collection was
modified". Regenerate inside a PlateManager batch so the sentinel only
settles once every plate is done.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Placement edits were only caught by the fingerprint safety net, so they
undid as an anonymous "Change" or folded into the next edit. Each now
records one labelled step: Fill (at the commit, so a stopped fill that
keeps nothing records nothing), Fill Area, Pattern Tile, Auto Nest (from
the kept proposal only; Make Nests tabs too), Clear Nest, Remove Empty
Plates and Center Parts. Clear Nest no longer warns that it cannot be
undone.
Pattern Tile onto a new plate created a plate beside the empty sentinel,
which the plate manager dropped at once, so the pattern landed on a
detached plate; it now fills the sentinel.
The undo tests share one harness that compares a text description of the
nest before an edit and after Undo.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whole-nest snapshots make undo safe without a hand-written inverse per
operation: each recorded edit stores one NestSnapshot in the document's
history, and Undo/Redo read one back and swap it into the open window.
- Document.History is reset with the opened nest; Save and database
saves mark the save point instead of clearing it.
- EditNestForm.BeginChange opens a scope: nested scopes merge into the
outermost, Complete commits one entry, and leaving it incomplete rolls
a changed nest back. No-ops are detected by the scope's changed flag,
not by comparing bytes (copies are not byte-stable).
- RestoreNest shares the per-nest binding with the constructor and keeps
the Document, the nest's identity, the plate index, the viewport and
the selection. It ends the action, closes Cutting Inspection, side
panels and the remnant viewer, rebuilds the PlateManager, reapplies
the view's cut-off settings and recolours the drawings, because each
of those holds or derives from the old nest's objects.
- An edit no scope recorded (Phase 3 sites) is detected by a cheap
fingerprint and committed as its own "Change" entry before a scope,
Undo or Redo, so it is never silently discarded; DEBUG builds also
warn about it on idle.
- Edit > Undo/Redo name the next entry. Ctrl+Z/Ctrl+Y/Ctrl+Shift+Z go
to focused text editors first, then to an action's own step-back
(Sequence by Path), then to the nest. They wait for jobs, fills,
background saves and busy actions, but not for a plain selection.
- Recorded: delete, drag, arrow nudges (coalesced), rotate, align,
push, expand spacing, add part (drop and clone), cut, add and remove
plate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>