Repository navigation
Mark commented words on every page, whoever draws its margin - #6321
Merged
Merged
Conversation
A page that draws its own annotations (`data-annotations="page"`) got no word marks: the anchor paint, which marks commented words, previews their threads under the pointer and opens one on a press, came with the overlay renderer. It now runs on every page. A press on a page with no presentation opens the thread in the panel, and `o` hides the marks there as it does under Leaf's own margin. - anchor-paint.js, visual-mark-paint.js and annotation-layer.js move from annotation-overlay/ to runtime/, since core now imports them; leaf.js builds the anchor paint unconditionally, so it is no longer nullable in application.js and thread/presentation.js. - The passage highlights and the hand over a mark move from the overlay-only annotation-marks.css and annotation-chrome.css into marks.css, which every page and shadow stage adopts. The second overlay sheet, `annotationMarkSheets` and their delivery go. - The `o` command's `when: watchers.size > 0` goes: the anchor paint watches the layer on every page.
…d where the anchor paint now lives
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.
On a page that draws its own annotations (
data-annotations="page"), commented words got no marks, because the anchor paint, which marks them, previews their thread under the pointer and opens it on a press, came with the overlay renderer. It now runs on every page, so on such a page pointing at commented words previews the thread and a press opens it in the panel. Core gets smaller, by a net 21 lines of code:anchor-paint.js,visual-mark-paint.jsandannotation-layer.jsmove out ofannotation-overlay/(about 30 lines each way are path changes), the overlay-only mark stylesheet and its delivery go, and the anchor paint is no longer nullable.To weigh. Page-mode pages now load three more modules before the page shows the server's state:
anchor-paint.js(37 KB),visual-mark-paint.js(1.8 KB) andannotation-layer.js(3.3 KB). In a trial on #6161's branch the first two cost no main-thread time separable from noise over ten interleaved rounds; this branch's startup wasn't measured.onow also hides the word marks on page-mode pages. Pages with Leaf's own margin are unchanged:leaf-dev stills --base mainshows no changed pixels in 18 margin and comment-mark states in Chromium and 8 in Firefox.max-sixty asked on a decision page to test this answer to "who reads pointing at commented words on a page that draws its own margin", and to land changes there only where they make the code simpler.
Tests:
pnpm run check(1008 runtime tests); 34 browser and journey test functions (61 cases) on page mode, the mark stylesheets, the annotation layer,oand the hand cursor; behavior probes in Chromium and Firefox, the long press in Chromium only.