feat: add block windowing support#36
Draft
srubin wants to merge 5 commits into
Draft
Conversation
2c46c8f to
8fdca30
Compare
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 opt-in block windowing while keeping the generic lifecycle and DOM protocol inside the Draft fork:
useDraftEditorBlockWindowingowns measurement, resize invalidation, viewport/overscan calculation, selection-endpoint pinning, and consumer-supplied pinned block keys.DraftEditorreplaces omitted runs with inert height spacers while preserving custom block elements and wrapper runs across window seams.Also bumps the package to
0.11.6-descript.35for the dependent Descript PR.Dependent PR: https://github.com/descriptinc/descript/pull/36590
Test plan
mise exec node@20 -- pnpm exec jest --runInBand --no-watchman src/component/hooks/__tests__/useDraftEditorBlockWindowing-test.ts src/component/contents/__tests__/getDraftEditorWindowedTextOffset-test.ts src/component/contents/__tests__/DraftEditorContents.react-test.tsx(14 tests pass)mise exec node@20 -- pnpm buildcompletes and emits the new declarations.The focused tests cover window-range math, stable measurement equality, hook lifecycle and pinning, structural edits with height-only resize notifications, spacer offset mapping, and custom wrapper continuity. Repository-wide declaration checking still reports the fork's existing Node-global and old TypeScript lib-target warnings in unrelated files.