Skip to content

Undo/redo module #33

Description

@bart-krakowski

Parent

#25

What to build

Extract undo/redo into a proper module that wraps atomic write batches, not individual field mutations. A single user action (e.g. move event + cascaded dependent shifts) is undone as one step — not as a sequence of individual commits.

Acceptance criteria

  • `UndoRedoModule` plugs into the kernel via the module API (Kernel + module registration API #28), hooking the `undo-snapshot/emit` stage of the write pipeline
  • `undo()` reverses the most recent atomic batch (all events in the batch revert together)
  • `redo()` re-applies a reversed batch
  • `canUndo()` / `canRedo()` reflect the current stack state reactively
  • A dependency cascade (move + N propagated dependents) is treated as one batch — one `undo()` call reverses it entirely
  • Removing the `UndoRedoModule` causes undo/redo code to tree-shake out of the bundle

Blocked by

#28

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions