feat(editor): add offscreen block skeletons - #37
Draft
srubin wants to merge 3 commits into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-visibilityavoids 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
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 passedtsc --noEmit --types node,jest,react,react-domeslint src/.Vite production library build completed successfully; its declaration plugin continues to report the existing
globalThis.__DEV__diagnosticsIntegrated against the Descript web app with
WEB_NODE_ENV=productionandREACT_COMPILER=trueI used AI