Bring back the undo feature
Author: eptCreated Feb 11, 2021Updated Feb 3, 2023
For the Automerge 1.x release series we have removed the undo/redo feature, since the old implementation was a hack that didn't work very well and that we didn't want to support long-term. However, undo remains a useful feature, and this issue is our task to bring it back, done properly this time.
Some ideas for things to keep in mind when designing the new undo:
- By default, Ctrl-Z-style undo should only undo changes made by the local user (we may want a separate "revert" feature for undoing other users' changes).
- Undo history should persist even when a document is saved to disk and later loaded back into memory. However, saving and reloading by default changes the actorId — how do we identify the changes made by the local user?
- Have a way of excluding certain updates from the change history. For example, in a Jupyter notebook, the CRDT may contain both user input (source code, text) and machine-generated output (the result of running a piece of code). When the machine-generated output is updated, we may not want to record that in the undo history, allowing the undo history to focus on the user input only.
- Have sensible handling of move operations (see #247)
- Figure out desired behaviour when a mixture of text insertions and deletions are undone (see #216)
Source: automerge/automerge-classic