mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-29 04:36:47 -06:00
The active layer lives on DocState, outside the undo snapshots, and nothing re-checked it when the document's layers changed. After New Layer → Undo (or Delete Layer / Delete Unused Layers / Merge Layers on the active layer) it kept pointing at a layer that no longer exists, and every object created next (frames, lines, placed images, pasted items) was put on that phantom layer: not drawn on the canvas, missing from PDF export, ItemLayer referencing an undefined layer in IDML, and preflight reported nothing. After each command, if the active layer is gone, make the top layer active (as on opening a document). Test: active_layer_survives_undoing_new_layer. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>