oficina / mapa Public

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>
Paul Campbell pushed by paul@keymail.dev 766a4017bd1815e1c17463a1023b65fe946b7090 parent 1ea4be9
6 files changed, +69 −38
  • editor/commands.mjs +20 −0
  • editor/keys.mjs +4 −5
  • editor/page.mjs +3 −3
  • editor/serialize.test.mjs +12 −0
  • internal/mapa/credits/assets.json +1 −1
  • internal/mapa/static/{editor.8285c9bf8c8e3555.js => editor.822bf0c12578e3c5.js} +29 −29
editor/commands.mjs

Loading diff…

editor/keys.mjs

Loading diff…

editor/page.mjs

Loading diff…

editor/serialize.test.mjs

Loading diff…

internal/mapa/credits/assets.json

Loading diff…

internal/mapa/static/{editor.8285c9bf8c8e3555.js => editor.822bf0c12578e3c5.js}

Loading diff…