Docs: carry counts a partly-applied delete, maps past an overlap, and keeps each change on its own id
Claude Fable's review of #89 at b48dad3: three P1s, the same module as Slides' (oficina/slides fix/carry-replay, 10fcbf7). - A delete range can take in part: Yjs deletes up to the doc's state for its client and holds the rest pending. took() counted such a range as not taken, so a Backspace over this tab's saved and refused words together deleted on the sheet and posted nothing. It now counts the applied part. - replaySteps clamped the two ends of an overlapping diff to its start, giving an empty span, and a replayed paste landed a letter off. Both ends now move past the overlap, as prosemirror-view's findDiff does. - One change held back held back every later one (Yjs's per-client clock order). The keeper (carry.mjs's createKeeper, replacing editor-entry's keep) gives the document a fresh client id after every change while diverged. Tests, each failing on b48dad3: carry.test.mjs gains Fable's three cases; carry_browser_test.go holds the three in the real editor (a Backspace over "cx", an "r" typed into "par|agraph" with the paste right after it, and a clean paste after a held-back keystroke in both orders; the clean-first order passes on b48dad3 and stays as a guard). AGENTS.md and carry.mjs's header state the range rule and the per-change id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 files changed,
+390
−57
AGENTS.md+12 −7fixtures/carry.mjs+65 −12fixtures/carry.test.mjs+91 −1fixtures/editor-entry.js+11 −23internal/docs/carry_browser_test.go+197 −0internal/docs/static/editor.7ff107f6ce88eea0.js+14 −0internal/docs/static/editor.afc9783241f3cb54.js+0 −14
CI passed — run details
AGENTS.mdLoading diff…
fixtures/carry.mjsLoading diff…
fixtures/carry.test.mjsLoading diff…
fixtures/editor-entry.jsLoading diff…
internal/docs/carry_browser_test.goLoading diff…
internal/docs/static/editor.7ff107f6ce88eea0.jsLoading diff…
internal/docs/static/editor.afc9783241f3cb54.jsLoading diff…