Repository navigation
test: anchor comments on diff and text-document words on their datum, as capture writes them - #5884
Merged
Merged
Conversation
…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
This was referenced Nov 13, 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.
Since #5570, an anchor that carries a quote but no
datumis 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 adatumanchor, and captures a non-datum quote over part words asdetached(anchor-resolution.js).leaf thread create --quoterefuses 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_doesfails 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 thelf-markwait 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