Skip to content

feat: add undo/redo system (Ctrl+Z/Y)#22

Open
JWBWork wants to merge 1 commit intoraycastly:masterfrom
JWBWork:feature/ctrl-z
Open

feat: add undo/redo system (Ctrl+Z/Y)#22
JWBWork wants to merge 1 commit intoraycastly:masterfrom
JWBWork:feature/ctrl-z

Conversation

@JWBWork
Copy link
Copy Markdown

@JWBWork JWBWork commented Apr 10, 2026

Summary

  • Adds a command-pattern undo/redo stack with batch support for compound operations (e.g. multi-file drag-drop)
  • Tracks all canvas mutations: image add/delete/move/transform, polygon add/delete/move, vertex/midpoint drag, texture drag/transform/flip, atlas auto-pack
  • Uses stage-level drag events for reliable tracking through Konva's Transformer

Test plan

  • Ctrl+Z undoes each action type (add image, move image, add rect, move rect, drag vertex, etc.)
  • Ctrl+Shift+Z / Ctrl+Y redoes
  • Undo works while an object is still selected (transformer visible)
  • Dropping multiple images at once undoes as a single action

🤖 Generated with Claude Code

- Command-pattern undo stack with batch support for compound operations
- Track all mutations: image add/delete/move/transform, polygon
  add/delete/move, vertex/midpoint drag, texture drag/transform/flip,
  atlas auto-pack
- Stage-level drag events for reliable image move tracking
- tr.forceUpdate() in all undo callbacks for visual consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JWBWork
Copy link
Copy Markdown
Author

JWBWork commented Apr 10, 2026

heads up, we might want to merge this after other open feature branches

at least one of the other branches I opened would benefit from an undo function. probably best to merge those in and
I'll update this PR to make sure ctrl-z functions with those other features

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.

1 participant