Skip to content

Mark commented words on every page, whoever draws its margin - #6321

Merged
max-sixty merged 2 commits into
mainfrom
words-on-main
Nov 17, 2026
Merged

max-sixty merged 2 commits into
mainfrom
words-on-main

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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.js and annotation-layer.js move out of annotation-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) and annotation-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. o now also hides the word marks on page-mode pages. Pages with Leaf's own margin are unchanged: leaf-dev stills --base main shows 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, o and the hand cursor; behavior probes in Chromium and Firefox, the long press in Chromium only.

This was written by Claude Code on behalf of max-sixty

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.
@max-sixty
max-sixty merged commit 84d846b into main Nov 17, 2026
5 checks passed
@max-sixty
max-sixty deleted the words-on-main branch November 17, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants