Repository navigation
Thread and age previews, and passage marks that follow their words as the page changes - #5618
Merged
Merged
Conversation
…ered
With a comparison on (`v`, or a Compare in Versions), the ⇄ entry's label
said what a change did, "1 paragraph edited since v1", but not why. Under
that line it now says where the change landed and what the revision that
made it answered, with the opening line of each message the user wrote:
1 paragraph edited since v1
In v2, answering your comment:
“Why ship with that?”
A change made once every comment was answered says *In v3, answering
none of your comments*; one made while a comment waits for its answer
says *In Draft, after your comment:*, which becomes *answering* once the
agent answers it. A change several revisions made for different things
says each in turn. The headings are Leaf's, in its italic; the quotes are
the user's words. The `h` walk says the same to a listener after the
walk's position. A change of state alone, such as a pick, has no line.
**Derived once, in Python (`provenance.py`).** The log never links a
revision to the reply it answers: a tab reading the page activates each
save as a revision with no event naming it, so `publication` is on 7 of
the 184 answers in this month's page logs under `~/.tmp`. What the log
does order is each message against the revisions named by then, so a
revision answers the messages sent before it whose answer came first after
it; a message still owed counts as answered after every revision, which
is the waiting case. `revision_answers` rides every browser reading
(linear in the log, 19 ms for 4,000 threads). Which elements each
revision changed, `revision_changes`, rides the `/api/view` answer for a
comparison's base only, since it reads each revision's words: a unit is an
element with an id and the words directly in it (`SourceReading
.own_words`), about 5 ms a revision on a 120,000-character page, kept with
the revision's reading.
**Selected in the browser.** The block diff is the browser's, so
version.js gives each change the revisions that changed a unit its blocks
stand in (`madeBy`), and `change-provenance.js` selects from the readings:
the version each revision landed in (the first stamp at or after it, else
Draft) and each message as its thread now reads it. `changeProvenance(change)`
is the one value a surface reads, `{groups, lines}`; the label adds its
lines under the account, broken by `white-space: pre-line` on the entry's
context.
`events.settlements` is the one walk of a thread's turns that says which
messages each answer settled; `settled_through` now reads it, unchanged
in what it returns.
**Calls.** "Unprompted" would misstate work asked for in the terminal,
which the page can't see, so an unasked change says it answered none of
the user's comments. The rule reads order: an answer in words sent before
the revision made for it hands that revision to the next answer, two
messages answered together share every revision since the first, and
paragraphs without ids share their element's unit. On the same pages, of
the 130 revisions the rule gave one anchored comment, 68% changed that
element, one inside it or one around it. Widget choices, which a stamped
version takes in, aren't attributed. The Versions list keeps its one-line
rows, and a comment saying which version answered it is not drawn; the
served reading supports both.
No protocol bump: the log means what it did; the served state gains
`browser.revision_answers` and the `/api/view` answer `changed`.
**Checks.** `tests/model/test_provenance.py` holds the derivation and the
unit changes; `tests/runtime/change-provenance.test.mjs` the words; and
`test_a_change_says_which_comment_it_answers` the three cases on a served
page, through the CLI's own reply. The thread, workflow, delivery and
served-schema model tests, the comparison browser tests and `pnpm run
check` pass. The ⇄ label was read in Chromium and Firefox, light and dark,
on `review-a-plan` and a four-version fixture.
The ⇄ label's attribution said a change was "answering your comment" and
that one made once every comment was answered was "answering none of your
comments". The rule behind it reads the log's order, and neither claim is
one the log can back, so the label now says the order it reads:
1 paragraph edited since v1
In v2, after your comment:
“Why ship with that?”
A change made once every comment was answered says *In v3, with none of
your comments waiting*, which is true of the revision made after a quick
answer that the instructions ask for. "After" covers both a comment since
answered and one still owed, so the served reading drops `answered`:
`browser.revision_answers` becomes `browser.revision_messages`, by
revision the messages a revision came after, and `provenance.revision_answers`
becomes `revision_messages`.
**Measured.** A rule scoped by each turn's pickup was tried against the
order rule on the same logs: the 39 pages with pickups among this month's
page logs under `~/.tmp`, 1,815 revisions. The locality proxy is the share
of revisions given one anchored comment, with changed words, that changed
the commented element, one inside it or one around it; any revision paired
with any earlier comment scores 17%.
| Rule | One message | Several | None | Near |
|---|---|---|---|---|
| Order (kept) | 13.6% | 2.8% | 83.6% | 68% of 130 |
| Latest pickup, then the last answered | 48.8% | 1.3% | 49.9% | 24% of 515 |
| Latest pickup, last answered only in its turn | 31.6% | 1.3% | 67.1% | 37% of 286 |
| Latest pickup, no after-answer branch | 14.1% | 0.5% | 85.3% | 69% of 122 |
| Latest pickup, then the order rule | 15.7% | 0.7% | 83.6% | 67% of 136 |
The after-answer branch, where a revision made after a quick answer would
go to that comment, was below chance: 10% of 393, and 14% of the 164 made
while that comment's turn still ran. The pickup scope before an answer did
as well as the order rule and gave fewer revisions several messages, but
where the two disagreed its one message was near in 3 of 8 cases against
8 of 16 for each of the order rule's: a pickup mid-turn lists only what
newly arrived. So the pickup rule bought nothing the measure could see,
lives only in the measurement, and isn't kept; `provenance.py`'s header
records it. Both rules cost about a millisecond over all 39 pages.
68% is four times chance and not a level for a label that states a cause,
so every heading states order. What the order rule still gets wrong: two
messages answered together share every revision since the first (2.8%),
32% of its single-comment revisions changed something else, and a
revision after a quick answer goes to the next message still waiting, if
any.
**Checks.** The provenance model tests, the words' runtime test, the
served-page test (now `test_a_change_says_which_comment_it_came_after`),
the served-schema process test and `pnpm run check` pass; the label was
read in Chromium and Firefox on `review-a-plan` and the four-version
fixture.
…y and value
Hovering, keyboard focus and a held finger now read one preview, drawn by
runtime/preview.js beside its target in the tooltip face (or the popover face for a
passage of words). It stands in a `popover="hint"` in the top layer, anchored to its
target by CSS anchor positioning, takes no pointer, holds no control and moves
nothing. One shows at a time: after a 200 ms dwell for a pointer (at once when warm),
at once for focus the browser shows, and after the same dwell under a finger, whose
release still presses. Leave, blur, a press, any key (for a pointer's) and Escape put
it away; Escape still takes its own step, so dismissing a preview never costs a press.
What a target previews:
- An element declares `lfPreview()` (module-input.md, "Previews"): words, a template,
`{popover: words}`, or null. No import, so a portable widget reads nothing off Leaf.
- A control previews its accessible name where its face is a symbol, its
`aria-description`, and every key that presses it as `.lf-key-badge` chips, from the
register (`controlKeys` in keyboard/control-keys.js).
- A range's owner calls `pointRange(range, read, at)`, for the passage marks to come.
Every key that presses a control is named. A row that presses another command's button
names it as `control` with no `run`, so the button keeps one command: `r` now presses
Resolve and `Mod+c` a message's Copy that way, and the chosenCommand refusal says so.
Send's preview names the box's send key through `pressPreview`: naming Send as
`text.send`'s control would make Enter unavailable whenever Send is aria-disabled, and
lose the "Nothing to send" announcement an empty box gives.
The platform `title` goes from every control the owner serves: role constructors,
nameAction, closeControl and control-keys no longer write it, and the `{title}` option
is gone. Hand-written key suffixes ("(Esc)", "(⏎)") go with it.
Moved onto the owner, their own handling deleted:
- held-word.js, HOLDS_WORD and data-lf-held-word: the owner's hold covers margin
entries, reactions, a diff's cut path and every other previewing target.
- The margin entry's label and the ⇄ change entry's: the label element, its placement
pass (which measured every entry on the page on every hover) and its CSS. The label
now wraps whole instead of cutting its question to one line, and may cover a
neighbouring entry, which still takes the pointer through it; the test that held
neighbour avoidance is deleted.
- The folded leaf's status peek: hover and focus state, exposure snapshot and the
reading-continuity reset. The peek element stays as the folded panel's notice seat.
- lf-gloss: hover and focus tracking. The phrase previews its explanation; a press
pins the card, where its words can be selected and commented on.
- The trace timeline's tip: its element, anchor, hover handlers and CSS.
- A trace image scale's and pace select's titles became aria-descriptions; the
transport buttons are named "Previous capture" and "Next capture".
Supporting changes: a hint popover joins no layer stack, so the dispatcher tiers no
scope over it and closing it hands nobody back; content-layout no longer re-reads the
document for toggles in Leaf's chrome; a preview of something that arrives under a
still pointer, or one reached while a press is carried, does not show; a hidden tab
hides the preview. The feature gallery's fixed samples suppress their previews through
`lfPreview` instead of a theme rule on the old label.
Docs: browser/AGENTS.md gains "Pointing reads; pressing acts" and reconciles "Controls
are few and quiet"; interface-goals.md, module-input.md, module-authoring.md,
keyboard/AGENTS.md ("Touch routes", "Escape") and the glossary follow.
Tests: test_previews.py holds a control's word and key chip, that it moves nothing,
the focus route, Escape, and a range's placement. Tests that read the margin label,
the peek, held words, the trace tip, titles and the diff path's generated word now
read the preview; a stills state, control-preview, shows Resolve's.
…e time behind an age Folds in `change-provenance` (110755e), whose ⇄ label the preview owner had deleted, and builds three previews on runtime/preview.js. What a user sees now: - **⇄ says which comment a change came after.** With a comparison on, pointing at a change's ⇄ entry previews what it did and, under it, a line each: the version it landed in and the user's comment it came after, quoted ("In v2, after your comment:" / "“Beta first?”"), or "In v3, with none of your comments waiting". The served `browser.revision_messages`, `changeProvenance(change)` and the `h` walk's announcement are the branch's; its context lines now break inside the preview's detail line (`white-space: pre-line` on `.lf-preview-more`), and the label element and `.lf-margin-entry-context` they were drawn in are gone. - **A thread previews where it stands.** Pointing at a thread's passage mark or its margin entry shows one preview, made from the reading every surface paints the thread from (`threadPreview`, thread/messages.js): the thread's name, then who wrote its last message and when, that message's opening line, and the thread's word, unread count and message count ("Your turn · 1 unread · 2 messages"), in the turn's green when it is the user's turn. An entry holding several threads is named by their count and gives each a line. A resting pointer reads it on the mark and the entry, keyboard focus on the entry, and a held finger on either; a press or a finger's release still opens the thread. Before, the entry said only "Thread…" or "1 unread", and the mark said nothing. - **An age says its clock time.** "82d ago" previews "Sat 15 Aug 2026, 14:02 PT", in the reader's own zone (`clockTime`, `agePreview`, presence.js): a message's age and the working message's, to a pointer and a finger; a message the keyboard stands on, whether or not its head shows its age; the panel's ages (a resolved thread's in Threads, a plan step's, On Claude's and Done's), which become `<time>` elements; and the activity feed's, whose `title` goes. Packages get `agePreview` from widget-api. The touch route for ranges (preview.js): a finger pressing where no element previews holds whatever range its owner reports through `pointRange`, shows its preview above the line after the dwell, and on release presses the element holding the range, which the page answers as it answers a tap. A finger that only moves reads no range, and the author's element holding the range wears no `data-lf-held`. anchor-paint.js reports to the owner only on the user's own pointer input, so a mark a scroll or repaint carries under a still pointer previews nothing, and a pointer carrying a press, as when selecting words, rests on no mark. The words of the thread the user is in preview nothing, as an entry standing open previews nothing, so the card a press opened has no tooltip over it. Its hit test now reads only the marks in the elements under the point rather than every mark on the page: on a page of 512 passage threads, a pointer move inside one cost 1.27 ms before and 0.82 ms after in Chromium (0.45 and 0.42 ms at 32 threads). The rest of that growth is outside the hit test and unattributed. Tests: test_previews.py gains a thread's preview by pointer, entry and keyboard, by a held finger, and an age's by pointer, keyboard and Threads, with titles held absent; test_a_change_says_which_comment_it_came_after reads the preview's lines; the margin and reply tests that read a thread entry's "Thread…" or its turn word read the preview's lines instead; a runtime test holds the clock wording in two zones. Stills states thread-preview, age-preview and change-preview reach the three surfaces.
…e per hover
A fresh look at the first round's captures, a code review, and four branches building
on the owner (thread previews and ages, link previews, chart values) found five
layouts, a dismissal that cost the open thread, tooltips crowding what they stood by, a
contract that replaced a control's own words, and a rule added to the document for each
widget control a hover reached.
The contract. `lfPreview(route)` is called once as a preview shows, with the route that
asked ("pointer", "focus" or "hold"), and returns `{name, keys, detail, at, excerpt}`,
every field optional: lines under the control's own name and key chips, which `name`
replaces where the accessible name says more than the face should. `at` is where the
preview stands, the declaring element by default: another element, as a message's age
stands by its `<time>`, or a box in client coordinates inside the element, as a chart's
value stands above its point. `excerpt: true` gives a preview quoting a block of the
page, as a link's place, the face's wider room. `null` adds nothing, so the search goes
on outward; `false` shows nothing here or around it, as a pinned gloss card. What a
declaration throws is reported and shows nothing. `previewChanged(element)`
(portable-api.js) says an element's preview changed while the aim stayed on it, as a
chart's pointer reaches another point or a grabbed card's grip goes quiet: a standing
preview redraws in place with no fade, or the route reading the element shows it. The
lf-trace marks, the gloss, the diff row, the margin entries, Send, the leaf and the
board's grip declare this way; the chart, link and thread branches convert from
`{popover}`, bare words and `{words, at}` to it.
A control's own preview is its accessible name where its face shows a symbol or doesn't
say that name, keyed on the face rather than `data-lf-gen`, and the keys that press it.
An options pick ("choose one: Hold approval — option 1 of 2"), a diff gutter number and
a tab no longer preview their screen-reader names, and a hand-built symbol button does.
`aria-description` stays a screen reader's: a diff row's names its path, which the row
shows.
A `title` is an element's words like any other. The portable writers keep writing it
(element-markers.js, `nameAction`), so a widget off Leaf shows the browser's tooltip;
on Leaf the preview reads it on every route, taking it off the element the first time
the pointer comes so the browser shows no second tooltip, and taking it again with new
words when the writer writes another. That moves the thirty-odd titles the runtime and
packages still write onto every route with no edit at each. Holding it off only while
the pointer rested there and putting it back after wrote it twice a hover, which the
write watch flags as an unchanged write and a screen reader hears as the element's
description changing. The cost: a writer's removal of a title already taken removes
nothing, so its words stay until it writes another. Authored markup's titles go the
same way: they gain the keyboard and a finger, at the price of the author's attribute,
which Leaf takes as the one guarantee in play, that every result a pointer reaches has
a keyboard and a touch route.
Escape is a standing preview's own step. While one shows, by pointer or by focus,
Escape puts it away and does nothing else (a `preview` page scope with
`escape: "inner"`, first in the register's STACK); the next Escape takes the step it
stood in front of. With Resolve's preview showing, one Escape had hidden it and closed
the thread card it covered. This follows WCAG 1.4.13 and the WAI-ARIA tooltip pattern.
Any other key still puts a pointer's preview away and does its own work. Focus the
runtime hands back, as a closing surface returns the user to what opened it, previews
nothing, since a preview there would take the Escape the user is backing out with.
The cost, measured on 65 tests that press Escape (48 drawn at random from the 441 that
do, and the 17 named for Escape), each run on this commit and again with the preview's
step turned off: 9 fail only with it, because a focus preview stood on the control
focus had reached when the test pressed Escape, as the Page Map's first row, a margin
card's first control or a thread's Resolve; 7 of them are in the random draw, so about
one Escape journey in seven (Wilson 95% interval 1 in 14 to 1 in 4) now takes one more
press. Not previewing focus the runtime hands back recovered 3 more. 9 others fail with
the step off too, as they do on 6b3159d. The 9 still expect one press and are not
changed here.
One face with fixed slots: the name at the face's weight with its key chips, then each
line of detail in the same type a step dimmer. The popover face for previews is gone:
a gloss previews its phrase and explanation in the tooltip face, and a press pins the
paper card. The folded leaf previews "Unfold Leaf" with its `.` key over the page's
status, and the expanded leaf "Page menu". Trace marks name their moment, input or call
and put its time and checkpoint on lines of their own, and a shared label previews "2
moments" over one line each. Send previews ⏎ and, where Return sends, "New line ⇧⏎".
Words Leaf itself says keep their italic in the detail, as the glossary's voice rule
has them on every seat. A preview on keyboard focus shows at once, with no fade.
Spacing: the preview stands below its target with its end edge in line with the
target's, so a control at a card's edge keeps it inside the card, flipping to the start
edge and above where the window has no room. Its gap is the focus ring's room plus 6px,
so a ring never meets it and the folded leaf's badge has air; a held finger sees it
22px further up. Esc chips: the `close` action in ACTIONS names Escape, and
`controlKeys` reads the action a control shows, so Page Map, About this page, the
thread card's ✕, the visual review's ✕ and the panel's ✕ show it from that one place.
Anchoring: a target in the document stands the preview by the name `anchorName` gives
it, an inline style; a target in a widget's shadow tree, or a box a declaration names,
stands it by one of two places of the owner's own, set over the box by insets from the
nearest box in the document. Naming the shadow-tree box declared a `::part()` rule for
each new one, kept for the session. On pr-walkthrough's 115 shadow-tree controls in
Chromium, a first visit cost 2.3 ms with 69 rules added (1,157 elements) and 5.4 ms with
86 (7,155, the page grown by 6,000 paragraphs); now each show costs 0.3 ms and 1.0 ms
with none added. Moving one name between targets, the review's proposal, cost 1.8 ms and
7 ms per show, since Chromium restyles the page when an anchor's name moves; Firefox
pays nothing either way. Two places take turns so a preview whose anchor changed is
placed afresh rather than first where the last target's fallback put it.
Screen readers: every preview shown on focus describes the focused element while it
stands, whatever supplied it, except a control's own, which says only what its name and
`aria-keyshortcuts` do, and a proxy's; the description it had comes back after, with no
empty `aria-describedby` left behind. `aria-keyshortcuts` now holds every one-press key
its chips draw beside the keys its own scopes take (control-keys.js,
`controlShortcuts`), so Resolve says `r` beside Enter and Space; Send writes its own
from `sendBindings`, the list its chip reads.
Routes: a range's owner may make its range again on every move, which points at the
same range. A key on an element a click focused counts as the keyboard's in Firefox for
a changed preview. A finger held past the dwell reads wherever it slides, so one that
crossed a gap between neighbours reads the next it reaches. The board's grip says its
keys only as chips and its drag in a line of detail, and goes quiet while its card is
grabbed.
The own-command branch in `controlKeys` stays: it serves commands a scope declares
away from the control they claim, such as the image viewer's `z` and its close; its
comment named Send, whose key is the box's own `text.send`, which sends rather than
pressing Send, so the box declares it.
Tests: the preview tests run in Chromium and Firefox; the Escape test fails without the
preview's step; `preview_parts` reads what the pointer route shows rather than calling
`lfPreview()`; the obligation marker measures cuts on the face's box; a focus preview
describes the margin entry it stands on.
Conflicts, resolved to the owner's round with this branch's additions kept:
- preview.js takes the owner's version, with this branch's touch route for ranges
put back on it: a finger pressing where no element previews holds the range its
owner reports through `pointRange`, shows its preview above the line once armed,
and on release presses the element holding the range. The long-press menu stays
shut only while a held preview shows (`hold.armed && shown.route === "hold"`), so a
finger held on plain words still gets the platform's selection menu.
- controls.css takes the owner's one face and drops this branch's `.lf-preview-more`
pre-line, `.lf-preview-said` and the old turn rule.
- browser/AGENTS.md and test_previews.py keep both sides.
This branch's declarations still return the first round's shapes here; the next
commit converts them to `{name, detail, at}`.
The thread, age and change previews now declare `{name, detail, at}`
(module-input.md, "Previews") rather than drawing their own lines, so they wear the
owner's one face. What a user sees:
- **A thread** (`threadPreview`, thread/messages.js) is named as every surface names
it, and its detail lines say who wrote the last message and when, that message's
first line, and where the thread stands ("Your turn · 1 unread · 2 messages"). The
line in the user's turn keeps the turn's green, the one colour rule this adds to
the face (`.lf-preview-detail > [data-lf-turn="user"]`), since every surface paints
the user's turn green. An entry holding several threads is named "2 threads" with a
line each. The turn line is no longer bold, and the message's first line no longer
has a fuller ink and reading weight of its own.
- **A message the keyboard stands on** previews its clock time beside its `<time>`
(`at`) rather than centred under the whole message, and only on the focus route: a
pointer or a finger on the words of a focused message reads no time from them.
- **An age** previews its clock time as the preview's name (`agePreview`).
- **⇄** gives each line of what a change came after its own detail line
(`contextLines` in contribution-controls.js), where the first round broke one line
with `white-space: pre-line`.
On keyboard focus each of these is now the focused element's description. Chromium's
accessibility tree reads a thread's margin entry as its name ("Thread, Your turn, 2 of
3, … “enforce size limits”") and the preview's words as its description, and a
message as its words with the clock time as its description.
anchor-paint.js drops its own duplicate check, the thread it last reported. It now
reports the whole passage, its first piece's start to its last piece's end, on every
pointer move and finger press, and the owner's `pointRange` treats a range with the
same boundaries as the same range. So crossing the pieces an inline element splits a
passage into, or a repaint making the ranges again, keeps one preview standing by the
line the pointer is on.
Tests: the thread test (pointer, entry, keyboard and its description) and the age
test (pointer, keyboard beside the `<time>`, the description, no time from a focused
message's words, Threads) run in Chromium and Firefox; the finger test stays in
Chromium, which alone takes CDP touch. The change tests read the detail lines.
…s own blocks Review of thread-previews found three faults in the change attribution, each reproduced here first. **A revision's messages were recomputed from every thread's current state.** `revision_messages` listed, for every revision, the messages it came after, so 512 threads waiting across 512 revisions served 261,632 references (10.10 MB), and resolving one thread rewrote 511 of them (a 10.11 MB patch). And because a message counted only while its thread still awaited the agent, resolving a thread with no answer took its comment off every revision it had waited across, which then read as made with none waiting. The reading now serves each message's wait instead (`message_waits`, an entry a message): `from`, the newest revision the log named when it was sent, and `until`, where the agent answered it or the user resolved its thread, null while it waits. A revision written in that interval came after it, so a revision's messages are a fact about its past that no later event rewrites, and a gesture sends only the waits it ends. At 512 x 512 the reading's waits are 40,143 bytes, and one resolve sends 1,433 bytes of patch, 106 of them the one wait it ended. A resolution names no revision, so the wait it ends runs to the newest revision the log names next after it: a revision the log can't place before or after a resolution counts as before it, since "after your comment" stays true of it either way. 4 of the 216 waits in this month's page logs were ended that way with such revisions beside them. That also changes which messages a revision names: every message waiting when it was written, rather than those the agent answered first after it. On the same 39 pages with pickups (1,885 revisions), revisions with one anchored comment waiting changed that comment's element in 71% of 116 cases, against 68% of 130 for the earlier rule and 17% by chance; 4.5% came after several messages (2.7% before) and 83.4% after none. The earlier rule's narrowing needed answers yet to come, which is what made its lines change after the fact. **A change was attributed through its nearest id.** Paragraphs without ids share their section's unit, so a revision that edited one and a revision that edited another both claimed both changes. `madeBy` now narrows each change to the comparison's own blocks: of the revisions that changed its units, the one that wrote each block's words, as `diffBlocks` keys them, and the one that took out each base block it took out. Where several revisions changed a change's units it reads their documents, painted as the page now paints, through the view answer's new `url` for each revision; one revision needs no document. The comparison is read again after the documents arrive, so it still marks the page in one synchronous stretch. A block marked for its state alone, such as a pick, is now made by no revision. **Checks.** The provenance model tests (waits, a resolve sending one wait, the units), the runtime test for the words, the served-page tests including `test_a_change_names_only_the_revisions_that_wrote_its_own_blocks`, the comparison tests that hold or reroute `/api/view`, the served-schema process test and `pnpm run check` pass.
…nd time once From a Codex review of thread-previews, each finding reproduced on 75d7725 first. **A pointer on a passage no longer reads every mark in its paragraph.** The hit test (`markHit`, anchor-paint.js) made two explicit `elementFromPoint` lookups a frame and read the client rects of every mark whose text the pointed element held. It now makes one `caretPositionFromPoint`, looking into the shadow trees that hold marks, and finds the pieces on that text node by offset: pieces sorted by start, each carrying the furthest end up to it, so a binary search and a walk back over the pieces that still reach the offset name the candidates, and only those are measured. An element's mark is still found by climbing from the caret's node. Chrome over the words still answers no mark, since the lookup lands in it. The pointer's hand over a mark was a `lf-over-mark` class on `body`, which the margin's page observer hears as a class change: every crossing of a mark's edge laid out every margin row. It is now `data-lf-over-mark`, a runtime paint attribute (page-paint.js) the observer doesn't hear, as the outline marks already are. On one paragraph holding 32 and 512 passage threads, in Chromium, moving the pointer onto the last one: | | 32 marks | 512 marks | |---|---|---| | hit test's rect reads, before → after | 32 → 1 | 512 → 1 | | hit-test lookups a frame | 2 → 1 | 2 → 1 | | all range rect reads on that move | 103 → 37 | 1,543 → 517 | | main-thread time a move inside the mark | 0.51 → 0.49 ms | 1.25 → 0.54 ms | The reads left on that move are one margin layout pass, which naming the paragraph as the preview's anchor sets off the first time a preview stands on it (preview.js, `standByRange`); a second entry reads two rects. **An entry holding several threads gives each a line.** It said the first two and "and 2 more threads"; the cap goes. The example and page logs under ~/.tmp hold at most seven threads on one target (523 logs), which fit the window. **Every age the panel shows previews its clock time.** On Claude's summary said "Last done: …, just now." and "the longest for 3h" as plain words, and a finished item's card its "Done 3h" the same; each is now a `<time>`, through the panel's one age writer (`panelAge`), in Leaf's voice where Leaf says the sentence. **The keyboard's clock preview on a message stands in its head.** A message whose age matches the one above draws none, and its preview stood under the whole message, 47 px below the head on the review's page; it now stands by the head's place for the age (`.lf-msg-meta`), 11 px below. **A screen reader hears a thread's word once on its entry.** The entry's name says "Your turn", and its preview, which focus makes the entry's description, said it again; to the keyboard, a lone thread's preview leaves out the word the name says. An entry holding several threads keeps each line's word, which says which thread it is. The entry's preview reads its threads as they stand when it shows (`threadNamed`), so a reply that arrived since the margin last drew reads in it. Tests: the age test focuses the second of two messages with one age; a new test holds four threads on one target; the thread test reads the keyboard's preview without the name's word; the On Claude test reads its summary's time; three tests read the hand's new attribute.
test_a_change_names_only_the_revisions_that_wrote_its_own_blocks, from change-provenance's c3a05cf, read the ⇄ label element the preview owner deleted; it now reads each change entry's preview, as test_a_change_says_which_comment_it_came_after does. What it holds is unchanged: the first change names only the revision that wrote its own words and the comment waiting then, the second both comments.
Round four of the preview owner, from the decisions on round three and what the link, chart and thread branches found converting to its contract. Focus previews read only where the user moved focus themselves: a Tab or Shift+Tab (the runtime's `step`), or a key that moves them between items while it is down and leaves them in the surface they were in, as an arrow, Home or End does in a list or a widget (`aimed`). Focus a surface places as it opens, as the Page Map's first row, a margin card's first control or a thread's name, focus it hands back as it closes, and focus Escape moves as the user backs out, as from a reply box to its thread, preview nothing, so none stands in front of the Escape the user reaches for next. Escape stays the first step of every preview that stands. On the same 65 Escape tests as round three, 9 failed only because of that step; now 2 do, both where the test Tabbed onto a control and pressed Escape, which is the 1.4.13 cost, and both now press it (test_command_routes, test_escape_from_a_seated_reply_send_returns_to_its_thread). One of the two is in the random draw of 48: about one Escape journey in fifty (Wilson 95% interval 1 in 270 to 1 in 9), where it was one in seven. The 9 that fail with the step off fail on 6b3159d too. Previews are hoverable (WCAG 1.4.13): a pointer's preview takes the pointer, so the pointer can cross from its target onto it and read it there; leaving it puts it away after the dwell, and reaching another target from it shows that one at once. A focus's and a finger's take none. One placement rule for every preview (`stand`, preview.js), measured as it shows and written as insets from the box that carries the target through a scroll (`carrier`): the nearest that scrolls, stands fixed or sticky, or stands in the top layer, else the page's root, each named once. Naming the target wrote its style, which the margin's observer heard: on a page of 512 threads, the first preview on each paragraph measured the margin's 512 boxes; now the first preview of the session measures them once, as the root takes its name, and each paragraph after measures none. Below the box it previews by the gap that clears a focus ring, above where the window has no room, above first for a finger and for a point inside the target; beside a column of targets, toward the nearer window edge, so a margin entry's covers neither the entries above and below it nor the passage it is about, and below a column too wide to stand beside. Along the line it starts at the box's start edge and stays inside the nearest box around the target wide enough to hold it. That replaces the end-edge alignment, which kept a control at a card's end inside the card but pushed an inline target's preview out of its column: a link early in a line of prose (the gallery's trailhead link stood its card at x 28 against a column starting at 168), an age inside a thread card, and a margin entry's, over its passage. It also replaces the CSS position areas, the fallback list and the two places the preview stood a shadow tree's targets by: each show names no target and adds no rule. A target finds its column by a few hit tests around itself, and a target beside it, as a toolbar's controls stand, makes it a row. The contract keeps its shape and adds: - a standing preview's declaration is called again for each new presentation of the document, a state's or a revision's, after it has painted, never per pointer move, so it follows the page, a link's place or a thread's turn, redrawn in place with no fade and left as it is where its words come back the same; a range's preview included, and a range's owner declaring the same range again gives the standing preview its new words, where the same boundaries used to discard them; - `previewChanged` redraws a standing preview in place without the preview closing itself: ending the old record's watch hid it, as `shown` still named that record, so a chart's tip vanished at every other point; - the innermost target wins on every route: a link inside a thread's passage previews as a link to the pointer too, where the passage's owner reported its range after the link's boundary. Titles: every writer that can later remove or blank its title declares its words as `lfPreview` instead, since a removal can't reach words the preview took: the composer's error line, the panel's mode word, menu rows, choice commits and row notices, a deleted message's edit time, command reference entries, the shot view's link and scale words, the file editor's status, the trace's selection label and caption, and the target picker's search status. Writers that only set or replace a title keep it. The words the preview takes live beside the portable writer (element-markers.js, `titleWords`), where the contribution entries and the interaction log now read them, and a frame's title, its accessible name, stays where it is. The long-press menu stays shut only while a held preview shows, so holding a link to another site keeps the platform's menu. Tests: a standing preview stays open through `previewChanged`, follows a new presentation and a new revision, and a standing range preview says its owner's latest words, each failing without its fix; the innermost target previews under the pointer inside a range's passage; the pointer onto a preview keeps it; tests that read focus previews move focus with a key, as the user does; the preview tests run in both engines.
…e rule Conflicts resolved to the owner's round four, with this branch's touch route for ranges put back on its preview.js: a finger pressing where no element previews holds the range its owner reports through `pointRange`, takes the owner's latest words for the same range, shows once armed, and on release presses the element holding the range; the author's element holding it wears no `data-lf-held`. The owner's `stand` already puts a held range's preview above the line. Tests: the thread test now Tabs onto the margin entry, since a focus preview reads only focus the user moved; the age test holds that the keyboard's clock preview stands by the message's head, beside it where the owner's rule stands a column's preview, rather than below it.
A widget that moves already-marked words into a new declared shadow tree after the page presented lost their mark. Moving a node collapses each live Range ending in it onto the node's old parent, so the passage's highlight range shrank to an empty range at the host. `watchPassageRoot`, the one door every x-shadow root comes through as it fills, already forgot the page's text reading there, but nothing presented the page again, so the marks kept their collapsed ranges until some unrelated change repainted them. The same door now queues a presentation once the fill has moved the words, when the page has presented already; before that, the first presentation reads them in the stage anyway. Test: test_a_passage_staged_into_a_new_shadow_tree_keeps_its_mark stages a marked paragraph into a new shadow tree and expects its mark painted again and its hand under the pointer, in Chromium and Firefox. It fails on the parent commit in both.
… previews fit The review of round three, after merging the preview owner's round four. Element marks (P1). The caret lookup alone said which node the pointer was over, so an element's mark was found by climbing from the caret's node. An image holds no text, so in Chromium the caret landed beside it and its thread showed no hand and opened on no press; a point 35 px past a marked word at a line's end still had that word as its nearest character, so it claimed the word's thread. `markHit` now takes the element under the point from the platform's hit test (`elementFromPointAcross`) and climbs from it for element marks, and uses the caret lookup only for text marks, checking the one or two characters' boxes beside the caret's offset. On the elements page, in Chromium and Firefox: the image takes the hand and opens its thread, the point past the word opens nothing, the word itself opens its thread. Overlapping marks (P2). The pieces on a text node were searched back from the caret's offset over every piece that might still reach it, which grows with the marks overlapping one run of words. Each text node now holds the stretches its pieces' boundaries cut it into, each with the first thread in reading order covering it, built by one sweep with a heap as the marks paint; a move finds its stretch by binary search and reads no mark's geometry. `CSS.highlights.highlightsFromPoint()` ships in Chromium, Firefox and WebKit, but walks every range a highlight holds (20 to 320 us in Chromium and 15 to 100 us in Firefox, from 32 to 512 ranges), and Firefox and WebKit name a highlight under a box covering its words; notes/browser-support.md records the gap and how to recheck it. Per pointer move, in Chromium: 2 character-box reads, 1 `elementFromPoint` and 1 caret lookup, at the last of 32 and of 512 marks in one paragraph, with 512 threads on one word, and on a passage of 512 pieces; 0.46 to 0.64 ms of main-thread time. On a page of 512 paragraphs with a thread each, a move inside a mark took 0.87 ms against 0.85 ms on plain words in the same run, so the mark test adds nothing measurable; both grow from 0.6 ms at 32 paragraphs, as they did before this branch. Threads rows (P2). The row the pointer is on was found by asking `:hover` of every row Threads lists. The hover pass now hands the panel the element its own hit test found, and the panel climbs from it to the row; the row for a thread is one selector. The first preview's margin pass (P2). After the merge the session's first preview still laid out every margin row once: the owner names the page's root as the box carrying most previews, which writes the root's style, and the margin's page observer hears a style write as a restyle. Previews now mount before the margin hears the page and name the root as they mount. Counted by `lf-margin-layout` on 512 threads, in Chromium and Firefox: 3 passes from load to settled, as with no naming at all, and none on the first preview. Naming it at mount after the margin heard the page added a fourth boot pass. Crowded entries (P2). An entry holding 32 threads previewed 32 lines, 969 px tall in a 600 px window. Its preview now gives as many lines as the window holds and ends with "and 22 more threads", which a press still reaches: the card it opens steps through every thread, and on a window too narrow for the card, the thread it opens in the panel goes back to the panel's list. At 900x600 the preview holds 10 lines and stands from 94 to 345 px; at 1440x900, 16. Rejected: listing every thread in a preview that scrolls, whose hover work grows with the threads on one target and whose lines past the window neither a keyboard nor a finger reaches. Tests: test_an_element_s_mark_is_under_the_pointer_only_over_the_element, which fails on the image in Chromium without the element hit test; the several-threads test now also holds that a 250 px window gives two lines and "and 2 more threads" and keeps the preview inside it.
…iews fit their face Round five of the thread previews, from the review of 5eaac69. One hit (#11). A marked image or widget took the hand and opened its thread on a press, but showed no preview to a pointer or a finger: only a passage's hit reached the preview owner. `pointMark` now hands the owner whatever `markHit` found, a passage's piece or a range around the element marked, so the mark a press opens is the mark that previews, in both engines and under a Chromium finger. Passages across a shadow root (#12). One native Range can't hold a passage that runs into a declared shadow stage, since both its ends stand in one tree: the range from the first piece to the last collapsed onto the passage's end inside the stage, and the preview stood there. The preview owner is now told the piece the pointer came onto the thread's marks over, held while it stays on them, so the preview stands by the line first pointed at and stays as the pointer crosses pieces. The shared geometry reads a passage segment by segment (passages.js, `segmentLines` and `segmentsBox`): the resolved passage's box and attachment (resolved-target.js, `passageGeometry`), which the thread card, the comment box and anchoring read, the reading place's top, and page search's match boxes and hit test, where each read one range across the passage before. Crowded previews (#8). The thread lines were cut by a count read from the window's height once, which stayed as the window shrank under a standing preview. The preview now lists every thread's line, and the face, which the owner's round 5 holds to the room it stands in, clips them rather than scrolling (controls.css). A ResizeObserver on the face and the list counts the lines that fit and sets "and N more threads" after them; the rest stand after it out of sight, still laid out, so the face stays held at the room's size in both directions. With the owner's bound stood in for by a constructed sheet, the 32-thread entry's standing preview shows 32 lines at 900 px, 9 and "and 23 more threads" at 250 px, and 32 again back at 900 px, in Chromium and Firefox, and its face never scrolls. Threads rows (#9). A row in Threads previews its thread through `threadPreview`, as the thread's margin entry does: to the keyboard (`g`, Shift+T and the arrows), leaving out the word its state already says, to a resting pointer, and to a Chromium finger, whose release opens the thread. Rebuilds (E). Every presentation rebuilt each thread's ranges, the hit-test index and the `lf-mark` highlight: twenty builds for ten presentations that changed nothing, at 512 threads. A pass now keeps the last pass's marks of each thread whose marks it would make again, compared by the live ranges' bounds or the elements, and builds the index and highlight only when a mark or the order of the threads marked changed: none for those ten. Tests: - test_an_element_s_mark_is_under_the_pointer_only_over_the_element now holds the image's preview to a pointer, in both engines, and to a Chromium finger; - test_a_passage_running_into_a_shadow_tree_previews_by_the_line_pointed_at; - test_a_presentation_that_changes_no_mark_builds_none; - test_a_threads_row_previews_its_thread; - test_a_crowded_preview_counts_its_lines_again_as_its_room_changes, whose constructed sheet stands in for the owner's bound until its round 5 merges. The first two fail on 5eaac69's anchor paint in both engines; the third would count twenty. `preview_parts` reads a list of threads line by line.
…says who moved it Round five of the preview owner, from the review of 00e9ab5. Placement is the browser's again. The preview is shown with its target as its source (`showPopover({source})`), whose box is its implicit anchor (`position-anchor: auto`), and controls.css stands it there with a logical `position-area` and five `position-try-fallbacks`. That deletes `stand`'s insets, the carrier it named and the container clamp. The preview now follows its target through a scroll inside the page and a resize, starts at a right-to-left target's right edge, and writes nothing on the target, its root or a box that scrolls it. So the margin no longer lays out again for a first preview: on the 512-ask scaling page a paragraph's first preview made 3 rect reads, where round four made 22,543, and wrote no style or class outside the preview. A target with no HTML box of its own (a range's line, a declared box, a shape in a drawing) is stood for by the place, a box in the chrome that scrolls with the page. The module still picks the side, by a few hit tests across the room each side offers: below, above, then beside toward the nearer window edge, the first that fits and covers no other target, so in a 2x2 grid the preview covers no neighbour and the pointer reaches the one below. Where every side covers a target, the preview stands below and the pointer passes through it. A preview taller than the room on either side is held to the room below or above, with its face scrolling, through the window's resizes. Inside a modal dialog it stands in the topmost dialog, carrying the chrome's styles into the dialog's shadow tree where it is in one (layer-stack.js, `carryChromeStyles`, which `seatModal` now calls too), so the pointer can cross onto it there. A hint now expands no control: the layer stack set `aria-expanded="true"` on a popover's `source` whatever the popover was, so a preview shown by the Leaf button announced the panel as open, and the button's own render wrote the value back. Two engine gaps shaped it, both in notes/browser-support.md. Firefox 157 stands a popover shown by a new source by its last source while nothing about the popover changed, so a new source that comes with the same words moves the preview to the other side of the place. Chromium 156 tries no sixth fallback, so the list holds five. Titles: this reverses the call that the preview takes over `title`. The preview no longer takes an author's title off its element. A pointer over an element the browser's tooltip speaks for gets that tooltip and no preview; focus and a finger read the title's words in the preview. Removing a title therefore leaves no words behind, and a control named only by its title keeps that name. The takeover, its cache (`takenTitles`, `titled`, `titleWords`, `takeTitle`) and the readers moved onto it go. Leaf's own symbol controls write no title on Leaf (element-markers.js `titlesName`, read by `nameAction` and the symbol and mark roles); off Leaf they still write one. The compose box's alternate Send drops its title, which repeated its face. Leaf's other titles, such as the held-news notice, panel notes and message times, now show the browser's tooltip to a pointer. Focus previews read who moved focus, not which keys are down. A Tab, Shift+Tab or a placement standing in for one (`step`) shows one, as do a keyboard walk landing (`beginWalk`) and a move a Leaf command the user invoked makes in its own run (dispatch.js `commandRunning`), unless that move enters a surface as it opens or is Escape's step backing the user out, as from a reply box to its thread. A script's focus while Shift is down shows nothing, and an `m` walk onto a margin card's message shows that message's preview. A preview the user put away stays away until they aim again: `previewChanged` redraws a standing preview and opens none on focus, so a board grip released after Escape, or a chart redrawing with the same point, no longer revives one. When a preview goes, whatever puts it away, the element that declared it hears `lf-preview-ended` (`PREVIEW_ENDED`, portable-api.js), a `CustomEvent` whose `detail.route` names the route that read it, so a widget takes off a mark it drew for the reading. Tests: a preview writes nothing on the page and brings no margin pass; it covers no grid neighbour and takes the pointer inside a modal dialog; one put away stays away through a widget's redraw, script focus and a grip's release, and the declaring element hears that it ended; a title stays its writer's; and a preview stands by its target through a scroll, a resize and right-to-left text, and is held inside a short window. All run in both engines. Tests that read a focus preview now step onto their target with the keyboard (render_harness.py `tab_onto`); the cluster test drops a script focus that no longer reads as the user's aim. The panel's Done asserts its preview's words instead of a title. The symbol tests check that no title is written on Leaf and that one is written off it.
A preview may declare a list, `list: {items, more}`, as the threads standing at one
place. Where the list is taller than the room the face is held to, the owner shows as
many items as fit and, under them, `more(count)`'s words for the rest, such as "and
26 more threads" (preview.js `fitList`). It fits the list again as the face's box
changes with the window (a `sizeObserver` on the preview). The items it leaves out
stay laid out but `visibility: hidden`, so they are neither seen nor read by a screen
reader, and the face's size, and with it the browser's choice of where the preview
stands, holds. Each place is written once per fit. A list's face clips; every other
preview's face still scrolls. This replaces the `fits` flag the first round-five
commit added and a consumer's own `overflow: clip` rule, so fitting has one owner.
Test: a 30-item list in a 260 px window shows the items that fit and counts the rest,
inside the window, and shows them all with no count once the window is 1400 px tall,
in both engines.
The module reference spelled the count function inside a double-backtick code span, which the export-documentation test reads span by span; the example is now the words it gives.
… every piece Round six of the thread previews, from the review of fa4fabb. Moved words (A). A pass kept a thread's marks where its live ranges stood at the offsets the pass resolved. A revision that writes words ahead of a passage in its text node moves those ranges with the words, so the test passed and the index kept the old offsets: the hand, the preview and a press answered at the words now standing where the phrase stood, and nothing on the phrase. The anchor paint now keeps, for each thread, the record its marks were made from (the segments' nodes and offsets, or the elements), builds the index from that record, and keeps a thread's marks only where both that record and the live ranges match what the pass would make: the index holds the one, the highlight paints the other, and a widget staging marked words into a shadow tree collapses the ranges while leaving the record as it was. Search across blocks (B). Page search clipped every piece of a match to the first piece's block and took a press only through that block, so a match running into the next paragraph, or into a declared shadow stage, marked and answered only its first piece. `segmentPieces` (passages.js) gives each segment with its block and lines; search marks, clips and hit-tests each piece against its own block. Landing on a match now selects from its first piece's start to its last's end: both engines hold a selection across a shadow root as one composed range and paint it, and `selectEnds` takes its direction from the selection (`direction`), where comparing the two ends as ranges' bounds threw across the root. Shared passages (C). A passage several threads mark previewed only its first thread, while its margin entry listed all of them. Each text node's pieces now stand in a centred interval tree, which finds every piece covering the character under the point by one walk down, reading only the pieces it finds beyond the tree's depth; a mark previews every thread marking what the pointed mark marks, in reading order, with the entry's lines (`threadPreview`). A press still opens the first. The fit observer skips a face the owner has put away, where counting no room wrote the count inside the observer's own delivery, which Firefox reported as a ResizeObserver loop. Tests: - test_a_revision_that_moves_marked_words_moves_where_their_mark_is_found; - test_a_search_match_across_blocks_marks_and_selects_each_piece, across two paragraphs and into a shadow stage; - test_a_passage_several_threads_mark_previews_them_all_as_its_entry_does. Each fails on fa4fabb's runtime in both engines. Without the live-range half of the keep test, test_a_passage_staged_into_a_new_shadow_tree_keeps_its_mark fails.
The owner's round five places previews by the browser, holds a preview's face to the
room it stands in, fits a declared list to that room with the declaration's words for
the rest, and writes nothing on a target, its root or a scroller.
Conflicts resolved to the owner's round five, keeping this branch's touch route for
ranges: the finger flag that reads a range only while a press holds it, and no
`data-lf-held` on the author's element holding a range a finger holds.
Moved onto the owner's contract:
- A margin entry's preview of several threads declares `list: {items, more}`, the
items each thread's line and `more(count)` "and N more threads" in Leaf's voice
(thread/messages.js, `threadPreview`). The ResizeObserver and line counting there,
and the controls.css rules that clipped a thread list, go; the owner fits the list.
Against the owner's bound, the 32-thread entry's standing preview shows 32 lines at
900 px, 5 and "and 27 more threads" at 250 px, held inside the window, and 32 again
back at 900 px, in Chromium and Firefox.
- leaf.js mounts previews where it did before round four: the owner names no root, so
the reordering that named it before the margin heard the page goes. On 512 threads
the first preview still lays the margin out 0 times, in both engines.
- `m` onto a margin card's message now previews its clock time in both engines (the
owner's walk landing), so nothing here works around it.
Tests: the crowded-preview test now checks only this branch's side, that an entry's
list says "and N more threads" for the items the owner leaves out, in Leaf's voice;
the owner's list test holds the fitting and the resize. `preview_parts` reads the items
and count a face shows.
The owner reads a standing range preview again each time it is told the range (preview.js, `pointRange`), and the anchor paint told it on every pointer move. With one thread a mark that cost little; with every thread under the pointer now previewed, a move over a word 512 threads mark drew 512 threads' lines each time, 1.5 to 2 ms a move in Chromium. The anchor paint now tells the owner again only when the threads under the pointer change, keeps the range it made around a marked element, and puts the threads in reading order only as the preview reads them. Per move, in Chromium on a loaded machine: 0.41 ms at the last of 32 marks in one paragraph, 0.52 ms at the last of 512, 0.45 ms on a word 512 threads mark, 0.45 ms on a passage of 512 pieces; a standing preview still takes news from the owner's own reading on each presentation.
…he page's words Text a script writes into a marked text node, with no revision and nothing presented after it, moved the mark's live range with its words, so the highlight followed them, while the hit index kept the offsets the marks were made from: the hand, the preview and a press answered at the words now standing where the phrase stood, and nothing on the phrase where it was drawn. Ten seconds to a minute later a presentation found the marks again; until then the two copies of where a mark is disagreed. The index is now read from the marks' live ranges, the ones the highlight paints, so there is one record of where a mark is. It holds for the page reading it was read in (passages.js, `pageReadingVersion`, which the text watcher advances as any of the page's words change, by a revision, a widget or a script), and the first hit after that reads it again. The record of what the marks were made from goes: a pass compares the live ranges with what it would make, as before round six, and a revision that moved them reads the index again through the same version. Over 160 pointer moves with no change to the page the index is read 0 times at 512 threads; per move the hit test reads the same 2 character boxes, 1 `elementFromPoint` and 1 caret lookup. Chosen over the watcher flagging the anchor paint: the reading's version is that flag, already kept for every reader of the page's words (anchor-controls.js, thread placement), so the anchor paint asks it rather than adding an observer. Test: test_words_a_script_writes_ahead_of_a_mark_move_where_it_is_found, which fails on e1a4d81 in both engines with the hand at the old offsets. A press on the moved words finds the thread but opens no card until a presentation, since the anchor placement the card stands by keeps the offsets it resolved; main has the same placement and shows neither the hand nor the card there.
…ge touched Round seven of the thread previews, from the review of 7bcda01. A held finger after a cancelled one (A, regression from e1a4d81). The anchor paint told the preview owner a mark's threads only when they changed, so a finger holding a passage again after the browser cancelled its first hold landed on the threads it had last told and was never read: no preview. A press now tells the owner afresh, whatever threads it lands on; a pointer resting on the same words still tells it nothing new. Split text (B). A range a split carries into the next text node, as `splitText` between "marked " and "phrase" does, painted both words while the index held only its start node, so "phrase" had no hand, preview or press. The index now holds a range's pieces in every text node it intersects. Local invalidation (C). Any change to the page's words advanced the page reading's version and the next hit read every mark again: a counter a widget redraws each frame beside 512 threads rebuilt the whole index on every pointer move. The page's words watcher now hands each change it hears to the anchor paint (passages.js, `hearPageChanges`), which notes the marked text nodes it touched, the nodes it moved in and out and the text just before a node it moved in; the next hit reads again only the ranges indexed in those nodes and builds again only their trees. With the counter running, 80 pointer moves read no range again and build nothing. `CSS.highlights.highlightsFromPoint()` ships in Chromium 156 and Firefox 157 and sees Leaf's marks, the `lf-mark` highlight, but reads every range the page's highlights hold on each call: over a mark in the middle of 32 and of 512 paragraphs, 15 and 235 us in Chromium and 15 and 80 us in Firefox, against 1 and 5 us for the caret lookup. A hover's work must not grow with the page, so the anchor paint keeps its index; notes/browser-support.md records the measurement and how to recheck it. Reading order (D). The threads a mark names were in the order they were started, so where "marked phrase" was started before "short marked phrase near", their shared words listed and opened the later-starting passage first, while the margin stood its entry first. Both now order by one comparator (resolved-target.js, `readingOrder` and `readingPlace`), which the margin's inventory takes in place of its own. Search into a shadow stage (E, inherited from fa4fabb). Bringing a match into sight gave the scroll one range across its pieces, which collapses onto its end where the match runs into a shadow tree, so the end was centred and the start went above the window (-194 px). The scroll now takes the match's first piece, as travel to a thread does. Tests, each failing on 7bcda01, in both engines where it runs in both: - test_a_finger_holding_a_thread_s_words_again_reads_it_again (Chromium, by touch); - test_words_a_split_carries_into_a_new_text_node_keep_their_mark; - test_overlapping_passages_preview_and_open_in_reading_order; - test_a_search_match_running_into_a_shadow_stage_shows_its_start. The split and search tests read the hand and the scroll once, since a later presentation finds the marks again and a typed query finds its first word first.
… to a passage A press on words a script had moved found the thread but opened no card. Anchor placement kept the offsets it resolved, so between the script's edit and the next presentation every reader of the placement read the words at the old offsets: the margin keyed the passage's entry by those words, and the presentation the press brought read the passage again, keyed the entry by the right words, and closed the card it had just opened. The hit index already read the marks' live ranges, so the hand promised a press that did nothing. Anchor placement now keeps a live range of each segment it resolves, the last reading's where they still stand where this reading resolved the passage, and `targetSegments` (resolved-target.js) reads a placed passage's segments from those ranges: one record of where a passage is, which the highlight paints, the hit index reads, and the margin, the card and travel read. The anchor paint paints and indexes the placement's ranges instead of making its own (its record of whether marks changed goes with them), and `rangePieces` (passages.js) is the one reading of the text a live range covers. After a script writes words ahead of a marked phrase, a press on the phrase opens its card at once and the card stays open. Where a passage is scrolled to has one home: `passageStart` (passages.js), its first piece, and `scrollToPassage` (anchor-travel.js), which search's match, the comment box brought back to its passage, thread travel and the draft composer's travel (`anchorTravelAt`) all take; each read one range across the passage before, which collapses onto its end where a passage runs into a shadow stage. The comment box of a draft on such a passage, brought back from a page scrolled away, put the passage's start at -194 px; it now stands in the window. Tests: test_words_a_script_writes_ahead_of_a_mark_move_where_it_is_found now presses the moved phrase and holds that its card opens and stays; test_the_comment_box_comes_back_ to_where_its_passage_starts seeds a draft on a passage crossing into a shadow stage. Both fail on 9c95e41 in Chromium and Firefox. The draft composer's travel takes the same function and wasn't reproduced on its own: reaching it needs Resume writing on a draft whose writing place is kept, beyond what the bring-back test already shows.
…ches One boundary from the page's words to the marks. The anchor paint interpreted the page-words watcher's raw mutations itself and treated a native Range following the DOM as the passage still standing, which went wrong three ways: - a split and a removal left a live range starting at an element offset, whose walk met the paragraph's earlier text and stopped, so the phrase it still highlighted had no hand, preview or press (review A); - a counter replacing its text node after a paragraph of 512 marks made every hit read all 512 ranges again, 4,096 re-reads over 80 moves (B); - replacing a marked text node collapsed its range and nothing carried the mark to the new node, while writing other words into a marked phrase kept a highlight and preview that reading the page again finds no passage for (D). Now the watcher reports which text each change touched, the nodes written or taken away and those put in (passages.js, `hearPageWords`). Anchor placement, which owns where each anchor stands, keeps for each text node the threads whose segments stand in it and those whose passage runs on past it, and after the script that made a change reads again only the anchors it touched (anchor-placement.js, `settle`): placed again, kept, or no longer standing; it tells who draws from it which threads changed (`hearPlaced`). The anchor paint indexes placement's segments rather than walking live ranges, replaces only the changed threads' highlight ranges and their text nodes' pieces, each node once (`replace`), and asks placement to settle before a hit; it reads no mutation. Placement's segments are its own again (resolved-target.js, `targetSegments`), its ranges only what the anchor paint paints, and a reading that moves a passage within its text counts as a change though its ranges moved with it. `rangePieces` and the anchor paint's re-read bookkeeping go. Where a passage starts (C). A passage was travelled to, and asked whether it showed, by its first piece, so search left a match's start at -500 px while its tail in a shadow stage showed, and the thread walk left a 2,501 px first piece's start at -500 px. `passageStart` (passages.js) is now the line the first piece starts on, found by halving the piece a character's box at a time, and search's visibility test asks it too: the start is brought into sight, and a one-line passage under a panel at the window's foot still counts as covered, as test_thread_travel_keeps_its_passage_above_the_bottom_ reading_clearance holds (one character alone counted as shown beside the panel). B, re-reads over 80 pointer moves beside the counter, in Chromium: 2,560 at 32 marks and 4,096 at 512 before, 0 at both after. Per move without the counter: 0.46 to 0.59 ms, with the same 2 character-box reads, 1 `elementFromPoint` and 1 caret lookup. Tests, each failing on 216b6ae in Chromium and Firefox: - test_a_mark_whose_text_node_lost_the_words_before_it_is_still_found (A); - test_a_mark_whose_text_node_a_script_replaced_is_found_in_the_new_one (D); - test_a_mark_whose_words_a_script_broke_up_is_marked_no_more (D); - test_a_search_match_whose_end_shows_is_brought_to_its_start (C); - test_travel_to_a_thread_on_a_tall_passage_shows_where_it_starts (C). The moved-words press, cancelled hold, split node, revision, shadow stage and no-rebuild tests still pass.
…ge; travel goes to a passage's first drawn line Placement re-placed a thread only where a change touched the text nodes its last successful match stood in, so what a resolution depends on beyond those nodes went unheard. In Chromium and Firefox, on 58753e4: - words a script took out of a marked phrase and, in a later task, put back left it unmarked (#1); - a second copy of a quote written in its section, with no context to tell the two apart, left the first marked (#1); - a word prepended inside a declared shadow stage a passage runs into left both pieces marked, since the native walker never reached the page's piece before it (#2); - an element inside a passage made contenteditable, which fences it, left it marked, since the watcher reported only text writes and child lists (#3). Each was a mark a fresh resolution rejects, or one it finds that wasn't painted. The page's index of quotes (passages.js, `trackQuotes`) now holds what a quote's resolution depends on: every copy of each quote the threads name, placed or not, and the words a resolution read beside a copy to tell copies apart (`near`). Copies are found by hashing their letters, so one pass over the page finds every quote's copies, where a pattern apiece searched the whole page, once per thread (#4). Between readings the index is carried through the span the two readings differ in (`changedSpan`), which compares the readings themselves, so text, edges, fences and the order the walk reads the page's trees in all count, by the reading's own rules: copies outside the span stand, shifted past it, and the span plus the widest quote's letters before it is searched again. The words watcher no longer interprets which nodes a change touched; it says the reading changed, and which text nodes a change wrote or took out, whose live ranges the DOM moved even where the page then reads the same. Placement places again, after the script, the threads whose quotes the index says changed (`quotesChanged`) and those whose text nodes were rewritten, placed before or not. `runsOn`, the native walker and the per-reading, per-section regex cache go. A thread that comes to stand where the last paint marked nothing for it, and didn't choose to (a resolved thread, a drawing), is painted by a presentation, since only a paint of the page knows where it falls among the marks (anchor-paint.js, `replace`). Overlapping copies still collapse into the first. What changes: the regex's lead consumed its text whether or not the rest of the quote followed, so a lead that failed, or crossed a fence, hid a real copy starting inside it; now only a copy does. This reaches only quotes that overlap themselves. Step 0, a paragraph holding N marked passages, toggling a leading space (Chromium): - origin/main (6cc574a): the edit searches nothing and its next presentation searches each quote over the whole page: 32/512/1,600 searches, 24k/6M/59M characters, 4.8/127/1,077 ms. The merge base (6b3159d) is the same. - 58753e4: the edit runs those searches (reviewer's measure 0.5/7.5/42 ms). - Now: 0 searches; the edit takes 0.75/2.5/6.4 ms, which at 1,600 is re-placing the 1,600 threads whose node the edit rewrote. Pointer moves: 1.17 to 1.27 ms at 512, 3.29 to 3.32 at 1,600; the scaling page's 1,600-section edit 9.0 to 7.1 ms, moves 1.58 to 1.44. - Each script task that changes the page's words now builds the page reading once, for the index to compare: 0.3/2.2/6 ms at 32/512/1,600 sections. A counter redrawn every frame far from any mark costs 1.5 ms more a frame at 512 sections and 5 ms at 1,600. - A presentation on the 1,600-mark paragraph still takes about 0.9 s, on main too: the inventory keys each passage's row by reading its whole block (`passageRow`). - B, threads placed again over 80 moves beside a counter: 0 at 32 and 512 marks. Where travel lands (#5, #6). `passageStart` read a passage's first line down the page, so in vertical-rl it returned one character and `t` left the column at y 765-1165 in a 900 px window, and it took the first segment even where it draws no box, so `t` left a passage whose first words are display:none at y 1,685. It now takes the first segment the browser draws a box for and reads its line along the block axis of its writing mode. Tests, each failing on 58753e4 in Chromium and Firefox: - test_a_mark_whose_words_a_script_puts_back_is_marked_again (#1); - test_a_marked_phrase_a_script_writes_again_is_marked_no_more (#1); - test_words_a_script_puts_inside_a_passage_s_shadow_stage_unmark_it (#2); - test_a_passage_a_script_makes_editable_inside_is_marked_no_more (#3); - test_travel_to_a_thread_shows_the_first_line_its_passage_draws, vertical and hidden start (#5, #6). Runtime: a kept quote answers each of nine changes as a fresh pass does, and the quotes the index says changed are those whose answer did; a change beside a told-apart copy changes its quote. Each fails with the window search, the fence or segment comparison, or the `near` check taken out.
…margin keys a block's passages from one reading of it Placement compared the readings after every script that changed the page's words, so a counter redrawn each frame far from any mark built the page's reading every frame. It now keeps the reading it last read and compares once, when a reader asks where things stand: the hit test, once a frame, a presentation, or the thread walk's pass. A change that writes or takes out the text a placed passage stands in is still settled after its script, since the DOM has moved that passage's live ranges and its marks no longer show where it is. The hover's frame now settles before it asks whether anything is marked, so a change that makes the page's only mark is found by the pointer coming onto it. A counter redrawn every frame far from the one mark, Chromium, ms a frame: - pointer still: 4.4 to 2.1 at 512 sections, 10.4 to 4.5 at 1,600 (58753e4: 2.3, 4.4); - pointer moving over the mark: 5.1 to 4.8 ms a move at 512, 10.5 to 10.6 at 1,600. Each hover frame finds the reading changed and builds it, 6.5 ms of the move at 1,600. The margin keyed each quoted passage's row by reading everything in its target before it, and named each row's target by reading the target again, so a paragraph holding N quoted passages read the paragraph N times over (`passageRow`, `addressableLabel`, `excerptWords`). Each target is now read once a pass: where every passage starts among its words is heard as they are read (`quoteFrom`'s new `visit`), every place each passage's words stand is found by one pass (passages.js, `findEach`, on the hashes the quote index uses), and a target's label and outline subject are made once. The key is unchanged: on 400 random paragraphs of repeated words, elements, breaks and whitespace, every key matched the old definition's. A presentation of a paragraph holding N marked passages, against main (62cb54f): - 32/512/1,600 marks: 2.3/104/1,070 ms to 1.6/12/37 ms; - the first after an edit: 3.4/127/1,119 ms to 2.3/13.5/38.5 ms. An edit moving all 1,600 passages still takes 293 ms, 255 of it the margin laying out its rows again (`layoutMarginRows`). `sliceHash` failed the type check on ef30845: formatting moved a cast over the whole expression after the check had run. Tests: the four placement reproductions now rest the pointer, a reader, before reading the marks; they still fail on 58753e4. A runtime test holds `findEach` to `indexOf` on overlapping copies, strings alike past their first hash, and astral text.
…and the browser take a quote's copies alike Freshness at the read boundary (#7). A read returned placement as it stood, and settle returned before the watcher delivered the task's own changes, so the thread walk sorted a thread by a passage a script had since put back (it opened Alpha, below Beta), and a press in the task a script repeated a marked phrase opened its thread. Every read now settles first (`placedAt`, `pendingAt`, the hit test, a presentation), and settle takes the watcher's undelivered records (passages.js, `catchUpWords`). A view reading placement as it draws hears what changed after the script, so a draw changes nothing another has read. The eager settle for rewritten text stays, since no reader draws the page's marks: the browser paints live ranges the DOM moved. The hover frame's settle stays too: it runs before the frame asks whether anything is marked. What a quote's resolution reads, and how each reaches settle (#11): - the page's reading (words, edges, fences, tree order, each word's block): the index compares readings; registry vocabulary and settled slots now notify like any change; - text nodes a change wrote or took out, whose ranges moved and which may have moved into or out of a section at the same reading place: the index counts them changed wherever both readings hold them, which replaces placement's own set of rewritten threads; - the section, found by id: the watcher hears `id` (no change to the reading) and the ids of added and removed elements, and placement places again the threads naming those ids and those standing under an element whose own id changed. Swapping two sections' ids moved the cached placement nowhere; it now follows the id; - messages and the draft: application state, read by a presentation; - a datum's source, identity and revision attributes and draw report: the presentation that follows a widget's draw. The index's changes are versioned (`quotesChanged(since)`), so each reader asks for those since it last asked rather than draining one shared set. One rule for a quote's copies (#8). After a fence parted a copy, the browser looked for the next copy inside it, while the file looked past it, so `AA` in `<p>A<span contenteditable>AAA</span></p>` was the span's first two letters in the browser and its last two in the file. Both now take copies in order within the section, each one past the last, a fenced copy keeping its place and being no candidate, which is what the file and the browser before this branch did. tests/quote_cases.json holds both runtimes to nine cases (fences, overlaps, context, scope, edges, gaps, blocks). Keys that part strings sharing a long start (#9). The second key hashed a quote's first 256 letters, so 1,600 quotes sharing a paragraph's wording and differing at a numeric suffix read every one at each copy. It now hashes the whole quote, grouped by length, so a place costs a hash per distinct length among strings sharing its first 16 letters. `findEach` on 32/512/1,600 such strings: Chromium 1.1/58/543 to 1.1/5.9/14 ms, Firefox 1/17/86 to 2/13/34 ms. The first line across text nodes (#10). `passageStart` returned the first drawn segment's line alone, so a vertical-rl column whose opening `A` stood in a span left the column at y 765-1165 in a 900 px window. The line now runs on through the segments after it until a character stands on a later line, within one tree; a character drawn in no box stands on no later line. Unchanged against 8fa11f8 (Chromium): presentation of 1,600 marked passages 37 to 35 ms; edit 290 ms both; the 1,600-section edit 13.3 to 11.2 ms, move 2.0 to 1.6 ms; a far counter 4.1 to 4.0 ms a frame. Tests, each failing on 8fa11f8 in Chromium and Firefox: - test_the_thread_walk_reads_threads_where_a_script_left_them (#7); - test_a_press_in_the_task_a_script_repeats_a_marked_phrase_opens_nothing (#7), read once, since a later presentation hid the fault from a polling assertion; - test_a_quote_follows_its_section_s_id_to_another_element (#11); - test_travel_to_a_thread_shows_the_first_line_its_passage_draws[vertical-across-nodes] (#10). Runtime: anchor-placement.test.mjs compares placement with a fresh resolution after 2,000 seeded changes (words written, cut, repeated and restored, fences, id swaps and renames, wraps, moves, identical replacements), read in the changing task and after delivery; quote-cases.test.mjs and test_a_quote_resolves_where_the_browser_resolves_it run the shared cases; a `findEach` test bounds the reads of strings sharing a long start. Each runtime test fails on 8fa11f8.
…are found by one automaton; an inline edge is no gap between words The draft (#12). Placement tracked what a posted thread's anchor depends on and nothing of the draft's, so on a page with no threads yet a script that rewrote the paragraph around a sentence the user was commenting on took the draft's mark off the sentence until the next presentation, and `pendingAt()` returned the passage in the old, now disconnected node. The draft's anchor now stands among the threads' under a key no thread bears: its quote in the index, its section among the ids, its text nodes among those a rewrite settles at once. Placement tells those who hear it whether the draft moved, and the anchor paint repaints the draft's mark from `pendingAt()`. Ids in staged trees (#13). The watcher read the ids a change added or removed with a light-tree `querySelectorAll`, so a widget whose shadow stage held a section, replaced by one staged with the same section before it was put in place, left a section-only thread on the disconnected old element. Ids are now read in the light tree and the declared shadow trees an id is looked for in (`shadowRootsIn`, as `elementById` does). One automaton (#14). The index found copies by hashing each quote's first 16 letters and then its whole length, so at each place the first hash matched it tried every length the quotes sharing it came in: 800 quotes of growing length sharing a run of x's took 4.3 s in Chromium and 9.6 s in Firefox, about 8x per doubling. An Aho–Corasick automaton over the quotes' letters (`automatonOf`) now finds every copy of every quote in one pass, in time with the text, the quotes' total length and the copies found; the matcher reads each copy's words against the page and keeps the fence and context rules on top. No maintained dependency fits: the automaton is 70 lines and runs over a window of the page's letters that a dependency's string API doesn't take. The hash keys, their buckets and `keyStarts` go. `findEach`, Chromium then Firefox: - #9's shape, 1,600 quotes alike but for a number: 14.2 to 12.1 ms, 36 to 12 ms; - #14's shape, 400 and 800 quotes: 515 and 4,258 to 2.5 and 8.3 ms; 1,193 and 9,620 to 2 and 8 ms. The 1,600-mark page is unchanged: presentation 38.9 to 38.5 ms, edit 292 to 290 ms, startup presented at 1,281 to 1,238 ms. The 1,600-section page's edit varied 6.5-11.9 ms on de675ba and 6.5-13 ms here over three runs each; its move 1.2-1.8 against 1.4-1.8. Word gaps (#15). The raw reading held an edge between any two text nodes and a quote's gap matched one, so `one two`, rewritten as `<span>one</span><span>two</span>`, which reads `onetwo`, stayed marked in both browsers while the file's reading detaches it. The raw reading now holds a space wherever the reading reads one (a line break, a block's end: `readSegments`' rule), an edge only between inline elements, and a gap must hold whitespace: an edge may stand in a gap or inside a word, never be one. A quote across two blocks no longer runs their words together (`boldtext` over `bold` and `text` blocks), as in the file. Page search takes the same gap. tests/quote_cases.json gains both cases, a line break, and an inline-edge word. Of the gaps the review named, a line break and a block's end are spaces in both readings; `display: contents` and generated content are style, which neither reading reads. On the 25 example pages, 7,055 quotes captured across each pair of adjacent text nodes all resolve to their own words, or are repeated. Tests, each failing on de675ba in Chromium and Firefox: - test_a_draft_s_passage_keeps_its_mark_when_a_script_rewrites_around_it (#12), read once; - test_a_section_staged_again_in_a_new_widget_keeps_its_thread (#13); - test_words_a_script_sets_in_elements_of_their_own_run_together (#15). Runtime, each failing on de675ba: the seeded check now runs pages holding only a draft and stages filled before they are put in place, and checks the draft's placement and section-only threads after every change; two quote cases; and a `findEach` test that counts the automaton's lookups against the text and the strings' total length for both shapes. The raw-reading test now expects a space at a block's end.
…-press`), and a press there reaches that part alone" This reverts commit 2b5c9d2.
… for the click, the hand and the preview" This reverts commit 34a0ed4.
…es the pointer The containment rule read the thread's range unless the element under the pointer held the whole passage, so a link holding a passage, a titled button, a gloss and a card that previews itself all previewed the thread instead of themselves, and so did words in code or an option, which the widget takes. `aimableAt` (widget-elements.js) now says, for any point on the page, what else the user could aim at there: a control, native or ARIA (`CONTROLS`, `WORKS` less a plain tab stop), an element with a title the browser shows, one that declares `lfPreview`, or a registered widget whose content is its own (`x-content` `data` or `empty`, or verbs in `x-state`) with every member it holds. A plain tab stop, a scrolling box and a widget that only holds the author's words, as a pane or a tab, take nothing. The pointer and a held finger read the range only where it answers nothing (preview.js, `readingAt`); focus rests on an element and reads it, never a range. The hold keeps the node, element and range layers the pointer keeps, so it reads through the same rule. Presses are as on main. Behaviour that changed: - a passage inside a link, or equal to its text, previews the link; - in a titled button, only the browser's title shows; - a gloss's words preview its explanation; - words in a card that declares a preview preview the card; - a thread's words in `lf-code`, `lf-diff`, a draft or options preview nothing to a pointer or a finger; its margin entry, `t` and its Threads row still reach it. anchor-paint no longer tells the owner the thread's every mark, which only the containment rule read. `module-input.md`, "Previews", states the rule for package authors. Tests, failing on the previous commit in Chromium and Firefox where they take both: - test_a_thread_s_words_where_something_else_takes_the_pointer_preview_that - test_a_thread_s_words_in_code_or_an_option_preview_nothing_and_its_entry_does - test_a_finger_holding_a_thread_s_words_reads_what_takes_the_pointer_there (Chromium, touch) - tests/runtime/aimable.test.mjs, the function's contract at any point.
leaf-agent
reviewed
Nov 7, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
A thread on the words of an lf-suggestion no longer previews. This hits the most common thread in the suggestion flow: the user comments on a sentence, and the agent answers with a suggestion whose lf-old copies that sentence verbatim. Details are inline on ownsItsContent.
…rbs claim none of its content `aimableAt` climbed each node's light parent, so words a component slots into its titled button never met the button: a pointer previewed their thread instead of leaving the browser's title, and a held finger read the thread instead of the button's title, in both engines. It now climbs the tree as rendered (`renderedParent`), as the preview's own search does, so a slotted control, title or declared preview takes the pointer over the words it draws. It also counted a widget that declares verbs (`x-state`) as taking the pointer across everything it holds, so a thread on a suggestion's old words, the most common thread in the suggestion flow, a playground's preview or an option's words previewed nothing. Verbs say what a widget records, not that a press on its content acts; accept, reject and an option's mark are their own controls, which `CONTROLS` already finds. A widget's content now takes the pointer only where the widget draws it (`x-content` `data` or `empty`) or a control in it holds it. A press there does what it does on main. `module-input.md`, "Previews", states the rule without the verbs. Behaviour that changed: a thread on words in a suggestion's `lf-old` or `lf-new`, a playground's preview or an option's words beside its mark previews the thread, to a pointer and a finger; words slotted into a titled button show only the browser's title and a finger reads the title. Tests, failing on the previous commit in Chromium and Firefox: - test_a_thread_s_words_slotted_into_a_titled_button_read_as_the_button, by pointer and hold, with words slotted into a plain span as the control; - test_a_thread_s_words_in_a_widget_preview_it_unless_the_widget_draws_them, which replaces the option half of the code-and-option test: an option's chip, a suggestion's old words and a playground's preview preview their thread, a link in an option previews the link, code previews nothing and its margin entry previews it; - test_a_finger_holding_a_thread_s_words_reads_what_takes_the_pointer_there, now in both engines, holding a suggestion's old words too; - tests/runtime/aimable.test.mjs: an option's words and a suggestion's take nothing, its mark takes the pointer, and slotted words reach their slot's titled button.
leaf-agent
approved these changes
Nov 7, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 7, 2026
…inter, for elements and ranges This merges ef6c01e into the chart branch. The branch had last merged main at 1d5249c and shared no thread-branch commits, so main's side came in whole. Only `preview.js` conflicted. Main's range layer (`over`, `ranged`, `aimed`, `readingAt`), its hold model (`element`, `node`, `range`, `showHeld`) and its show signature (`read`, `at`) are kept. This branch's owner changes are carried on top: a new aim keeps its side and edge where the reading fits whole; a point's preview lets the pointer through; `PREVIEW_ENDED` carries `detail.declared`; a hold's reading is recorded once, in `show()`; and the pointer's place on a preview is judged at every move. What takes the pointer, and whether the pointer is on a preview, each now have one answer. What takes the pointer at a point beneath a pass-through preview is now asked of `aimableAt` (widget-elements.js), main's single answer to that, through `aimedAt`, and the skip for ancestors the subject shares no longer applies to that question. A card a press opens around a chart now takes the pointer from the chart's reading, so the card's preview shows. Before, it counted as a structural box and the reading stayed over it in both engines. Inert words in a scrolling or focusable box take nothing, so a reading over them stays. Placement keeps its own question: what a press must still reach (`keepsAccess`, with the skip for the boxes the subject stands in). That is wider than what the pointer takes. Moving placement onto `aimableAt` let previews cover code that scrolls, a tab panel and a frame, which `test_a_preview_leaves_a_region_the_user_works_in_reachable` caught in both engines. The two questions now share a hit test (`hitAt`) and differ only in what they ask of what it finds. Whether the pointer is on a preview is one decision (`onPreview`) for element and range previews. It reads the node under the pointer, so `pointRange(null)` asks it in place of its own `under(beneath, tip)` check. A range preview standing over what it covers, which lets the pointer through, now stays while the pointer is over it on unmarked words. Before, the range's owner reporting no range put it away in both engines. Behaviour that changes with `aimableAt`: a plain tab stop takes nothing, so a pointer over a focusable region beneath a pass-through preview keeps the preview. That case leaves the targets test. Placement is unchanged. New tests, each failing on the merged runtime before the change, in both engines: - `test_a_card_s_words_beneath_a_reading_reach_the_card`. - `test_a_covering_range_preview_stays_while_the_pointer_is_on_it_over_inert_words`.
max-sixty
added a commit
that referenced
this pull request
Nov 7, 2026
…nd them (#5629) Five PRs landed on `main` without the full push suite: #5614 (the preview owner), #5615, #5616, #5618 and #5617. Main's push `ci` run at 4248d1f ([42246533122](https://github.com/max-sixty/leaf/actions/runs/42246533122)) fails about 50 tests that the run at its parent 62cb54f ([42203695127](https://github.com/max-sixty/leaf/actions/runs/42203695127)) passes, and they still fail at ef6c01e ([42320062138](https://github.com/max-sixty/leaf/actions/runs/42320062138)). Run singly here, every one of them but three fails at 84d9186 and passes at 62cb54f; the three are at the end. This branch fixes the code where the PRs did something worse for a user than their own rules say, and updates the tests that asserted behaviour the PRs replaced on purpose. ## Code: three gaps between #5614's rules and its code - **A thread card previewed its own name.** `preview.js` counted every element wearing `data-lf-offer` as a control, and Leaf writes an empty one on chrome that presses nothing. A pointer resting anywhere in a thread card showed "Thread, Keep this review note…" over the words it repeats, and a `t` walk landing on a card already on the page showed it too, which took the Escape that lets go of the thread. A control is now any native or ARIA press (`PRESSES`, `control-selectors.js`), ranges and selects included, or a custom control whose `data-lf-offer` names its press (`PRESSABLE`). Thread cards, messages, resolved groups, toolbars and status or layout chrome preview nothing of their own; an element's own `lfPreview` is read either way. `test_a_range_and_a_select_preview_their_names_and_a_thread_card_none` holds both halves in both engines. (The branch's first try at this used `PRESSABLE` alone, which also dropped the previews of Leaf's own ranges and selects, since they wear an empty `data-lf-offer` too.) - **A reaction's disclosure took an extra Escape.** Enter on a reaction's glyph puts the user on its revealed Undo with a `move`, which `preview.js` reads as the user's own move, so the Undo previewed and the first Escape only put that away. `keyboard/AGENTS.md` ("Escape") says focus a surface places as it opens costs no Escape. The disclosure now says it opened (`layerOpened`) before placing focus. - **The command reference stopped running Resolve and Copy message.** #5614 made `r` and Mod+C press the thread's Resolve and the message's Copy as their `control`, with no `run`. The reference's own reading of which rows it can run left that case out. It now runs what the row's key runs, the control's press included. On the PR walkthrough exactly those two rows change. ## Tests: behaviour the PRs replaced on purpose - **Titles became previews.** Leaf's controls write no `title` on Leaf. Tests that read a held-news notice's label as its accessible description, or a title on an All pages row, a diff row's path, an On me choice or the joined notice, now read the element's preview declaration (`expect_preview_words`). - **A focus preview is Escape's first step.** Tests that expected one Escape to close the surface a focused control stands in now put the preview away first, with a new `put_preview_away` helper, then assert the step they protect. The inline sites #5614 and the key-scope commit wrote use the helper too. - `test_key_scopes.py`'s two tests: the branch's first commit, as before. - `test_an_age_previews_its_clock_time_in_the_reader_s_zone` (#5618) passed only through the thread-card name preview above. It now asserts the keyboard's clock-time preview stays visible, on the focus route, with its words, while the pointer rests on the message. - Four nightly journey tests read the same titles: `test_render_anchors`, `test_render_threads` and `test_website_server` now pass. ## Still failing, and why - `test_obligation_contextual_bindings_are_independent_of_widget_bindings`: #5614 made a control's `aria-keyshortcuts` the union of every key that presses it (`controlShortcuts` in `scopes.js`, `reflectElementShortcuts`). It now names `x` and `y` on the obligation, where only `3` reaches the control, and `x` where a nearer dead declaration takes `x` from it. `bindings.js` still says the attribute describes the dispatcher's currently reachable routes, nearer reservations included, while `control-keys.js` says every key chip's key is in it. Which contract holds is a decision; the test is unchanged. - `test_a_playground_opens_its_instruction_over_the_page`: after the preview on the instruction's Copy is put away, the next Escape leaves the instruction popover open and only the one after closes it. The lost Escape reproduces in a probe at 84d9186, and is being fixed on a separate branch. - The three Leaf-fold tests in `test_render_floating_panel.py`, and `test_threads_holds_a_row_that_joins_or_moves_behind_a_notice` (since #5618): each passes its assertions and errors at teardown, because the shift watch reports the preview's words moving without input as the preview rides its traveling target. The preview follows its target natively (`position-anchor: auto`, `showPopover({source})`), but the watch finds anchors only by name. Teaching the watch the implicit anchor didn't remove the finding. - `tests/journeys/test_render_files.py::test_file_editor_saves_quietly_and_preserves_inflight_edits`: passes its title step now, and since #5617 fails earlier: the editor's gutter moves without input after an external file update. Not traced further. - #5617's own push run ([42343843769](https://github.com/max-sixty/leaf/actions/runs/42343843769)) hadn't finished, so its breakage beyond the file journey is unknown. Two candidates are not from these PRs: `test_a_changed_diff_file_keeps_its_sideways_reader` and `test_trace_tree_opened_by_the_browser_keeps_its_match` each failed in one run only and pass singly at 84d9186, as does `test_tab_at_a_control_scrolled_away_goes_on_in_the_column_the_pointer_is_in`. ## Checks - Each changed browser and journey test, singly, at the branch head: passes, both engines where a test takes one, except those listed above. - The preview, reference, key-scope and reaction tests near the code changes, singly: pass. - `leaf-dev probe --base`: the notification playground's slider previews "Concurrent release events" in Chromium and Firefox, and the motion playground's Time slider and speed select preview as at 84d9186. - `pnpm run check` and `pre-commit run --files` on every changed file: pass. > _This was written by Claude Code on behalf of max-sixty_
This was referenced Nov 7, 2026
Closed
leaf-agent
added a commit
that referenced
this pull request
Nov 8, 2026
…5701) The nightly journey `test_a_wait_takes_the_suites_deadline` has failed since scheduled run [42365682113](https://github.com/max-sixty/leaf/actions/runs/42365682113). It found 24 waits with literal 2 s or 3 s timeouts, added by #5617 (`test_previews.py`, `test_charts.py`) and #5618 (`test_render_anchors.py`). This PR drops each `timeout=` argument, so those waits take the suite's default deadline (`SERVED_TIMEOUT_MS`, which `render_harness` sets). What each wait waits for doesn't change. The literal values were sized to a fast machine, which is why the check rejects them. Verification on main `fcad5fa09`: the check fails before this change, listing all 24 sites, and passes after it. The 19 browser tests that hold those waits pass under `--run-main` (42 cases). The same check went red for the same reason on Nov 5, and #5455 fixed that. It's a 2–6 s static scan of the test sources, but it lives in `tests/journeys/`, which only the scheduled run reaches. So a pull request that adds a literal deadline passes its own CI, and main finds out the next day. The durable fix is to run this check on every pull request; I'm filing that separately. Refs #4225 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 8, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 8, 2026
The branch had merged dcb34de, an early head of the preview-owner work that later landed reworked in #5614 and #5618. A merge from the old base (6b3159d) would keep lines that round added and a later round removed. So this merge replays the branch's own change since dcb34de (its first-parent change-attribution commits, the three early ones thread previews carried and dropped included) onto main: the tree is `git merge-tree --merge-base dcb34de origin/main 7d282ed`, recorded with main as the second parent. Two conflicts, both import lists: change-walk.js takes main's `selectedBase` and comment beside the branch's provenance imports, and test_changes_in_place.py imports main's `told` beside the branch's `example_media` and `preview_parts`. The changed lines of `git diff origin/main` match those of `git diff dcb34de 7d282ed` apart from those two import lines. Main is still at protocol 42, so the branch's 43 stands; `pnpm run build:browser` leaves the baseline and every vendor bundle as merged.
This was referenced Nov 9, 2026
Closed
max-sixty
added a commit
that referenced
this pull request
Nov 17, 2026
… time as the reader's browser writes it (#6226) A thread message head now says "just now" or "12m ago" while the message is under an hour old, then its time of day and day as the reader's browser writes them ("3:24 PM", "Yesterday 3:24 PM", "Nov 13 3:29 PM"). Before, every head was a hand-built 24-hour clock from the first second, so a reply seconds old read "15:24", and a US-English reader saw a form their own Mac doesn't use. The age-and-time preview, pinned to American English with a 24-hour cycle, now also takes the browser's locale ("Sat, Aug 15, 2026, 2:02 PM PT"), and the floating panel's error times call the same `timeOfDay` formatter in `presence.js`. The user chose the one-hour cut over chat apps' time of day from the start, "just now" for the first minute only, and feeds' ages until yesterday: within the hour an age is as exact as a clock to the minute, and past it an age rounds to hours, so replies minutes apart would read alike, which #6097 moved away from. This reverses the record #5618 and #6097 kept that a fixed day-month order and 24-hour clock read one way to every reader. `ago` now picks its unit by the rounded figure, so an age never reads "60m ago" or "24h ago", and a head switches to its clock at the moment its age would turn to hours. Asked for by the user on a Leaf page; a fresh reviewer read the Firefox before/after captures, and Codex reviewed the diff. Tests: `elapsed-time.test.mjs` covers the hour cut and rounding boundary (its locale cases run where the platform reads American English); the browser tests reading a head's time or preview pin `locale="en-US"`; `pnpm run test:runtime` and the type check pass. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Nov 26, 2026
…in a marked element (#7322) A thread on a whole element, such as an open item's section, was under the pointer anywhere inside the element's box: a pointer resting in the section's empty band margin previewed the thread and showed the hand, and a click on any of its words opened it. Elements draw no mark for their threads at rest (#1424), so this was an invisible target the size of the section (1672 × 810 px on the page that reported it). The hit test in `anchor-paint.js` now finds passage marks alone; an element's thread is reached by its margin entry, which already previews it, opens it and traces the element. To weigh: a click on an image or figure that holds a thread no longer opens that thread. #1448 removed the hover contour from elements for the same reason; #5618 had brought the section-wide target back through the preview. Tests that pressed an element to open its thread now press its margin entry or anchor to a passage; the press/tap seam tests straddle two marked lines (`MARK_SEAM_PAGE`). The user asked for this on their Leaf page. > _This was written by Claude Code on behalf of max-sixty_
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.
Pointing at a thread's passage, where nothing else there takes the pointer, or at its margin entry or its row in Threads now previews the thread: its name, who wrote its last message and when, that message's opening line, and where the thread stands ("Your turn · 1 unread · 2 messages"). Keyboard focus on the entry or the row reads the same preview, and a finger reads it by holding. An age such as "82d ago" previews its clock time in the reader's zone ("Sat 15 Aug 2026, 14:02 PT"), and packages get the same preview from
agePreviewin the widget API. Underneath, a thread's mark stays on its words as the page's scripts and revisions move them, at a cost that follows the change rather than the page's size, and a quote or a page search matches words where two inline elements meet, whether the page draws them as one word or two.Where each passage stands
browser/runtime/anchor-placement.jsis the one record of where each thread's passage stands, and the draft's. Every read settles first (settle, reached throughplacedAt,pendingAt, the hit test and a presentation) and takes the changes the page's watcher still holds, so no reader sees placement older than the page. The file's header lists what a quote's resolution depends on and how a change to each reachessettle.The page's index of quotes (
passages.js,trackQuotesandquotesChanged) keeps every copy of each quote the threads name, placed or not, and the words a resolution read beside a copy to tell copies apart. After a change it compares the old reading with the new (changedSpan) and searches again only the span they differ in (carry), so placement places again only the threads whose quotes changed, whose section ids moved, or whose text nodes a change rewrote. Copies are found by one Aho–Corasick automaton over every quote's spelling (automatonOf,scan,findEach), in one pass over the page however many quotes there are. No maintained dependency searches a window of the page's letters, so the automaton is written here.annotation-overlay/anchor-paint.jspaints from placement (hearPlaced) and finds the mark under the pointer with one caret lookup and an index of the stretches each text node's marks cut it into (markHit).highlightsFromPointwould read every range on the page on each move;notes/browser-support.md("Highlight hit testing") records its cost and how to recheck it.tests/runtime/anchor-placement.test.mjscompares placement with a fresh resolution after seeded runs of the changes a page's scripts make.One reading walk with link previews
Link previews (#5616) and this branch read the page with one walk in
passages.js: link's outline recording rides the same walk that carries the element each run of words is read in. One watcher (hear) forgets the reading of each document a change touches and tells the page's hearers, the quote index and placement, what changed. Onephrasingpredicate, built from the kernel registry's$passages.phrasing, answers both the walk'senterand link'srunsIntoLine, andtests/runtime/passage-boundaries.test.mjsholds the two to the same answers.The file and the browser read alike
The file's reading (
src/leaf/passages.py,src/leaf/anchor_capture.py) confirms the quotes an agent comments on and places threads across a revision; the browser's (passages.js) captures, marks and searches them.tests/quote_cases.jsonholds both to the same answer on 34 cases (fences, overlaps, context, edges, gaps, blocks, staged shadow trees, said values, slots, whitespace), run bytest_a_quote_resolves_where_the_browser_resolves_itin Python andtests/runtime/quote-cases.test.mjsin the browser runtime. Both split a quote into words, and find the gaps between them, by the registry's$passages.collapsealone, so a character only Python calls whitespace, such as U+001E, is a letter in both. A widget's verbatim reading (x-verbatim) is written from the page's reading, every space where that reading put one.Where two inline elements meet
A quote and a page search now match across the place two inline elements meet with nothing between them, with or without a space, in both readings, since only the page's CSS says whether
<strong>Status</strong><span>Ready</span>shows one word or two. The end of an element outside$passages.phrasingand a<br>stay real gaps that a quote can't run across. A survey of 657 retained pages found 2,918 pairs of words drawn apart that the reading joined, on 183 pages, more than half of them in Leaf's own widgets (lf-option's chips and title, lf-trace, lf-timeline). A search with a space between found 228 of those pairs before this change and finds all of them now.$passages.collapse,blocksandphrasingdecide the words a capture logs, and$passages' description now says a change to any of them bumps$events.protocol; none of the three lists changes here, so the protocol stays at 42. The 267 quote anchors in the logs of 113 retained pages attach to the same words as on main, in the file's reading (checked at this head) and in Chromium's (checked when the edge rule landed).The words a reading shows, as distinct from the words it matches (a captured quote, an accessible name, an excerpt), show such a meeting as main does: a space where two elements outside any text block meet, as a chip meets its title, and nothing inside a text block, so
set<em>up</em>reads "setup" (shownApartinpassages.js, the soft space inpassages.py's_write). Shipped examples, docs and widget templates now put whitespace between a chip, label or code and the words after it.Range targets on main's preview owner
The preview owner (#5614) landed with its range targets moved out to this branch beside their one caller. They come back onto main's
preview.jsas the owner had them:pointRange,holdRange,sameRange, the Range branches ofreadFrom, and the line a range's preview stands by.anchor-paint.jsis the range owner: it tellspointRangewhich passage the pointer rests on, only on the user's own pointer input and only when the threads under the pointer change. It tells the piece the preview stands by, the one the pointer came onto. The owner keeps that range as a layer of its own (ranged) beside the element under the pointer that previews itself (over), and reads one or the other by the rule in the next section, so the pointer leaving a link for the passage's words is on the passage again, though nothing tells the owner anew. A finger's hold on a passage follows main's hold: it reads at the platform's long press, and its release presses nothing.Where a thread's words preview the thread
A thread's words preview the thread only where nothing else at that point takes the pointer.
aimableAt(widget-elements.js) answers, for any point on the page, marked words or not, what else the user could aim at there: the nearest element around it as the page renders it, through the slot that draws it, that is a control, native or ARIA (CONTROLS, main'sWORKSless a plain tab stop), carries a title the browser shows, declareslfPreview, or is a registered widget that draws its content itself (x-contentdataorempty). A plain tab stop, a scrolling box and what a widget holds of the author's markup, outside any control in it, take nothing: a pane's words, an option's words beside its mark, a suggestion's old and new words, a playground's preview. A widget's verbs (x-state) say what it records, not that a press on its content acts. The pointer and a held finger read a thread's range only whereaimableAtanswers nothing (readingAtinpreview.js), and otherwise the element there that previews itself, or nothing. Focus rests on an element and reads it, as on main, never a range.So a passage inside a link, or equal to its text, previews the link; in a titled button only the browser's title shows; a gloss's words preview its explanation; and words in a card that declares a preview show the card's. Words a component slots into its titled button show only the browser's title. A thread's words in
lf-code,lf-diffor a draft preview nothing to a pointer or a finger, and the thread is reached by its margin entry, which previews it, bytand by its row in Threads. Words in prose, a plain tab stop, a pane, a suggestion, a playground's preview or an option beside its mark preview their thread.module-input.md("Previews") states the rule for package authors, and the chart branch's target can askaimableAtonce this lands.Presses are as on main. A press on a thread's words opens the thread unless main's
WORKSboundary keeps it for a control or a region, so a tap on a thread's words in a plain tab stop or an informational card opens nothing, in Firefox as in Chromium, and a press that main gives both a widget's action and the thread, as a gloss pinning its explanation, still does both (see "Left for later").Fixes from review
id(frame)after the element closed, which Python reuses, and an element's firstbeforeand firstaftersaid values by one key. So<small>reversible</small><strong><em>Heat</em></strong>could readreversibleHeat, and a comment the browser captured on a formatted label was Not found after a revision instead of moving to its section.pointRange(null)now leaves a preview the pointer is on standing, as the owner does for an element's preview.floating-panel.js,runOfClicks) now refuses a click only where it lands on another control than the run's last press and the panel has drawn since that press began (draws, counted inpaintPanel). It exists for a control that comes under a still pointer because the last press changed the panel, and a double or triple click on ‹ still goes back once. Main's guard refused every click in a run that landed on another control than the last click the panel received. A finger's hold that reads a preview presses nothing, but Chromium counts it into the run, so the tap after it was refused: on the row the finger held, and on Close 6 px beside a held Search, which main refuses too. The hold draws nothing in the panel, so that tap now goes through.return, as the menu's way back already does, so the row shows no preview until the user steps onto it.<lf-shell><div><b>Status</b>Ready</div></lf-shell>readStatusReadywhere the page readsStatus Ready, andpage check --renderflagged a correctx-verbatimwidget. It now takes the words the page's reading wrote, spaces included.<p>x A\x1eB y</p>confirmed the quote "A B" where the browser finds no copy. Both readings now split on$passages.collapse.Measured
Main-thread time in Chromium unless an engine is named, on a shared machine, against main (1d5249c). The first two were measured at 2c32d1f, whose later changes reach neither; the last two at 2c32d1f or 6d9194e and again at 73c5396, given as a range where the runs differ:
layoutMarginRows).Left for later
press-ownership(b2ac1ce) makes one press decision that every route asks (pressedControl): widgets declare the part that takes their own press (x-press, validated with the registry's other conditions) and say when they can act (lfTakesPress), and a held finger, the hand over a mark and the trace's image tools follow the same decision. Codex's findings over its four review rounds are its acceptance set. Its last review left five: the trace's canvas and the playground's preview are refused as the widgets' own content, so a Firefox tap no longer stops playback, a click pauses and also opens the thread, and the Status strip no longer selects; availability is read again after the widget acts, so one click gets two decisions; arole="button"host bypasseslfTakesPress; aregionmatch escapes the nested-boundary check; and the selector check refuses valid selectors such as:state(ready). Two cases this branch's last review found belong there too, both on main: an option's words preview its thread while a click there also picks or clears the option, and a click on a thread's words slotted into a button presses the button and opens the thread, because the page's click looks for a control without following slots (surface.js,closestAcross) whereaimableAtnow follows them.lf-gloss's hidden explanation between the words around it, so a quote of the visible sentence "static analysis of the orchestration file" onexamples/pr-walkthrough.htmlresolves to nothing. This predates the branch. A fix needs an aside passage, a range a quote lies wholly inside or skips, recorded in both readings and declared in the registry.renderedChildren. Margin layout'srenderedChildren(shadow.js) and focus.js'srenderedElements(Tab order) read every slot through its assigned nodes, so they miss the children of a slot outside a shadow tree, as the reading's walk did before this branch. One helper for what a slot draws would serve all three.pageRangeacross a shadow root. A drag from page text into a declared shadow stage falls back to the light-DOM range (native-selection.js), which in Chromium ends before it starts and in Firefox covers only the words inside the stage, so a comment made from that drag doesn't quote the words selected. Main has the same gap.