Docs: every change made while a refusal is pending is kept
Paul ranks a lost edit worse than a flash. Until now only the paste that waited for its font was kept as its ProseMirror transaction; any other change made on the refused text, or on a change that could not be carried, was lost. Now every local change made while diverged is. Slides has the same change (oficina/slides feat/replay-while-diverged). - The editor view's dispatchTransaction applies each transaction with every one the plugins append and hands the state update to aroundDispatch, which, while diverged, holds the change as tr.before plus every step (transactions ySync makes to mirror Yjs, and ones that change nothing, are left alone). The font gate's run dispatches through the same path. - carry.mjs replays any entry whose own updates do not all integrate, the span recomputed against the rebuilt document each time, and falls back to what of the updates integrates when a replay cannot be made (never applying an entry of which nothing would). - The carried changes undo in the steps they were made in: the keeper stamps each entry, and the undo manager stops capturing where two were made further apart than its 500 ms window. Tests: carry.test.mjs (in the gate) gains Fable's general probe, a change that cannot be kept in the middle, the fallback and the undo grouping (the last two fail on b8dbbf7's module). TestEnginesEveryChangeWhileARefusalIsPendingIsKept runs fixtures/engines/diverged.mjs in Chromium and WebKit: mixed edits, typing on the refused text kept with more after it, and a change that cannot be kept in the middle; the sheet, one undo and the server. On b8dbbf7 the typing on the refused text is lost and one undo takes back every carried change, in both engines. TestAChangeOnARefusedOneIsNotPosted becomes TestChangesOnRefusedTextAreKeptWithoutIt: the two pastes after the refused words are now kept, once, on the sheet and the server (lost on b8dbbf7), the refused words on neither. Stacked on fix/carry-replay (b8dbbf7, #89), whose span fix it needs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 files changed,
+485
−72
AGENTS.md+27 −13fixtures/carry.mjs+47 −17fixtures/carry.test.mjs+80 −0fixtures/editor-entry.js+44 −12fixtures/engines/diverged.mjs+196 −0internal/docs/diverged_engines_browser_test.go+49 −0internal/docs/fonts_engines_browser_test.go+6 −1internal/docs/resync_browser_test.go+22 −15internal/docs/static/editor.279133e860986229.js+14 −0internal/docs/static/editor.7ff107f6ce88eea0.js+0 −14
AGENTS.mdLoading diff…
fixtures/carry.mjsLoading diff…
fixtures/carry.test.mjsLoading diff…
fixtures/editor-entry.jsLoading diff…
fixtures/engines/diverged.mjsLoading diff…
internal/docs/diverged_engines_browser_test.goLoading diff…
internal/docs/fonts_engines_browser_test.goLoading diff…
internal/docs/resync_browser_test.goLoading diff…
internal/docs/static/editor.279133e860986229.jsLoading diff…
internal/docs/static/editor.7ff107f6ce88eea0.jsLoading diff…