Conversation
An edit can take several steps: Enter inside a run shortens the run, puts its tail beside it and splits the paragraph. `undo()` and `redo()` took one step at a time, so one edit needed several undos, and the page showed states between the steps that the reader never made. Decision 6 of `docs/design/document-editing.md` says that one `beforeinput` is one undo step. Each way into the editor, `beforeinput`, `compositionend` and `format()`, now opens a gesture, and every step it performs carries that gesture. `undo()` and `redo()` take all steps of the top gesture. The operation log does not change. The browser checks expected the extra steps after a split. They now expect one step, and two new checks pin that redo replays the split whole and that two edits stay two steps. 174 checks, 0 failed. Closes #903. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LosSkagYUDarkPra2pGTnP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #903.
An edit in the document view's editor can take several steps. Enter inside a run shortens the run, puts its tail beside it and splits the paragraph.
undo()andredo()took one step at a time, so one edit needed several undos, and the page showed states between the steps that the reader never made. Decision 6 ofdocs/design/document-editing.mdsays that onebeforeinputis one undo step.Each way into the editor,
beforeinput,compositionendandformat(), now opens a gesture, and every step it performs carries that gesture.undo()andredo()take all steps of the top gesture. The operation log that a save reads does not change.A first version closed a gesture with a microtask. That merged edits that a script sends one after another in one task, as the browser checks and a host can do, so the gesture now opens explicitly at each way in.
test/browser/text/tests.htmlexpected the extra steps after a split. It now expects one step, and two new checks pin that redo replays the split whole and that two edits stay two steps. Run by hand in Chrome: 174 checks, 0 failed. Changelog entry added.🤖 Generated with Claude Code
https://claude.ai/code/session_01LosSkagYUDarkPra2pGTnP