Skip to content

test: anchor comments on diff and text-document words on their datum, as capture writes them - #5884

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-5882
Nov 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-5882

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Since #5570, an anchor that carries a quote but no datum is searched only in the frame, the page's reading with each datum part left out. Diff lines and a text document's words are datums, so the two tests in #5882 lost their mark. Neither producer writes that anchor any more. Browser capture gives words in one datum a datum anchor, and captures a non-datum quote over part words as detached (anchor-resolution.js). leaf thread create --quote refuses words in a data widget's body ("§ doc holds no quotable text…", and "the page doesn't say …" for the diff line). Only the tests, which write the log directly, still seeded the old shape.

So the tests now seed the anchor capture writes: {section: "how-patch", datum: '["gateway/limits.py","new",2]', quote} and {section: "doc", datum: "document", identity: "document", quote}. I read these keys off the rendered widgets. The behavior each test protects is unchanged. A passage a widget draws into its shadow tree is marked inside that tree. Its thread sorts where the widget stands. Hiding annotations gives the words their syntax colour back.

Verification on Linux:

  • test_a_thread_on_words_a_widget_renders_stands_where_the_widget_does fails on main ("the fixture's passage is not marked inside a shadow tree") and passes here.
  • test_o_gives_marked_words_their_own_colours_back[browser] times out on main at the lf-mark wait and passes here. Its Firefox and WebKit variants pass here too.

The fix keeps #5570's design, in which a quote in a datum is found in that datum alone. It doesn't add a frame-then-parts fallback for datum-less quotes, which would bring back the whole-page reads #5570 removed, for an anchor shape nothing writes.

Closes #5882 — automated triage

…e writes them

Since #5570, the page's reading is kept by part: each datum is read
alone, and the frame leaves the parts out. A quote with no datum is
searched in the frame only. Capture keeps to that. In the browser, words
in one datum get a `datum` anchor, and a non-datum quote over part words
is captured `detached` (anchor-resolution.js, `anchorForPassage`).
`leaf thread create --quote` refuses words in a data widget's body. So
neither producer writes `{section, quote}` or a bare `{quote}` over a
diff line or a text document's words.

Two tests seeded that shape directly into the log and lost their mark:
`test_a_thread_on_words_a_widget_renders_stands_where_the_widget_does`
and `test_o_gives_marked_words_their_own_colours_back`. They now seed
the datum anchor capture writes: `["gateway/limits.py","new",2]` on
`#how-patch`, and `document` on `#doc`. The behavior they protect is
unchanged. Words a widget draws into its shadow tree are marked there.
The thread sorts where the widget stands. Hiding annotations gives the
words their syntax colour back.

Closes #5882
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.

Comments on words inside a widget's shadow tree lose their lf-mark highlight since #5570

2 participants