fix(undo): grip-drag history entry + mid-command Ctrl+Z steps (#332)

Grip drags mutated the document without ever pushing history — dragging
a polyline vertex (or any grip) could not be undone. The release-commit
now swaps the pre-drag backup in, snapshots that PRE state as a "GRIP"
entry, swaps the dragged result back and clears the redo stack; the
Esc-cancel path is unchanged and a no-move engaging click records
nothing.

Ctrl+Z during a drawing command steps the command instead of the
document undo swallowing the in-progress object (which also killed the
active command): new CadCommand::on_undo_step hook, consulted before
undo_active_tab. PLINE pops its last vertex (shared with the U option),
LINE reverts the last committed segment and keeps drawing from the
previous point (rides its existing U/UndoDocument path), and ARC
Continue reverts the last arc and resumes from the prior anchor with
the correct tangent via a new anchor history. With nothing placed yet
each falls through to the document undo.

Also drops the two warnings the #336 work left behind (unused Entity
import, dead Snapper::override_active).

Closes #332

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Fable 5 committed 2026-07-22 15:48:22 +03:00
1 parent 9b40881ab1
commit 9b28170d4b
8 files changed
+109 -34

No files matched your search

-1
View File
@@ -2393,7 +2393,6 @@ fn fence_pieces(
window: Option<[[f64; 2]; 2]>,
extend: bool,
) -> Option<Vec<EntityType>> {
use acadrust::entities::Entity as _;
// Sentinel handle: keeps the self-exclusion in *_seg_ts from matching any
// real boundary geo while the piece is being re-picked.
const TMP: u64 = u64::MAX - 7;