docs/plans/2026-03-09-slate-phase-1-execution.md
Implement the phase-1 @platejs/slate upstream-pull plan with fast, dense Bun tests that cover real Plate wrapper behavior.
slate-history behavior where cheap.bun test packages/slate: pass, 395 testsbun test --coverage --coverage-reporter=lcov --coverage-dir=/tmp/slate-coverage packages/slate: passpackages/slate/src coverage from lcov: 100.00% funcs, 96.97% linesdeleteTextmoveSelectioncollapseSelectioninsertSoftBreakdeleteBackwarddeleteForwardinsertNoderemoveEditorMarkshouldMergeNodesaddMarksdeleteMergelocation-refpropnodesRangeisEditorEndscrollIntoViewabovegetMarksgetEditorStringnext, previous, history, with-history, isAt, match, mergeNodes, and setNodes coverage with upstream-derived and Plate-specific cases.isEmptytoggleMarkdeleteMerge inline-void boundary nudgingmergeNodes range deletion, void merging, and early returnsnodes universal and non-selectable traversal semanticsisAt default-false boundary behaviorgetPointBefore invalid-location and block-start fallback behaviorpackages/slate/test/interfaces/Editor/above/*
packages/slate/src/internal/editor/above.spec.tsxpackages/slate/test/interfaces/Editor/marks/*
packages/slate/src/internal/editor/getMarks.spec.tsxpackages/slate/test/interfaces/Editor/string/*
packages/slate/src/internal/editor/getEditorString.spec.tsxpackages/slate/test/interfaces/Editor/next/{default,text}
packages/slate/src/internal/editor/next.spec.tsxpackages/slate/test/interfaces/Editor/previous/{default,text}
packages/slate/src/internal/editor/previous.spec.tsxpackages/slate-history/test/isHistory/*
packages/slate/src/slate-history/history.spec.tsx with direct undo/redo delegation coveragepackages/slate/test/interfaces/Editor/isEmpty/{block-void,inline-full}
packages/slate/src/internal/editor/isEmpty.spec.tsxpackages/slate/test/transforms/mergeNodes/voids-true/block.tsx
packages/slate/src/internal/transforms/mergeNodes.spec.tsxpackages/slate/src/internal/editor/isEmpty.ts
94.83% linespackages/slate/src/internal/editor-extension/prop.ts
95.24% linespackages/slate/src/internal/editor/getFragment.ts
96.55% linespackages/slate/src/utils/queryNode.ts
96.97% linesinternal/dom-editor/*
deleteMerge still had real custom coverage holes even though deleteText was already well-covered; testing the exported helper directly was worth it.scrollIntoView is easy to cover without browser tests by mocking scroll-into-view-if-needed and forcing requestAnimationFrame / setTimeout synchronous in Bun.setNodes({ marks: true }) on a collapsed plain-text selection falls through to regular setNodes, so the tested behavior is block-level property application, not a no-op.mergeNodes only hits the mixed-kind throw when the match narrows the current node to the inline element itself, for example with mode: 'highest'.unknown even though the runtime bindings are valid.lcov is the only trustworthy number for packages/slate/src.Editor.string void-block behavior did not carry over as a stable local contract in this runtime. The safe local contract is direct block-path stringing plus invalid-location fallback, not the upstream void expectation.location-ref, toggleMark, mergeNodes, and deleteMerge were all worth another pass. They looked “good enough” in the summary table and still had easy, meaningful custom branches left on the floor.