Repository navigation
Paint the draft's mark from the ranges placement keeps of it - #6322
Merged
Merged
Conversation
Placement kept live ranges for a thread's passage, reused across readings that move nothing, but the draft's anchor came back without them, so `paintPending` built a `Range` for each segment of the draft's passage on every paint. Placement now resolves the draft as it does a thread (`placePending`, over `liveRanges`), and the anchor paint reads those ranges, so a thread's mark and the draft's come from one record. What the page shows doesn't change. A runtime test holds that placement gives a thread's passage and the draft's a range over their words and keeps the same ranges across a reading that moves nothing; with the draft's ranges dropped it fails.
leaf-agent
approved these changes
Nov 17, 2026
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.
Placement already kept live ranges for each thread's passage, reused across readings that move nothing, but the draft's anchor came back without them. So
paintPendingbuilt its ownRangefor each segment of the draft's passage on every paint. Now placement resolves the draft the same way it resolves a thread (placePending, overliveRanges), and the anchor paint reads those ranges. Building a passage's ranges now has one home instead of two, and the page looks the same. Code is net +3 lines; a runtime test (+45) holds that placement keeps the draft's ranges, and it fails with them dropped.This comes from #6161, which max-sixty is leaving unmerged because it adds code. He asked to land the parts that make main simpler and better. The other standalone part of #6161, a fix for a contributed control redrawn disabled, isn't here: main has no surface that releases a control and takes it back up, and no reproduction found one.
Tests:
pnpm run check(1011 runtime tests), and the 19 browser test functions that read the draft's mark plus two on anchors and contributed controls (29 cases).