[w3c/editing] undo manager (#209)

It has been proposed to give JavaScript a way to manipulate the browser's undo stack [1]. I think it would be useful for JavaScript editors if in addition to what the explainer [2] mentions, it can handle two situations:

1. **Collaborative editing:** User A (local) and user B (remote) are collaborating on a document that contains two paragraphs. User A writes 2 words in paragraph one. The size of the undo stack is 2. User A writes 3 more words in paragraph two.  The size of the undo stack is now 5. User B deletes paragraph two. The size of the undo stack should now be 2 (the two words in paragraph one). Ideally: If user B now undoes the deletion of paragraph two, the size of the undo stack should be 5 again.

2. **Separate undo stacks for specific elements controlled by JS:** Many editors accept text input in other places than in the main editor. This can for example be in a dialog box that is presented as a layover (see below). While the focus is on any text input element in there, the user should not accidentally be changing the text in the main editor by hitting the undo key combination. 

![Untitled document - Google Docs](https://user-images.githubusercontent.com/595512/64911350-f2909e00-d720-11e9-8ce1-d15bdd68cfd6.png)


[1] https://rniwa.github.io/undo-api
[2] https://whsieh.github.io/UndoManager

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/209

Received on Saturday, 14 September 2019 16:58:52 UTC