Slides: 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. - stage.mjs's bindView takes a dispatchTransaction that applies the transaction with every one the plugins append and hands the state update to the editor's 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 aroundRun goes: its run dispatches through the same path. - carry.mjs replays any entry whose own updates do not all integrate, the span recomputed against the rebuilt text 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 gains Fable's general probe (five mixed changes, nothing lost, page and server the same), a change that cannot be kept in the middle, the fallback and the undo grouping (the last two fail on 10fcbf7's module). TestEnginesEveryChangeWhileARefusalIsPendingIsKept runs fixtures/engines/diverged.mjs in Chromium and WebKit: mixed edits (typing on the refused text, a paste elsewhere, a delete across server, refused and new words, typing elsewhere), typing on the refused text kept with more after it, and a change that cannot be kept in the middle; the page, one undo and the server. On 10fcbf7 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 page and the server (lost on 10fcbf7), the refused words on neither. Stacked on fix/carry-replay (10fcbf7, #28), whose span fix it needs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 files changed,
+500
−105
AGENTS.md+24 −11fixtures/carry.mjs+47 −17fixtures/carry.test.mjs+80 −0fixtures/editor-entry.js+42 −29fixtures/editor-fonts.mjs+5 −5fixtures/engines/diverged.mjs+194 −0fixtures/stage.mjs+15 −5internal/slides/credits/assets.json+1 −1internal/slides/static/{editor.596eb5f31695119e.js => editor.2f3aa24d34e03902.js}+15 −15internal/slidestest/diverged_engines_browser_test.go+48 −0internal/slidestest/fonts_engines_browser_test.go+7 −0internal/slidestest/races_browser_test.go+22 −22
CI passed — run details
AGENTS.mdLoading diff…
fixtures/carry.mjsLoading diff…
fixtures/carry.test.mjsLoading diff…
fixtures/editor-entry.jsLoading diff…
fixtures/editor-fonts.mjsLoading diff…
fixtures/engines/diverged.mjsLoading diff…
fixtures/stage.mjsLoading diff…
internal/slides/credits/assets.jsonLoading diff…
internal/slides/static/{editor.596eb5f31695119e.js => editor.2f3aa24d34e03902.js}Loading diff…
internal/slidestest/diverged_engines_browser_test.goLoading diff…
internal/slidestest/fonts_engines_browser_test.goLoading diff…
internal/slidestest/races_browser_test.goLoading diff…