mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-27 13:51:06 -04:00
Undo will keep whole-nest states and restore by reading one back. NestSnapshot.Capture writes the same archive a save writes, with three differences Phase 0 found necessary: it does not stamp DateLastModified on the live nest, it leaves best fits out (they are a cache), and it keeps empty plates, which files drop, so an undo does not shift plate indices or lose a plate the user added. File output is unchanged. Restore reuses each live drawing whose saved content is unchanged, matched by a fingerprint over its nest.json entry, program, hole sub-programs and source entities. BestFitCache and FillResultCache are keyed by the Drawing object, so a plain read would make the next fill recompute every best-fit pair; reuse keeps those caches, colours and Drawing.Id, and skips parsing the reused programs. Nested counts are recomputed for the restored nest, and given back to the live one if the read fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>