w3c / w3c/editing

undo manager

Open
#209 22 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
202
Forks
43
PR merge metrics
No merged PRs in 30d

Description

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

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Undo API explainer at https://rniwa.github.io/undo-api and the UndoManager explainer at https://whsieh.github.io/UndoManager. Compare their behavior with the collaborative-editing and separate-element undo-stack scenarios described here. Done would require an agreed design or specification change that addresses both cases; this issue names no implementation files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.