mirror of
https://github.com/storytold/cadcraft.git
synced 2026-10-24 10:56:51 -06:00
* Programmatic undo/redo ends a running command first (#177) `undo` or `redo` run through engine.execute, MCP, the control channel or a script while an interactive command was still running (e.g. TEXT waiting for another line) swapped the drawing under that command. Interactive commands push their undo step only when they end, so `undo` popped the previous command's step instead: it removed the earlier geometry, dropped the running command's entities, and left the command running from a stale state. Both commands now first end the running command the way Esc does, exactly as Session::start already does for Cmd+Z, the menu and the command line. The command's work so far becomes one undo step, and `undo` then removes that step. Regression test: programmatic_undo_during_a_command_ends_it_first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Move test away from other PRs' hunks to avoid merge conflicts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>