docs/plans/2026-05-28-pagination-burst-typing-performance.md
Objective:
Fix virtualized pagination fast typing so burst input in the middle of
/examples/pagination preserves every typed character and stays responsive on
the real rich-markdown stress document.
Completion threshold:
Verification surface:
PLAYWRIGHT_RETRIES=0 bun playwright playwright/integration/examples/pagination.test.ts --project=chromium -g "keeps fast burst typing" --reporter=linePLAYWRIGHT_RETRIES=0 bun playwright playwright/integration/examples/pagination.test.ts --project=chromium -g "keeps middle-document typing responsive" --reporter=linebun test ./packages/slate-react/test/dom-repair-policy-contract.tscd packages/slate-react && bun test:vitest test/input-router-contract.test.tsxbun --filter slate-react typecheckbun typecheck:sitebun lint:fixConstraints:
Boundaries:
/Users/zbeyens/git/plate-2/.tmp/slate-v2./Users/zbeyens/git/plate-2/docs/plans./examples/pagination, DOM strategy virtualized.Blocked condition: Stop only if burst typing cannot be reproduced or no code-owned repair path remains. This did not happen.
Start Gates:
| Gate | Applies | Evidence |
|---|---|---|
| Skill analysis before edits | yes | Used performance and debug; root cause investigation before fix. |
| Active goal checked or created | yes | Created active goal for virtualized pagination burst typing. |
| Source of truth read before edits | yes | User reported fast typing still slow and skipping chars. |
| Browser route identified | yes | /examples/pagination with DOM strategy virtualized. |
| TDD decision | yes | Added failing burst Playwright repro before repair changes. |
| Release artifact decision | yes | Existing pagination typing changeset covers slate-react behavior change. |
| PR expectation | no | N/A: no PR requested. |
| Tracker sync | no | N/A: chat-only report. |
Work Checklist:
Completion Gates:
| Gate | Applies | Required action | Evidence |
|---|---|---|---|
| Bug reproduced before fix | yes | Run focused burst proof | Failed with text Release arcdeeghajklmdopiness memo, proving skipped/reordered chars. |
| Targeted behavior verification | yes | Run burst proof after fix | Passed. |
| Previous latency proof | yes | Rerun existing middle typing proof | Passed. |
| TypeScript changed | yes | Run relevant typecheck | bun --filter slate-react typecheck and bun typecheck:site passed. |
| Lint | yes | Run formatter/lint fix | bun lint:fix passed. |
| Package behavior changed | yes | Changeset | Covered by existing pagination typing changeset. |
| PR create or update | no | N/A | No PR requested. |
Phase / pass table:
| Phase | Status | Evidence | Next |
|---|---|---|---|
| Reproduce | complete | Burst Playwright row failed before fix. | root cause |
| Root cause | complete | Deferred repair replayed old individual input events against later DOM selection and caret repair fought live typing. | implementation |
| Implementation | complete | Debounced virtualized native text repair and imported current DOM/model delta once. | verification |
| Verification | complete | Focused browser/unit/type/site/lint checks passed. | closeout |
| Closeout | complete | Plan recorded. | final |
Findings:
Release arcdeeghajklmdopiness memo.Performance:
keyboard.type(..., { delay: 0 }).Implementation notes:
input-router debounces deferred native text repair for virtualized insert
text bursts and coalesces pending repairs.dom-repair-queue imports the current DOM text delta relative to the Slate
text instead of trusting the stale single-character InputEvent.data.Verification evidence:
PLAYWRIGHT_RETRIES=0 bun playwright playwright/integration/examples/pagination.test.ts --project=chromium -g "keeps fast burst typing" --reporter=line
failed with missing/reordered chars.PLAYWRIGHT_RETRIES=0 bun playwright playwright/integration/examples/pagination.test.ts --project=chromium -g "keeps fast burst typing" --reporter=line
passed.PLAYWRIGHT_RETRIES=0 bun playwright playwright/integration/examples/pagination.test.ts --project=chromium -g "keeps middle-document typing responsive" --reporter=line
passed.bun test ./packages/slate-react/test/dom-repair-policy-contract.ts passed.cd packages/slate-react && bun test:vitest test/input-router-contract.test.tsx passed.bun --filter slate-react typecheck passed.bun typecheck:site passed.bun lint:fix passed.Final handoff contract:
Reboot status: Complete. Dev server remains the live manual verification surface.
Open risks:
Timeline: