Skip to content

feat(editor): add offscreen block skeletons - #37

Draft
srubin wants to merge 3 commits into
main-pojofrom
codex/script-block-skeleton
Draft

feat(editor): add offscreen block skeletons#37
srubin wants to merge 3 commits into
main-pojofrom
codex/script-block-skeleton

Conversation

@srubin

@srubin srubin commented Jul 25, 2026

Copy link
Copy Markdown

Summary

Adds an Editor-owned block skeleton mode that keeps every Draft block addressable while rendering offscreen contents as raw text instead of the full decorator and leaf tree. Visible, selected, and explicitly pinned blocks continue to render normally, and decorators can opt specific DOM attributes into skeleton output.

This is intended for very large documents where content-visibility avoids paint work but the retained decorator DOM is still expensive. Newly inserted block keys can render directly as skeletons instead of forcing a render-all measurement frame.

Pre-merge follow-up

  • Fix intermittent “jump to playhead” behavior when block skeleton mode is enabled, and verify navigation to the playhead before merging.

Test Plan

  • NODE_ENV=test jest --no-watchman --runInBand src/component/contents/__tests__/DraftEditorContents.react-test.tsx src/component/base/__tests__/DraftEditor.react-test.tsx — 12 tests passed

  • tsc --noEmit --types node,jest,react,react-dom

  • eslint src/.

  • Vite production library build completed successfully; its declaration plugin continues to report the existing globalThis.__DEV__ diagnostics

  • Integrated against the Descript web app with WEB_NODE_ENV=production and REACT_COMPILER=true

  • I used AI

@srubin srubin self-assigned this Jul 25, 2026
Native browser selection stops at contentEditable boundaries, so skeletonized editors could select only the current rendered block. Build the full-editor selection in Draft while leaving custom key bindings in control.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant