Editor: undo and redo are guarded against prosemirror's throw
Fable's final review of 58fd476, a Low. After many edits an undo step
that sets a block's attribute can be mapped onto a text node, and
prosemirror-transform throws ("NodeType.create can't construct text
nodes", "Position N out of range") instead of failing the step: seen
again here fuzzing L3 with other seeds and 40 steps. ⌘Z, ⌘⇧Z, ⌘Y and
the Edit menu now run guarded(): the step is refused, the text and
what is saved are untouched, and nothing is thrown out of a key.
The root, settle's origin steps being in undo history, is a build note.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 files changed,
+69
−38
editor/commands.mjs+20 −0editor/keys.mjs+4 −5editor/page.mjs+3 −3editor/serialize.test.mjs+12 −0internal/mapa/credits/assets.json+1 −1internal/mapa/static/{editor.8285c9bf8c8e3555.js => editor.822bf0c12578e3c5.js}+29 −29
editor/commands.mjsLoading diff…
editor/keys.mjsLoading diff…
editor/page.mjsLoading diff…
editor/serialize.test.mjsLoading diff…
internal/mapa/credits/assets.jsonLoading diff…
internal/mapa/static/{editor.8285c9bf8c8e3555.js => editor.822bf0c12578e3c5.js}Loading diff…