Skip to content

fix(undo): atomic batch undo for multi-shape operations#61

Merged
eugenioenko merged 1 commit into
mainfrom
fix/batch-undo-delete
May 12, 2026
Merged

fix(undo): atomic batch undo for multi-shape operations#61
eugenioenko merged 1 commit into
mainfrom
fix/batch-undo-delete

Conversation

@eugenioenko
Copy link
Copy Markdown
Owner

Summary

  • Add "batch" CommandType that wraps multiple sub-commands into a single undo/redo step
  • Multi-delete, multi-paste, and duplicate now use batch commands so Ctrl+Z reverses the entire operation at once
  • Batch inverse commands reverse sub-command order for correct undo semantics
  • Single-shape operations still use individual commands (no overhead)

Test plan

  • pnpm build passes
  • pnpm lint passes (0 errors)
  • New e2e test: draw 3 shapes, select all, delete, single Ctrl+Z restores all 3, single Ctrl+Shift+Z re-deletes all 3
  • Manual: multi-select 2+ shapes, delete, verify single undo restores all
  • Manual: copy 2+ shapes, paste, verify single undo removes all pasted
  • Manual: select 2+ shapes, Ctrl+D to duplicate, verify single undo removes all duplicates

Fixes #46

🤖 Generated with Claude Code

Add "batch" CommandType that wraps multiple sub-commands into a single
undo step. Multi-delete, multi-paste, and duplicate now use batch
commands so Ctrl+Z reverses the entire operation at once instead of
one shape at a time.

Fixes #46

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@eugenioenko eugenioenko merged commit ed6caa6 into main May 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-delete is not a single undo step

1 participant