When Ctrl + Z is pressed, behavior must be well-defined. In the current case, text from the initial sync is removed with undo, which may come in with a different order, so very old changes are most likely the first to be undone. For the average user, this makes no sense. Since timestamps cannot be trusted, establishing order of undo operations would be difficult. I'm considering the following approaches:
Establishing order in the DAG based on event depth (complicated)
Also leaves the ambiguous case of multiple events with the same depth. What then?
Only allow undoing of changes that happen while the user has the editor open
Only allow undoing of local changes made by the current user (may make more sense for UI/UX)
I think that it would be best to base undo history off of whatever edits the user has made. I do not think that it would be a good idea to allow undoing of other user's operations.
When Ctrl + Z is pressed, behavior must be well-defined. In the current case, text from the initial sync is removed with undo, which may come in with a different order, so very old changes are most likely the first to be undone. For the average user, this makes no sense. Since timestamps cannot be trusted, establishing order of undo operations would be difficult. I'm considering the following approaches: