Skip to content

A link into the page previews its place: name, first lines and threads - #5616

Merged
max-sixty merged 34 commits into
mainfrom
link-previews
Nov 6, 2026
Merged

max-sixty merged 34 commits into
mainfrom
link-previews

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Pointing at, focusing or holding a finger on a link an author wrote into the page now shows a card for the place it goes to, before anything follows it: the place's name, its first lines as the page draws them now, a question's state (its answer, that it waits on the user, or its options with the pick checked), and the open threads about it with whose turn one is. It works for links in the page and in a reply's markup, through the preview owner (preview.js, "Pointing reads; pressing acts"): a press, Enter or a tap follows the link, and a held finger's release leaves the card standing. A link to another site shows nothing.

Naming: one rule with On me

A place with no name of its own is named by the part it stands in (partOver, thread/placement.js): the heading over it, else the nearest container the authoring contract names (a declared name, a leading heading or summary, a caption, an aria-label or <label>), short of the page's column, a slot, and what Leaf generates. On me groups every item under the same partOver of its subject, so the card says what a place is called and On me where it stands, and they agree wherever a place has no name of its own. A sub-heading inside a titled section heads what follows it, a section names what stands in it before its heading, and a heading in a header or hgroup heads what holds that.

The outline this reads is recorded by the page reading's walk (passages.js, outlineFold): headings in reading order through declared shadow trees and a slot's assignment, none of Leaf's chrome, and for each element what stood over it as the walk reached it. Main's partTrail, which names the headings over a thread's words, reads each heading's higher-ranked heading from the same walk.

One reading per document

passages.js keeps a reading for each document: the page's body, and each message body, which now reads as its writer's words, so a heading in a reply names what follows it. A mutation, a fence or a newly declared shadow root forgets only the reading of the document it lands in; a vocabulary or settlement change forgets them all. An element's kept words and answers stand as long as their document's reading, a message's as well as the page's. They, and the page's version that keys hold (pageReadingVersion), name a reading by its token, an empty object, so nothing a reader keeps holds a reading it has forgotten. A shadow root already watched forgets nothing when it is adopted again, so a reply's diff that loads lazily no longer makes the page be read again. The conversations On me and the card count are gathered once per reading of the threads and the page, and threads by element and obligations by id are indexed as the reading arrives.

Run-in titles, decided by the markup

A leading <strong> that words its author wrote follow before a <br>, an element outside HTML's phrasing content, or the end of the block holding it, is a run-in label: it names its own line and makes no part, so On me and the card name the part holding the line. Alone on its line, over a <br> or a container's blocks, it names that container as a part. A widget counts as phrasing only where its registry entry declares x-inline. runsIntoLine reads this off the markup through the reading's own tree (readingUnder) and its authored words, with no style read, so the answer doesn't change as a reader opens a disclosure, picks a tab or resizes. page-authoring.md's "Markup" states the rule for authors.

HTML's phrasing content is a kernel fact, $passages.phrasing. base.css's suggestion-slot rule already spelled the same list out unchecked; build/registry.test.mjs now holds that literal to the kernel's. It decides no text the log keeps, so it bumps no protocol.

The card

Each part of the card is its own line of detail, so the owner's fit keeps the parts its room holds whole, clamps the one the room ends in and hides the rest, and Chromium and Firefox make the same cut. The card declares the place as what it is about (about), so where the page shows the place, the card stands clear of it. It reads every word as the page draws it now: words a page hides, a closed disclosure's body and what content-visibility skips say nothing, and a place the page draws none of, as an unchosen tab, reads whole. The walk that reads a heading's section stops at the excerpt's bound, and each block is read only as far as the card shows it (excerpt, passages.js): up to so many characters, and a code block up to its first lines. The read says whether it cut the place short, and the card then ends the part in an ellipsis. A link to a 5,000-line log, a single 200 KB line or a deep outline costs under a millisecond to read, where it cost up to 48 ms. A link a widget draws previews nothing unless the widget declares it by returning placePreview(element), exported from widget-api.js (module-input.md, "Previews"); lf-options's section references now do.

Behaviour changes against main

  • An in-page link shows the card on every route, and the "Jump to §" title on lf-options's section references and on live section links in replies is gone in favour of it.
  • On me's bands match main's on the feature gallery and the 10 real pages surveyed. They differ where a page holds a captioned figure or table, an aria-labelled region, a disclosure, or a bold title alone on its line, each of which is now a part (the command inventory in docs/how-it-works.html has 12 such cells), or a paragraph before its section's heading, which now stands under that heading.
  • A thread head's trail (partTrail) follows the same rule, so a paragraph before its section's heading shows that heading, where main showed the page's title.
  • A heading in a reply's markup names what follows it in the card, and a reply's Markdown table headers caption its images in the media viewer.

Tests

  • tests/browser/controls/test_previews.py adds seven tests: what a link's card shows on each route, a held finger's release and a tap included; that it shows only what the page draws; that a card cut short says so with an ellipsis; that a bold lead-in runs on by its markup whatever draws it; that a reply's parts follow an accepted edit and one a card held as news; and that a thread on a whole section stands where the section does.
  • tests/browser/test_render_options.py asserts that a section reference previews its block instead of carrying a "Jump to" title, since the title is gone.
  • tests/browser/threads/test_media.py adds a reply's Markdown table naming each image by its column head.
  • tests/runtime/place-preview.test.mjs is new: the card's parts and names, shadow trees and slots, run-in titles, and partTrail through a header, nested sections and a heading that arrives late.
  • tests/runtime/passage-boundaries.test.mjs adds a message body read as its own document, each document's reading forgotten alone, re-adoption included, and a forgotten reading collected while a key and a kept answer taken under it live on.
  • tests/name_cases.json adds a sub-heading inside a titled section, which doesn't name the section, held in Python and the browser alike.
  • tests/runtime/framework-application.test.mjs gives its fixture the obligations' index by id, which the publisher now builds.
  • build/registry.test.mjs holds base.css's phrasing list to $passages.phrasing.

Trade-offs

  • A bold title that CSS draws alone on its line, such as a span styled display: block or a newline white-space keeps, still runs into its line, since the markup decides.
  • Hidden words after a bold title keep it a run-in label, since they are words its author wrote.
  • A paragraph in the card shows up to 280 characters, cut by the card's room rather than at three lines.
  • Where the place shows right below its link, the card keeps clear of it, which on a phone can leave the card a line or two.
  • A link a widget draws shows nothing until its widget declares the card.

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

…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.
Pointing at a link an author wrote to an id on the page, focusing it, or holding a
finger on it now shows that place over the page, through the preview owner
(preview.js), in the popover face lf-gloss uses: the place's name, its first two parts
as the page reads them, a question's answer or that it waits on the user, and how many
open threads are about it, with "Your turn" in green where one is the user's. A press,
Enter or the finger's release still follows the link. A link to another site previews
nothing and keeps the browser's status bar.

The rendering is new, in runtime/place-preview.js: a short reading of any block, made
from its words and never its nodes, so it repeats no id, upgrades no widget and holds
nothing focusable or pressable. By kind:
- a heading previews the section it opens, up to the next heading of its rank;
- a section or titled block is named by its leading heading and skips what stands
  above it, such as an eyebrow;
- a paragraph is cut to three lines, the name to two;
- a list, and a run of like widget members (a question's options, a board's columns,
  a set of tabs), shows its first three names and how many more;
- a table shows its caption and first three rows, up to four cells each, cut to a line;
- a figure shows its picture under its caption, and an inline drawing its title;
- code shows its first four lines, and a closed disclosure only its summary;
- a question the user answered shows its answer ("Answered: Later") in place of its
  options, as a Done row says it; an open one lists its options, then "Waiting on me".

The walk stops once it has the parts it shows, and the obligations and threads come
from indexes built once per publication (threads also per reading of the page), so a
hover costs the link and its target. On the feature gallery, the pointer's arrival on
a link costs 0.2 ms and showing the preview about 1.5 ms over a focus move to a link
that previews nothing.

Why the runtime and not the default package: an authored link belongs to no widget,
so nothing could declare its preview, and every reading it combines is already core's:
following a fragment link (anchor-travel.js), the place a fragment names
(`fragmentTarget`), the page's reading of an element's words, the names the chrome
gives elements, obligations and threads. Widgets keep their part through interfaces
they already have, an obligation's answer through their `answerWords`, so core names no
widget. A link a widget draws is the widget's to preview, since only it knows whether
its words already say what the place holds: lf-toc's rows say their heading and
preview nothing, while lf-options' § reference to the block an option names now
previews that block through `placePreview`, exported from widget-api.js, and drops its
"Jump to" title. A reply's link into the page previews too and drops its "Jump to §"
title; a reply's link to a section the version lacks keeps the title saying why.

Docs: browser/AGENTS.md ("Pointing reads; pressing acts" and the ownership tables),
module-input.md ("Previews"), and a sentence each in page-authoring.md and threads.md
saying what a fragment link shows the reader.

Tests and evidence: test_a_link_into_the_page_previews_where_it_points holds the
pointer, focus, press and finger routes, the answer and the thread foot, and that a
link to another site previews nothing; the bare-labels options test now checks the §
reference's preview instead of its title; tests/runtime/place-preview.test.mjs holds
each kind's rendering and which links name a place. The feature gallery gains a "Links
into the page" scenario, and stills a `link-preview` state on it.
…stion's pick

A link's preview built its thread index, and its obligation index, on the first hover
after either changed, so that hover paid a walk of every thread on the page, and
`threadNamed` had built its index of thread names the same lazy way since before.
The publisher now builds them where the reading arrives, beside the lists they index:
`effective.thread.named` (each name to its thread, `threadNames`),
`effective.thread.bySection` (the threads about each element, by the id their anchor
names, `threadsBySection` in thread/model.js) and `effective.obligations.byId`.
`threadNamed` and the new `threadsOnSection(id)` (thread/state.js) are lookups into
them, and the preview's own lazy caches are deleted. A thread index holds each thread's
place in `effective.thread.all` rather than the record, so a record has one home and
sharing an index against the last reading compares numbers. The preview now finds
the threads about a place by looking up each id the place holds, so its work is the
place's, where it used to climb from every thread to the root.

`leaf-dev scaling` has no hover case. On its threads axis against 64ae927 (Chromium,
8 to 256 threads, one run), load, click, keystroke, Tab, wheel and event costs stay
within the run's noise at every size: 301 against 298 ms to load and 32.0 against
32.0 ms a click at 256 threads. An earlier run, whose indexes held the records
themselves, loaded 42 ms slower at 256.

A question authored settled from the start has no obligation, so its preview listed
its options with no sign of the pick. A widget's options in the preview now check each
member its answer picks, read from the widget's own state in the application reading
(`effective.widgets`, folded from the authored initial values and every action in
force since), where its `x-awaits` verb records the pick on its members, as lf-options'
`chosen` does. A picked member beyond the first three is listed too. The check is the
one paper prints beside a chosen option (options.css).

Tests: test_a_link_into_the_page_previews_where_it_points also holds a settled
question's checked pick and a thread about an element inside the place; the
publisher's obligations test reads `byId`. The feature gallery's link scenario gains a
settled trailhead question.
…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 toward the owner's contract: preview.js is the owner's, with a link
into the page declaring the place it opens beside an element's own declaration in
`readingOf`; browser/AGENTS.md and module-input.md keep the owner's text with the link
preview's lines in it; test_previews.py holds both sides, the link test run in
Chromium and Firefox as the owner's are. The link card itself converts in the next
commit.
… up by id

The place a link into the page opens now previews through the owner's contract:
`placePreview` returns `{name, detail: [parts, conversations], excerpt: true}`, and
`readingOf` (preview.js) reads it for a link beside an element's own declaration, so
the card wears the one face in its excerpt room: the place's name on the first line,
cut to 120 characters, then its parts and the threads about it as two lines of
detail. A place with no name of its own, as a section's list or code block, takes the
name of what holds it (`holderName`, the climb `addressableLabel` already made,
exported from addressable-names.js), where it took the link's own words; one held by
nothing named still shows the link's words, as any control's preview does.

The face is the tooltip's, whose ground is the page's ink, so the card's marks mix
the tooltip's ink (`currentColor`) where they named the paper's `--muted` and
`--rule`. The user's turn takes `--tip-turn-ink` (tokens.css), the turn's green drawn
halfway to the tooltip's ink: the paper's green stood 2.8:1 on the dark tooltip and
1.4:1 on the light one, and this one about 7:1 and 4.7:1. A settled question's checked
pick keeps the tooltip's own ink, bold.

Every lookup of an obligation by its id now reads `effective.obligations.byId`, which
the publisher indexes as the reading arrives: floating-panel.js's card placement and
its questions carried on a card, queue-walk.js's arrival, application.js's
`openObligation` and obligations/view.js's restore after a revision, where each walked
the whole list.

Tests: the link test reads the owner's face (`.lf-preview-name`, the excerpt face) and
runs in Chromium and Firefox, holding a finger by touch in Chromium and by the pointer
events a finger sends in Firefox; the options test reads the § reference's name the
same way; the runtime test reads the contract's name and detail.
The card had a reading of its own of where a place ends, what in it shows and what
names it, and each disagreed with the page's. It now reads each from the owner the
rest of the page reads:

- Where a heading's place ends is the part of the page it heads, as the outline
  `partOver` reads already defines it: `headedPart` (thread/placement.js) gives its
  blocks, from the heading, past a `header` or `hgroup` holding it, to the container's
  next heading of any rank. The excerpt and the conversation count read that one
  region, so `<header><h2 id=x>Risk</h2></header><p>First lines.</p>` previews its
  first lines, and a thread on a paragraph under a heading counts for the heading.
  A sub-heading now ends its parent's excerpt, as it ends that parent's part.
- A native block in a message's markup reads its words. The authored-word reader's
  frame (`frameOf`, passages.js) took only a widget as a reading's own document, so
  in the floating panel's generated chrome a `<section>` an agent sent read as
  nothing, for every reader of it. A message's body now frames a reading of the markup
  its author sent; the message's text, which the runtime renders from its words, keeps
  the frame over the message, as a thread box's messages need.
- What a place keeps hidden stays out, the place itself included: a closed
  disclosure's body, a tab not chosen, anything `hidden`. A link to a closed
  `<details>` previews its summary alone, where it read the hidden body, since the
  summary path passed over the one closed-disclosure case. Following a link opens
  what holds its place and nothing inside it, so the card shows what the reader lands
  on. A widget's members are still all named, as a set of tabs names its panels.
- A place with no name of its own is named by the part it stands in (`partOver`),
  indexed by the outline, where a climb asked each ancestor for its leading title by
  walking its children: on one paragraph among 1,000 untitled siblings a preview took
  0.29 ms against 0.006 ms among 10, and now 0.003 ms against 0.005 ms (Chromium, 200
  previews each). `holderName` goes back into `addressableLabel`.
- The thread index holds only open conversations (`openThreadsOn`, thread/state.js),
  so resolved history costs a preview nothing.

The publisher builds the obligation index once and hands it to `localQueues`, which
had built the same map. The card holds no reading between calls, so a standing
preview the owner reads again shows the place as it is then.

Tests: the runtime test holds a heading's part, a header's heading, a closed
disclosure linked to and held, and a message's native block; passage-boundaries holds
the message frame for the shared reader; the link test counts a thread on a heading's
paragraph, in Chromium and Firefox. Each failed on the commit before this one.
…ed readers

The review of 11810f4 ran five more places where the link card's reading departed
from the page's. Each is fixed in the reader the page shares:

- What a place keeps hidden stays out of its words as well as its blocks. The passage
  reader gains a `shown` reading (passages.js): `wrote` less what a reader landing on
  the root is kept from, an element `hidden` or `aria-hidden` and a closed
  disclosure's body, text directly in it included, counted from the root down, since
  landing opens what holds the root. `keptHidden` states the rule for one element, and
  the card's walk and its words both read it, so `<details><summary>Method</summary>
  Secret text</details>`, a held closed disclosure and a `<span hidden>` show nothing
  they hide. The reading is never kept, since opening a disclosure changes it and
  nothing the page reading watches.
- A place with no name of its own takes the nearest name holding it, by the naming
  contract `addressableLabel` already climbs (`holderName`, back as its shared
  climb), and only then the heading over it, so `<section aria-label="Deployment">`
  names its paragraph again. The climb asks each ancestor for its leading title and
  caption, which read its children, so those answers are kept as long as the page
  reading stands (`keptAnswer`, passages.js), as an element's words are: a repeated
  preview, a label on every pass, reads a long run of paragraphs once.
- A heading in a header heads what follows it there first: its part starts right
  after the heading, then what follows the header, so a standfirst opens the excerpt.
- A message's markup has its own outline. `partOver` and `headedPart` read the
  outline of the document a node stands in (`outlineFor`, thread/placement.js): the
  page's, or a message's own headings, read off the message as it stands. A heading
  in a reply heads its part up to the reply's next heading, and a paragraph there is
  named by the heading over it.
- The page's outline stands until a heading joins or leaves the page. It was dropped
  on every change to the page's words, and nothing in presentation rebuilt it, so the
  first hover after an unrelated edit paid for it: on the feature gallery (98
  headings, Chromium), the first outline read after editing a paragraph took 0.5 to
  0.7 ms against 0 for the next; it now takes 0 to 0.1 ms. The reading watcher counts
  a change that adds or removes a heading, alone or in what holds it, on the page
  (`pageHeadingsVersion`), and the outline keys on that with `documentChanged`.

Tests: the runtime test holds the hidden words, the nearest holder's name, a header's
standfirst, a reply's own outline and names in the real `.lf-chrome > .lf-msg >
.lf-msg-body` structure, and the outline standing through an unrelated edit and moving
when a heading comes; passage-boundaries holds the `shown` reading. Each failed on
11810f4.
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.
…tion

The card kept two derived copies of what the browser already knows, and each round
moved their boundary: an outline cache whose invalidation had to follow headings
across shadow roots and slots, and a `shown` reading, a second rule for what is
displayed. Both go.

What shows is the platform's answer. Each element the card reads is asked
`checkVisibility` (with `visibility: hidden`), and its words are the page's reading
(`says`) less the elements the platform draws nothing of, so `display: none`,
`hidden`, a script's text, a closed disclosure's body and a skipped
`content-visibility` subtree say nothing, and a title is read the same way, so a
hidden word in a heading stays out of the card's name. Names keep the authoring
contract's order: `ownNaming` and `holderNaming` (addressable-names.js) say where a
name comes from, an attribute's words or an element, and the card reads that element
as the page draws it. checkVisibility asks of elements only, and a closed disclosure
hides its own words beside its summary with no element of their own, so those are
asked of the disclosure; a range over them reports a box in both engines, and
`innerText` leaves out declared shadow trees and keeps Leaf's own control words. A
place the page draws nothing of, as one in a closed tab, reads whole, as `innerText`
does. Measured in Chromium and Firefox: checkVisibility costs about 0.15 µs an element.

A heading's section is walked from the heading through the page's reading
(`readingParent`, `readingChildren`, now exported from passages.js: declared shadow
trees and slots, in the order they draw), within the document it stands in, the
page's column or a message's markup, to the next heading at its level or above; a
place with no name is named by the nearest heading before it, walked back the same
way. Nothing is kept, so nothing needs invalidating, and slot order, a moved or
removed host and a message widget's shadow headings read as drawn. On the largest
page `leaf-dev scaling` generates (256 sections) with a 2,000-paragraph section added,
a preview costs, mean of 20 after the first: 0.03 ms for a section link, 1.37 ms
(Firefox 1.8) for the long section's heading, and 0.8 ms (Firefox 1.05) for its last
paragraph, whose name walks back over the section; a paragraph among 1,000 untitled
siblings 0.2 ms. thread/placement.js is as it was before the link previews: its outline
cache serves On me and the Page Map, and the card no longer reads it, so
`pageHeadingsVersion`, `headedPart` and a message's own outline go.

Behaviour: a heading's section again ends at the next heading at its level or above,
so a sub-heading stands in its parent's excerpt.

Tests: the runtime test holds a section's end, a header's standfirst, a message's
own sections and names, a widget's shadow sections in a message and slot order;
`test_a_link_s_preview_shows_only_what_the_page_draws` holds the platform's cases
in Chromium and Firefox. The `shown` reading's test goes with it.
# Conflicts:
#	browser/runtime/preview.js
#	tests/browser/controls/test_previews.py
…s at its excerpt

The card had several readers of text (a name's, a part's, a code block's
`textContent`) and its own rules for what hides and which heading owns a place, each a
second copy of something with an owner. The fourth review's five findings were those
copies disagreeing with their owners.

Words: every word the card shows, in its name, its parts and its code, goes through
`says(element, {drawn: true})` (passages.js). It keeps the page's reading of the
element and drops each text node the browser computes as not drawn: the computed
`visibility` of the element the text is drawn in (its slot, else its parent), and
whether that element renders (`rendersBox`: `checkVisibility` of the nearest element
that makes a box, so `display: contents` defers to what holds it). No subtree is
pruned, so a visible word inside a `visibility: hidden` span shows, and a hidden title
is passed by as the walk passes it, so the body after it shows. A closed disclosure's
own words beside its summary have no element the page can see, so the disclosure
answers for them. No primitive gives this reading. In Chromium and Firefox,
`innerText` matches every visibility case but keeps Leaf's control words, reads a
shadow host's light children in light order and drops the shadow tree's own words, and
a Range's `toString` keeps everything.

Names: the part a place stands in is `partOver`'s answer (thread/placement.js), the
one On me reads, so a paragraph after an aside is named by the heading over the aside,
not by the aside's own heading. `partOver` now reads a message's outline from its markup
when the node stands in one, since the page's cached outline leaves messages out.
`headed`, the container a heading heads, is exported for the section walk. A name the
page draws nothing of gives way to the next source.

Section: a heading's blocks are yielded lazily from the heading out to the container it
heads, each run of siblings enumerated once (a slot's assignment read once), and the
reader stops asking at its two parts or at a heading at its level or above. A heading
and 2,000 paragraphs in one slot, median: 32 ms to 0.03 ms in Chromium and 82 ms to
0.08 ms in Firefox; at 8,000, 559 ms to 0.07 ms and 1,259 ms to 0.2 ms.

Conversations: the foot asks each element an open conversation stands on, from the
publisher's index (`openThreadsAbout`, replacing `openThreadsOn`), whether the place
holds it or, for a heading, whether the heading heads it through `partOver`. The cost
follows the open conversations, not the section. On the largest `leaf-dev scaling`
prose page with a 2,000-paragraph section and 276 open conversations, the mean preview
is 0.8 ms for a title heading 256 of them and 0.35 ms for the long section's heading
(Firefox the same), down from 2.3-2.7 ms and 1.4-1.9 ms.

Behaviour: a heading's section, excerpt and conversations alike, ends at the container
the heading heads, so the page's title in an `<article>` no longer counts conversations
on sections after the article. Code shows its lines without hidden or generated words.

Deleted: the card's own visibility rules (`NOT_DRAWN`'s script, style, template and
noscript, `hidden`, `unshown`, `drawnPlace`), its backwards heading walk (`headingOver`,
`beside`, `outFrom`, `headingsIn`), its `textContent` code reader, and the per-block
`querySelectorAll("[id]")` thread lookup.

Tests: `test_a_link_s_preview_shows_only_what_the_page_draws` adds a word drawn in a
hidden one, a box-less block, a hidden title and code with a hidden word and Leaf's
words, in Chromium and Firefox; the runtime test adds the aside's naming and a slotted
section read once and only as far as its preview. Each fails on 64a2eab. The code
case moves from the runtime test to the browser one, since its lines are the browser's
computed whitespace.
… outline

The fifth review's seven findings came from three causes, each fixed where it starts.

Drawn words, in the walk. Whether a word is drawn is decided as the reading's walk meets
it (`textNodesUnder`, `says(…, {drawn})`), not by filtering segments afterwards, so a
break before words left out still stands before the next ("first second", not
"firstsecond"). The walk enters its root as it enters a descendant: a slot handed in
reads what is assigned to it, not its fallback, and a host its declared tree.
`drawsWithin` (passages.js) tells a box from what it holds. The nearest box at or over
the element must be drawn (`checkVisibility`) and must not skip its contents
(`content-visibility: hidden`, which an unchosen tab's `hidden="until-found"` panel
computes), and the word must inherit `visibility: visible`. What a
`content-visibility: auto` box skips off screen counts as drawn and is not styled to
ask (`skipper`). So text directly in a skipping block says nothing, and a place that
draws none of what it holds, such as an unchosen tab's panel, reads whole. A widget's
members are named whole, drawn or not, as a settled question's folded options are.

`innerText` was checked first. In Chromium and Firefox it matches the break, direct
text in `content-visibility: hidden` and `until-found`, nested visibility,
`display: contents`, a closed disclosure and scripts. It fails four cases the card
needs: Leaf's control words stay; a declared shadow tree's own words are dropped and
its slots are read in light order; and an unchosen tab's panel reads as nothing rather
than whole. So the walk keeps deciding.

Ownership, one reading. thread/placement.js keeps one outline reader for the page or a
message (`outlineOf`). Both scopes share one filter: Leaf's surfaces (`inPage`) and its
controls by the rule that document's reading skips them (`readAsChrome`, passages.js),
so words a widget renders for the page, such as a Markdown preview's headings, stay.
Both share one key: the page reading's version and `documentChanged`. A heading's
excerpt ends at the next heading of that outline (`headingAfter`), however deep in a
block it stands, so "First" no longer shows the next section nested in a block after
it. The open conversations are gathered once for each reading of the threads and the
page (`conversationsAbout`): under each element, those about it or anything it holds;
under each heading, those about the part it heads and its sub-headings', as `partOver`
reads ownership, where a heading heads itself. So a conversation about "Second section"
no longer counts for "First section", and a preview looks the count and turn up.

Behaviour: a heading's excerpt now ends at the next heading of any level, so a
sub-heading's part leaves its parent's excerpt; its conversations still count for the
parent. A message's outline no longer takes a heading Leaf drew in it. Default
`says(host)` for a host with a declared tree reads that tree, as the page's reading
already does: on the gallery, `lf-tally`'s reading goes from "" to its counts. The
page's outline is unchanged there (98 headings).

Measured, Chromium (Firefox within its 1 ms timer):
- A message's outline lookup at 20, 2,000 and 8,000 paragraphs: 0.01, 0.63 and 2.3 ms
  on every lookup before; 0.002 ms after a first read of 0.1-0.3 ms.
- On the largest `leaf-dev scaling` prose page with 276 open conversations, a preview's
  mean is 0.01-0.05 ms, the same as with none, down from 0.79 ms for the page's title
  and 0.38 ms for a long section's heading. Gathering costs about 2 ms at 276
  conversation sites, once per change to the threads or the page reading.

Deleted: `openThreadsAbout`, the card's own heading-level end and its per-hover
ownership walk (`heads`).

Tests: in Chromium and Firefox, `test_a_link_s_preview_shows_only_what_the_page_draws`
adds the break, a block skipping its own words and a folded panel, and
`test_a_link_into_the_page_previews_where_it_points` adds a conversation on a sibling
heading. The runtime tests add a nested next heading and a message's generated heading.
The passage test adds a slot handed in as the root. Each fails on ea4b449.
…s on what it reads

The sixth review's findings came from three causes.

Ownership, one reading. The walk that reads a document's words (passages.js,
`readPage`, and `outlineReading` for a message's markup) now records its outline as it
goes, in composed reading order: its headings, Leaf's chrome aside, and for each
element it enters, what stood over it, which for each container out from it is the
last heading met so far that heads that container (`headed`, moved to passages.js).
So a slot's fallback, replaced by what is assigned to it, is no part of the outline,
and its heading no longer ends the excerpt before it ("Assigned body.", not
"Assigned body. Next"). `partOver`, `headingAfter`, the excerpt's end, the gathering of
conversations and message outlines all read this reading. The querySelectorAll outline,
its own cache and the per-container binary search are gone. Page Map's outline comes
from the same reading and is unchanged on the gallery (98 headings) and on the largest
`leaf-dev scaling` prose page (259), same order.

`partOver` follows the authoring contract where no heading stands before a node in its
container. That container's declared name, else its leading title
(addressable-names.js, `leadingTitle`, which Python shares through
`tests/name_cases.json`), names what it holds, short of the document and the page's
column. Behaviour changed: what stands in a <section> before the section's heading,
such as a question or a lead paragraph, is placed under that heading, not under the
heading before the section. On me agrees: on a page with a question before its
section's heading, On me's "By place" band said "Earlier section" and now says "Later
heading". The card already named it so, through the contract.

Keys. The conversations gathered for previews key on the thread reading's threads
(`all`), which the application state publishes as an immutable value, new whenever any
thread changes, its turns included. They also key on the agent's name and the page's
outline reading. Answering a question now takes "Your turn" off a standing preview. A
message's outline keys on the message as the thread reading publishes it, so an
accepted edit outlines it again ("### Changed heading" now heads the paragraph after
it, where `partOver` said null). It also keys on the page reading's version, which a
widget staging its declared tree in the message moves.

Drawn words in skipped content. What a `content-visibility: auto` box skips out of view
is asked as it is (`checkVisibility()`), so its descendants' `visibility` and `display`
apply before it scrolls into view. That styles the box's skipped content the first time
it is asked. On the largest scaling document (16,384 lines in 128-line runs), the first
preview of a row in an off-screen run took 5.4 ms in Chromium, up from 0.7 ms, and 1 ms
in Firefox, down from 2 ms; repeat reads take 0.025 ms. What `content-visibility: hidden`
skips is still answered without styling it.

Code cut short ends in the ellipsis cut prose does.

Measured on the page reading, cold: the gallery's took 3.4 ms and now takes 3.9 ms, the
largest prose page's 2.4 ms and now 2.8 ms, with the outline recorded in the same walk.
`partOver` warm: 0.002-0.01 ms.

Tests: in Chromium and Firefox, `test_a_link_into_the_page_previews_where_it_points`
answers the question and expects the turn gone, and
`test_a_link_s_preview_shows_only_what_the_page_draws` adds off-screen
`content-visibility: auto` words and the code's ellipsis. A new
`test_a_message_s_parts_follow_its_accepted_edit` edits a message through its editor.
The runtime test adds the slot's fallback heading and a paragraph before its section's
heading, named by it on the card and by `partOver`. Each fails on beeef3e.
…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.
…and On me

The preview named a place with no name of its own by its nearest named holder
(`holderNaming`), while On me grouped it by the part `partOver` gave. The two disagreed
under a sub-heading inside a titled section: the preview said the section, On me the
sub-heading. Now one rule answers both. The preview names such a place only through
`partOver`, and `partOver` applies the authoring contract's whole naming at each
container out from the place: the heading before it in that container, else the
container's declared name, leading title, caption, or the `aria-label` or <label> its
author gave it (addressable-names.js, `ownNaming`). It stops short of the page's column
and the document as before, passes slots, and passes anything Leaf generated in the
document, whose labels are Leaf's.

Behaviour changed: a paragraph under a sub-heading inside a titled section is named by
the sub-heading on the card; a region its author labelled, a captioned figure or table
and a disclosure name what they hold, in the card and in On me's "By place" bands.
Reversed: only a declared name or a leading heading named a container.

`holderNaming` stays for the chrome's label of an element with no name of its own
(`addressableLabel`); it and `declaredName` are no longer exported.

`tests/name_cases.json` adds a section whose later sub-heading does not name it, which
Python's `element_name` and the browser's `addressableName` both hold. Python names an
element by its own contract only and has no counterpart to `partOver`'s climb.

On me, before and after, read as the panel draws its "By place" bands. On the 10 real
pages on this machine that this Leaf can read and that hold open On me items, no item
changes band: the same bands, page by page (2, 1, 3, 6, 2, 1, 4, 3, 2 and 1). On the
feature gallery 4 of 15 items change, 11 bands becoming 14. Each change is a run-in
<strong> title naming its line as a part: "Replace.", "Insert." and "Delete." in place
of "Suggestions", and "Combine roles." in place of "Margin entry lifecycle". No band
comes from an element Leaf drew: the gallery's 202 Leaf-written `aria-label`s all stand
in what Leaf generated, which the rule passes.
`partOver` applies the authoring contract's naming at each container out from a place,
and the contract titles a line, or a titled member such as an option or a card, by its
leading <strong>. As parts, those split On me: on the feature gallery three
suggestions in one paragraph moved out of "Suggestions" into bands named "Replace.",
"Insert." and "Delete.", and a fourth into "Combine roles.", 11 bands becoming 14. A
bold label opening a line is no place a reader groups by. So a container titled by its
leading <strong> makes no part, and the name goes on to the part holding the line.
The <strong> still names the line itself: a link to that line previews it as
"Replace.". Every other naming in the contract keeps making parts: headings,
disclosures' summaries, captions, `aria-label`s and declared names.

On me, read as the panel draws its "By place" bands, against the pushed head
(a555197). On the feature gallery, 15 items stand in the same 11 bands, none moved.
On the 10 real pages on this machine that this Leaf can read and that hold open On me
items, no item changes band: 2, 1, 3, 6, 2, 1, 5, 3, 2 and 1 bands. One page, live in
another session, gained an item between the two runs; read again with both rules on
the page as it stands, it has the same 5 bands under each.
…a run-in label, a hidden break

The eighth review's findings, each fixed where it starts.

A message's outline keys on what draws its markup. It was kept against the message the
thread reading publishes, which moves as an edit arrives, while a card holding that
edit back as news still draws the old words. An outline read during the hold then
stood for the new words once shown, and named the new paragraph by the detached old
heading. The message view already says when it draws a message (`messageDrawn`, which
`MessageView.present` calls after each draw, the reveal of held news included), so a
message's outline is kept against that count (`messageDraws`) and the page reading's
version, which a widget staging its tree in the message moves. The gathered
conversations key on it too, since a conversation can stand in a message's markup.

A heading heads what holds it in the walk that records the outline (`headed`, by
`readingParent`): a heading a widget's tree draws in a slot heads what is drawn after
it in that slot. Before, it was recorded on the host, outside the section around the
slot, and the paragraph after "Slotted topic" was named "Outer section".

A leading <strong> makes no part only as a run-in label: a line's, followed by words of
its own. A <strong> titling a container of blocks names that container as a part, as a
heading would. Before, a section titled by a <strong> lent its content the heading
before the section. page-authoring.md, "Markup", says so.

A break is drawn where the <br> itself is. The drawn reading asked a break's parent,
so `<code>con<br hidden>st value = 1;</code>` previewed split across two lines.

Held: that a section names a conversation anchored to itself in On me, as its preview
does ("the nearest part at or above"). Measured as the panel draws its bands, that rule
gives each question, a container titled by its own heading, a band of its own:
`leaf-issue-triage` goes from 3 bands to 16, `sweep` from 3 to 5, and 7 of the
gallery's 15 items regroup under their own titles.

Costs: rebuilding a message's outline walks the message: 0.1, 1.3 and 4.5 ms at 20,
2,000 and 8,000 paragraphs in Chromium (0, 2 and 7 ms in Firefox), paid by the first
lookup after a message is drawn; warm lookups take 0.002 ms. On the largest scaling
prose page with 276 conversations, previews match the pushed head in one run: 4.9
against 5.0 ms first, 3.8 against 3.8 ms after an edit, 0.01-0.05 ms warm. On me's
bands on the gallery (11) and on the 10 real pages are unchanged.

Tests: `test_a_message_s_parts_follow_an_edit_the_card_held_as_news` holds the hold and
reveal; `test_a_link_s_preview_shows_only_what_the_page_draws` adds the hidden break,
in Chromium and Firefox; the runtime test adds the slotted heading and the bold
container. Each fails on cb11031.
… markup

A reading rooted inside a message's text took its frame from above the message, so the
message's chrome counted over it: `says`, `wrote` and `elementReading` of a heading in
a reply read "", and a link's preview named no place in a message's text, while the
same words read from the message's body came through. Round 3 of this branch made a
message's markup a document of its own (`frameOf`) and kept its text out, citing a
hazard from 91515b5: the version diff read every block on the live page, a
conversation's runtime-built paragraphs among them, and a frame bounded at such a
block took a reader's comments for the page's words. The diff has since compared
versions' sources (version.js, `paintedSource`) and reads no message. The other
`frameOf` readers are not rooted in a message's text: comment capture reads the page's
reading, which skips Leaf's surfaces; the page reading's watcher asks with no frame;
version installs and projections root in page content; options read their labels from
a widget's markup.

Behaviour changed: a message's body, the markup its writer sent and the text the
runtime renders from their words, is the frame a reading inside it takes, so its words
read as its writer's. A heading in a reply names what follows it in a link's preview,
by the outline that now follows the message's draws, including an edit a card held as
news. `wrote` of a message's text reads its words, where it read "". Markdown
headings in a message carry no id, so no link reaches a place in a message's text; a
preview of one is asked directly, as by the review.

Tests: `test_a_message_s_parts_follow_an_edit_the_card_held_as_news` asserts the card
names the revealed paragraph "Changed heading" (null before); the passage boundaries
test holds a message's text read as its own document.
…ection

The review found the preview and On me disagreeing over a thread on a whole section:
the preview named the section, On me grouped the thread under the part above it. That
is the rule, now stated once in thread/placement.js's header: On me groups every item
under the part its subject stands in (`partOver` of the element it is about),
questions, conversations and to-dos alike; a link's preview names a place by its own
name, else by the part it stands in. The preview says what a place is, On me where it
is, and they agree wherever a place has no name of its own. Grouping a conversation by
the part at or above its subject was measured and dropped: it moved two conversations
on a real page away from the questions they are about, into bands of their own.

No behaviour changes. `test_a_thread_on_a_whole_section_stands_where_the_section_stands`
pins a thread on a whole section to the band of the part the section stands in ("Link
previews") and the section's preview to its own name ("iOS reconnect stall").
module-reading.md, "Naming elements", and page-authoring.md, "Markup", agree.
… inline words

A widget in a reply that redrew its own tree left the reply's outline stale: replacing
a heading inside the widget's shadow tree kept the old, detached heading as the part
over the words below it, and the link card named nothing. Message outlines were keyed
on the count of message draws and the page reading's version, and neither moved: the
reading watcher read every record against the page, which ignores whatever stands in
Leaf's surfaces. The watcher now reads each record against the document it landed in
(passages.js, `hear`): the page, or the message body over it, by the same rules
(`messageReads`). A change to a message's words moves `documentReadingVersion`, which
also moves with every page change, and the message outline and On me's conversation
gathering key on it. `messageDraws` is gone. Records in Leaf's surfaces outside any
message no longer reach the page's checks: draining 2000 of them costs 0.3 ms, from
1.5 ms.

A leading <strong> counted as running into its line only when a bare text node
followed it, so `<p><strong>Label</strong> <em>words</em></p>` made the paragraph a
part named "Label", where the heading above should name it. A title now runs in when
words follow it before anything drawn as a block (`runsIn`), whatever inline element
carries them. The block-level rule has one home, `blockLevel`, which the `lines`
reading uses too.

Behaviour changed: the card for words after a bold lead-in carried by an <em>, <a>,
<code> or <span> names the part over the paragraph, and On me groups them there. A
bold list item over a nested list still names a part. A reply's outline follows a
widget in it redrawing its own tree. On me's bands are unchanged on the feature
gallery (11) and on the 10 real pages surveyed.

Tests: place-preview.test.mjs installs the stage integration a served page has, so
its declared roots are watched, and adds the redrawn-heading case and the run-in cases.
`test_a_capture_in_a_reply_s_table_is_named_by_its_column_head` pins what 666e580
changed: a capture in a reply's Markdown table opens with its column head as its
caption ("Light", "Dark"), as a page table's does; before it, the heads read as Leaf's
words and the caption was empty.
…e as drawn

Codex's review of 64a92d4 found the readings kept from a message still tied to one
version for every document, with three consequences. A declared label a reply's widget
added inside its own apparatus moved nothing: `holdsSaid` refused every node under a
Leaf surface, which every message stands in, so the card named the old heading. Any
page change discarded every message's outline and any reply change rebuilt On me's
conversation grouping. And registering a shadow root forgot the page's whole reading
each time, so a reply's diff adopted again when its module loaded made the page be read
again (3.5 ms on the gallery in Chromium, 6 ms in Firefox).

passages.js now keeps a record per document, the page's body or a message's, holding
its reading: the page's whole reading, or a message's outline (`documentOutline`). A
mutation, a fence or a stage registered forgets only the record of the document it lands
in (`readingDocument`), read by that document's own frame (`readsIn`), and a node a
record hands in is that document's unless it starts a Leaf surface itself, which is the
rule `holdsSaid` now applies. The vocabulary or a settlement forgets every record. An
element's kept words and answers name the record they were taken under, so they stand
as long as their document's reading, a message's now as well as the page's. A shadow
root already watched forgets nothing when it is adopted again. `pageReadingVersion` is
the page's record; `documentReadingVersion`, `pageOutlineReading` and the exported
`outlineReading` are gone. On me's conversation grouping keys on the page's reading,
and reads a thread's section only where it is on the page.

A leading <strong> counted as running into its line by its sibling nodes, so a `<br>`
after it, a block inside a wrapper that draws no box, and words the page hides all read
wrong. `wordsFollowOnLine` reads the `lines` reading of what the page draws from the
title's last word to the next break, ending the walk there (textNodesUnder's new `last`);
where the page draws none of the title, as in an unchosen tab's panel, the line reads
whole, as a preview reads such a place. `partOver` keeps the answer on the title's
document, so 100 calls on an unchanged page read no style, where they read 100.
`blockLevel` is gone.

Behaviour changed: a bold title followed by a `<br>`, by a block through a box-less
wrapper, or only by hidden words names what follows it as a part; a reply's widget
declaring a heading in its apparatus names what follows it there; the page's reading
survives a reply's change and a watched root's adoption, and a reply's outline survives
the page's change. On me's bands are unchanged on the feature gallery (11) and the 10
real pages, each compared against 64a92d4 on the same copy. Draining 2000 mutations
costs 0.2-0.4 ms in any document.

Tests: place-preview.test.mjs adds the declared heading in a reply's apparatus and the
`<br>` and box-less-wrapper lead-ins; passage-boundaries.test.mjs adds that each
document's reading is forgotten alone, re-adoption included; the drawn-preview browser
test adds a title over hidden words and a lead-in in a folded panel. Each failed on
64a92d4, or with the line read as drawn regardless of the title, and passes now.
Codex's review of 4a60082 found three more cases where reading the drawn line went
wrong. Opening a disclosure, choosing a tab, a `hidden` toggled, a hiding class or a
media query left a card's name stale, since the answer was kept until the words
changed; a newline `white-space: pre-line` keeps counted as running text; and a title
whose words a widget's declared tree draws was never passed, since `contains` stops at
the shadow boundary. These followed `display: contents`, `<br>` and hidden words in the
rounds before: each was another style the drawn line had to follow. Whether a bold
lead-in makes a part is a fact about the place, which should not move as a reader opens
a disclosure, and Python, which names elements by the same contract off the document,
reads no CSS. Python computes no part at all, so none of these cases can disagree with
it; its own names agree with the browser's.

`runsIntoLine` (passages.js) answers from the markup: a leading <strong> runs into its
line when words its author wrote follow it, through the tree the walk reads (a declared
tree, a slot's assignment), before a `<br>`, an element outside HTML's phrasing content,
or the end of what holds the title. Phrasing content is a kernel fact,
`$passages.phrasing`, which base.css's suggestion-slot test already spelled out
unchecked; `build/registry.test.mjs` now holds that literal to the registry. A widget
is outside it unless it declares `x-inline`. No style is read, so the answer is kept
under its document's reading as the markup is. `wordsFollowOnLine`, textNodesUnder's
`last` option and the whole reading of an undrawn title are gone.

Behaviour changed: a card's name, and On me's band, for what follows a bold title no
longer change as the page draws it differently. A title followed by words the page
hides, by a span drawn as a block, or by a newline `pre` or `pre-line` keeps, now runs
into its line, where the drawn line put it alone; a title whose words a declared tree
draws runs into the words after it. On me's bands are unchanged on the feature gallery
(11) and the 10 real pages against 4a60082 on the same copies, and the 12 cells of
docs/how-it-works.html's command inventory, each a title over a `<br>`, stay parts named
by their titles. page-authoring.md's "Markup" says what running into its line means.

Tests: `test_a_bold_lead_in_runs_on_by_its_markup_whatever_draws_it` holds a disclosure
closed, open and after an edit elsewhere, a kept newline and a title a declared tree
draws, in both engines; it failed on 4a60082 ("Group" after the edit). The runtime
naming test holds a block-drawn span to running on (it read "Group") and an inline and a
block widget. The drawn-preview test drops its two run-in cases, which tested the drawn
line.
Codex's review of 3768ae5 found two places where `runsIntoLine` answered by its own
model of the page rather than the reading walk's. It pruned what came before the title
with native `contains`, which stops at a shadow boundary, so a title assigned to a slot
inside a declared tree was never reached, and the words after it read as a part named by
the title ("Slotted" where 4a60082 said "Outer"). And it ended the line at any element
outside phrasing content, Leaf's own apparatus included, so an inline tally, whose
staged tree holds the `<style data-lf-gen>` the stage integration puts there, ended the
line its authored reading runs straight through ("Tallied after Tallied words."), and
the card said "Tallied".

The walk now hands `skip` the context the element opens, as a function the walk reads
at most once and reuses on entering, so a reader that leaves elements out by what the
reading counts there asks the walk's answer, and one that never asks costs nothing.
`runsIntoLine` prunes by the reading tree's ancestry (`readingUnder`, which climbs
`readingParent`), and counts a word or a boundary only where the `wrote` reading counts
it; the end of what holds the title ends the line only for a block.

page-authoring.md's "Markup" states the rule an author can follow: what makes a leading
`<strong>` head a part, that hidden text keeps it a run-in label, that a widget is a
block unless it declares `x-inline`, and that CSS does not decide.

Behaviour changed: a bold title a declared tree's slot draws, or one an inline widget
follows, runs into the words after it, as it did before 3768ae5. Every other run-in
case from rounds 10-12 reads as before in both engines, and On me's bands are unchanged
on the feature gallery (11) and the 10 real pages.

Tests: `test_a_bold_lead_in_runs_on_by_its_markup_whatever_draws_it` adds the slotted
title and the tally, in both engines; it failed on 3768ae5 ("Slotted").
Codex's review of eccb416 found the excerpt doing what the run-in walk did before it:
it pruned with native `contains`, so a declared host whose title and body are assigned
to a slot inside a wrapper of its tree showed its title and nothing else. The wrapper
does not natively contain the slotted title, so the excerpt skipped it whole. The card's
stop test asked the same question with the composed climb, which passes a slot by too.

`readingUnder`, the containment `alongClimb(readingParent)` gives over the tree the walk
reads, is exported, and the excerpt prunes and stops by it. Of the native `contains`
and composed `under` calls in the code this branch adds or reads by, the rest stay:
`preview.js` asks whether a hit-tested element is inside the card, Leaf's own tree;
`inPage` asks for the page's body, which every climb reaches; `fencedAt` asks what an
element holds as against what it renders, and uses both on purpose; and `findQuote`'s
narrowing, which is main's, asks what it holds.

The walk hands `skip` the context the element stands in, rather than a function per
element for the context it opens; the run-in walk derives that with `enter` where it
asks. page-authoring.md's "Markup" says the end of an inline element around a title is
no end of its line.

Behaviour changed: such a host's card shows its body under its title, in both engines
("Body words.", where it showed nothing).

Tests: place-preview.test.mjs adds the slotted host's card, which failed on eccb416.
…op of it

This branch carried three earlier rounds of the preview owner's branch. Every file this
branch had not changed since the last of them (dcb34de) takes main's copy, since the
landed owner supersedes it; every file it had changed is merged afresh with that round as
the base, so only this branch's own changes meet the owner's later ones. Git's older base
(6b3159d) would have let round-5 hunks the owner later rewrote come back without a
conflict.

What the owner's landing changed under the link card:

- `partTrail` (thread/placement.js), new on main, names the headings over a thread's
  words from the outline's `above`, each heading's nearest higher-ranked heading before
  it in its container. This branch's outline is recorded by the reading's walk
  (passages.js, `outlineFold`), so the fold now records `above` as main's outline did,
  and `partTrail` reads it from the outline of the node's own document.
- The preview's rules moved from controls.css to chrome.css, and its face is fitted to
  the room it stands in rather than scrolled (`fit`). The card's `.lf-place` rules move
  with them; its excerpt is one line of detail to the fit, which clamps it where the room
  ends there.
- A declaration may name what its preview is about. The card names the place, so where
  the page shows the place, the card stands clear of it rather than over what it
  previews: beside the link on a wide window where it stood below over the section, and
  held to the room between link and place on a phone.
- A finger's hold reads at the platform's long press and its release presses nothing,
  and Escape puts a standing preview away first. The link test now holds the link, lets
  go and finds the card standing and the page where it was, then taps to follow it.

Tests: the link, lead-in, drawn-preview, message-part and section tests, main's finger
hold and trail tests, and the reply caption test pass singly, in both engines where they
run in both.
The card gave the owner's fit (preview.js, `fit`) its whole excerpt as one line of
detail: a box of parts, flex-laid, that the fit could only estimate lines for and whose
line clamp the engines read differently. Held to a phone's short room, Chromium showed
the name and a clamped line while Firefox, a few pixels short, hid the excerpt and cut
the name. Each part is now its own line of detail, as the owner's face expects, so the
fit keeps the parts that fit whole, clamps the one the room ends in by its own lines, and
hides the rest. A paragraph's words stand as the line's own text, so that clamp reaches
them; the card's own three-line cut on a paragraph is gone, the fit's room and the
paragraph's word bound being what cuts it now. A code part keeps a block of its own, so
each code line still ends in an ellipsis.

Behaviour changed: in a short room both engines make the same cut, the name and the
parts that fit, the last clamped where the room ends in it; in a roomy one the card shows
whole, as before. A long paragraph shows its whole words where the room holds them,
rather than three lines.

Tests: the runtime test's helper reads each line of detail as a part; the drawn-preview
test reads the lines of detail.
…wn words included

Codex's pre-landing review of ffa9c2e found the merged outline losing a title in a
header. The reading's walk records what stood over each element as a chain of records,
one per open container, each replaced when a heading arrives in it. A title in a header
heads what holds the header, so its record is the header's parent's, and the header,
already open, still pointed at that parent's record from before the title. Everything
after the title inside the header stood under no heading: in
`<main><header>Intro<h1>Title</h1><p>Standfirst</p></header></main>`, main's `partTrail`
of the paragraph is ["Title"], this branch's was [], and the paragraph's link card had no
name. A header its title titles hid it, since the header's own name answered.

When a heading replaces its container's record, every container still open inside it
takes a new record over the new one, so what comes after stands under the heading, while
each element already visited keeps the record it was given.

Also: the feature gallery says a tap follows a link and a held finger's release leaves its
preview standing, and place-preview.js's header no longer promises a three-line cut of a
paragraph.

Behaviour changed: what follows a title inside a header, before the header ends, stands
under that title, for On me, a link's card and a thread's trail. The trail matches main's
in both engines for a header, nested sections, a header titled by its heading, an hgroup,
a skipped level and a heading arriving late; it differs only where this branch names a
paragraph before its section's heading by that heading (["Late"], where main has []).
On me's bands match main's on the feature gallery.

Tests: place-preview.test.mjs adds a node's trail through a header, nested sections and
a heading that arrives after the trail was read; the header case failed on ffa9c2e.
…5615)

Main's `fit` now clamps the block before a room's end to its own lines, so the "…" no
longer wraps its last word past the room. On a phone, where a link's card is held to the
40 px between the link and the place below it, the cut paragraph stays one line ending in
the clamp's ellipsis, in Chromium and Firefox alike. The merge was clean.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preview and the shared outline work as described: pnpm run test:runtime and the new preview, section-reference and media-table browser tests pass locally. Two problems in the new caches and the card's read path are worth fixing before this lands; both are inline.

Comment thread browser/runtime/passages.js Resolved
Comment thread browser/runtime/place-preview.js Resolved
…hat it shows

The PR review found two costs that grew with what a session or a block holds.

A kept answer named the whole record of the reading it was taken under, the page's
reading and its outline included, and so did the page's version, which `anchor-controls`
and the conversations On me and a card count keep as part of a key. Kept answers are
keyed by elements still on the page, so every page reading a session forgot stayed
reachable until each of those elements was asked again. Each reading's record now holds
an empty object, its token, which kept answers and `pageReadingVersion` hold in its
place: a key compares the same, and holds none of the reading.

A link's card read the whole of a `<pre>`, in the `lines` format, and the whole subtree
of a textual block such as a list's first item, before cutting either to what it shows.
`textNodesUnder` takes `upTo`, the most characters other than whitespace a reader needs:
the reading ends once it holds them, cutting the text node it ends in there. The card
reads up to twice its excerpt's 280 characters, enough for each cut it makes. A link to a
5,000-line `<pre>` read 3.1 ms per card in Chromium and 3.0 ms in Firefox, and reads 0.1 ms
and under a millisecond; one to a list whose first item holds 27,000 elements read 46.6 ms
and 48 ms, and reads 0.2 ms and under a millisecond. The text node is read once, since
Firefox copies a long node's text on each read of `data`.

Behaviour changed: none a user sees; what each card shows is the same.

Tests: passage-boundaries.test.mjs holds that a forgotten page reading is collected while
a key and a kept answer taken under it live on; it fails where the record is its own
token.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token change fixes the retention problem: the WeakRef test passes locally, along with the rest of passage-boundaries and place-preview. The new read bound, though, changes what a code block's preview shows. See the inline comment.

Comment thread browser/runtime/place-preview.js Resolved
The PR review found the read bound cutting a code block short without saying so. With a
bound of 560 characters, a `<pre>` of 300-character lines, a log or minified JSON, ended
partway through its second line; the card counted two lines, showed them with the second
cut and no ellipsis, though the block ran on for thousands of lines, where it showed four
whole lines and an ellipsis before. Nothing told the reader the read had been cut.

A bounded read is now its own call, `excerpt` (passages.js), beside `says`, which reads
whole. It returns the text and whether a bound ended it with words still to follow
(`cut`), which the reading finds by going on to that one word; `textNodesUnder` marks
the segment it ended in. The lines format takes a bound in line breaks too, so a code
block reads its four lines and stops, with a far longer bound in characters left only
for a line that runs on. The card ends a code block and any part's words in an ellipsis
wherever the read was cut, so a paragraph or a list's first item cut by the bound says
so even where the words before it leave it shorter than the card's own cut.

Behaviour changed: a code block of long lines shows its first four lines and then an
ellipsis, as it did before e8624e8; reading one still costs what the card shows (under
0.2 ms for a 5,000-line log, a single 200 KB line and a 27,000-element list, in both
engines).

Tests: `test_a_card_cut_short_says_so_with_an_ellipsis` shows a log of 300-character
lines as four whole lines and an ellipsis, and a long paragraph and a long first item
ending in one, in both engines; the log failed on e8624e8, showing two lines.
@max-sixty
max-sixty merged commit 1d5249c into main Nov 6, 2026
6 checks passed
@max-sixty
max-sixty deleted the link-previews branch November 6, 2026 17:42
max-sixty added a commit that referenced this pull request Nov 7, 2026
… the page changes (#5618)

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 `agePreview` in 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.js` is the one record of where each
thread's passage stands, and the draft's. Every read settles first
(`settle`, reached through `placedAt`, `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 reaches
`settle`.

The page's index of quotes (`passages.js`, `trackQuotes` and
`quotesChanged`) 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.js` paints 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`). `highlightsFromPoint` would 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.mjs` compares 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. One `phrasing`
predicate, built from the kernel registry's `$passages.phrasing`,
answers both the walk's `enter` and link's `runsIntoLine`, and
`tests/runtime/passage-boundaries.test.mjs` holds 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.json` holds both
to the same answer on 34 cases (fences, overlaps, context, edges, gaps,
blocks, staged shadow trees, said values, slots, whitespace), run by
`test_a_quote_resolves_where_the_browser_resolves_it` in Python and
`tests/runtime/quote-cases.test.mjs` in the browser runtime. Both split
a quote into words, and find the gaps between them, by the registry's
`$passages.collapse` alone, 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.phrasing` and 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`, `blocks` and `phrasing` decide 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" (`shownApart` in `passages.js`, the soft
space in `passages.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.js` as the owner had them: `pointRange`, `holdRange`,
`sameRange`, the Range branches of `readFrom`, and the line a range's
preview stands by. `anchor-paint.js` is the range owner: it tells
`pointRange` which 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's `WORKS` less a plain tab stop), carries a title the browser
shows, declares `lfPreview`, or is a registered widget that draws its
content itself (`x-content` `data` or `empty`). 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 where `aimableAt` answers nothing (`readingAt` in
`preview.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-diff` or a draft
preview nothing to a pointer or a finger, and the thread is reached by
its margin entry, which previews it, by `t` and 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 ask `aimableAt` once this lands.

Presses are as on main. A press on a thread's words opens the thread
unless main's `WORKS` boundary 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

- The file's reading now gives every node that holds words, each element
and each said value's span, a key from a counter it keeps as it reads.
It had keyed an element by `id(frame)` after the element closed, which
Python reuses, and an element's first `before` and first `after` said
values by one key. So
`<small>reversible</small><strong><em>Heat</em></strong>` could read
`reversibleHeat`, and a comment the browser captured on a formatted
label was Not found after a revision instead of moving to its section.
- A passage's preview went about 200 ms after the pointer moved onto it,
because the range owner reported no range there. `pointRange(null)` now
leaves a preview the pointer is on standing, as the owner does for an
element's preview.
- The panel's guard against a run of clicks (`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 in `paintPanel`). 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.
- Back from a thread hands focus back to the thread's row in Threads as
a `return`, as the menu's way back already does, so the row shows no
preview until the user steps onto it.
- A press in a thread view's head holds the view's height once the
press's script ends, still before the frame. When the keyboard pressed
Back, the hold wrote the height and Back's transition took it away in
the same script, a write Firefox's write watch reports as changing
nothing; main has the same write.
- A widget's verbatim reading had re-derived its spaces from the change
of block, which a phrasing element no longer makes, so
`<lf-shell><div><b>Status</b>Ready</div></lf-shell>` read `StatusReady`
where the page reads `Status Ready`, and `page check --render` flagged a
correct `x-verbatim` widget. It now takes the words the page's reading
wrote, spaces included.
- The file split a quote into words on Python's whitespace, so `<p>x
A\x1eB y</p>` confirmed the quote "A B" where the browser finds no copy.
Both readings now split on `$passages.collapse`.
- A mark that came to stand under a pointer the user had stopped, on a
page that marked nothing before, previewed: the frame kept the user's
aim for later when nothing was marked. It now spends the aim in the
frame it was made for.
- A passage's preview didn't come back after the pointer crossed a link
inside the passage and returned to its words, since the link took the
owner's one target and nothing gave the range back. The range is now a
layer of its own (see "Range targets on main's preview owner").

### 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:

- A presentation of a page whose one paragraph holds 32, 512 and 1,600
marked passages: 4.1, 98 and 975 ms on main; 4.4, 12 and 36 ms here.
- A script edit that moves every passage in that paragraph, a leading
space written and taken away: 0.25, 0.9 and 3.1 ms on main, which leaves
the marks where the DOM moved their ranges until a presentation places
them again. Here the edit places them again at once and takes 5, 55 and
294 ms; when last profiled, about 255 ms of the 1,600 case was the
margin laying out its rows (`layoutMarginRows`).
- Finding the copies of 1,600 quotes of the same 60 letters with their
spaces in different places, on a page of 640 x's: 21 ms in Chromium and
20 to 22 ms in Firefox; of 640 letters each, a million characters in
all, about 10 ms in both.
- A pointer move across a mark on a page of 32 and of 512 paragraphs, a
thread on each: 0.60 to 0.69 and 1.11 to 1.26 ms here, where the move
previews the thread; 0.47 and 1.55 to 1.97 ms on main, where it previews
nothing.

### Left for later

- One action for each press on a thread's words. On main, and here, a
press on a thread's words in a widget that takes it does two things: a
gloss pins its explanation, a draft opens its editor, an option is
picked and a timeline event takes the playhead, and each also opens the
thread. A press in a plain tab stop or a card that only previews is
swallowed.
[`press-ownership`](https://github.com/max-sixty/leaf/tree/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; a `role="button"` host bypasses `lfTakesPress`; a
`region` match 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`) where
`aimableAt` now follows them.
- A closed gloss's tip is read inside its sentence. Both readings put an
`lf-gloss`'s hidden explanation between the words around it, so a quote
of the visible sentence "static analysis of the orchestration file" on
`examples/pr-walkthrough.html` resolves 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.
- Incremental page reading. While a script rewrites words every frame,
each hover frame builds the page's reading again: 6.5 ms of a pointer
move at 1,600 sections, measured at 8fa11f8. The watcher could re-walk
only the subtrees its records name.
- Light slots in `renderedChildren`. Margin layout's `renderedChildren`
(`shadow.js`) and focus.js's `renderedElements` (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.
- `pageRange` across 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.
- A double or triple click on Back can shrink the panel out from under
the pointer, so the later clicks land on the page, select its words and
close Threads; main does the same. The guard hears only presses inside
the panel. Covering this means moving its listeners to the document's
capture phase, where it would refuse a press outside the panel whose
run's last press was on a panel control the panel drew after: every
press on the page would pass through it, and a deliberate double-click
on page words just after a press on Back would be refused.
- A live update that redraws the panel during a hold, such as a comment
admitted from another tab, still gets the next tap on another control
refused, since the guard counts the panel's draws rather than asking
whether the press moved the control under the pointer; main does the
same. This and the Back case above both want one owner of a run of
clicks across the surfaces it changes, the panel and the page.

> _This was written by Claude Code on behalf of max-sixty_
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_
max-sixty added a commit that referenced this pull request Nov 8, 2026
…and (#5719)

A long page lists its threads and decisions in the Page Map, but nothing
showed where they stand along the page. `lf-toc` now marks it on the
contents it already draws, in the gutter beside its rule, as an editor
marks lines beside its text. On the map, an upright bar a line tall just
right of the spine says a section holds open threads (accent) or On me
items (green); while the changes view (`v`) is on, a changed section's
stretch of the spine is drawn in the face a change wears in the margin
(`--lf-change-bar`), under the lens so the lens still shows the part in
view. Where `lf-toc` is the disclosure in the column, or an open
outline, the same bars stand between the outline's rule and its words,
and a changed section is its stretch of that rule. A marked row's link
previews its counts alone, such as "1 thread · 1 waiting on me · 1
change", to a resting pointer, a held finger and keyboard focus, and a
screen reader hears them as the description after the link's name; the
preview leaves out the section's name, which the row's words already
say, so where the only clear room beside a row holds one line, that line
is the count. A row with nothing to count previews nothing, as before.

What stands before the first section, such as a thread on the lede, is
the map's title row's. The column's disclosure and the outline beside
the body leave that row out, since the title stands just above, below or
beside them, so their head carries its marks instead: the disclosure's
toggle while it is open, which Tab reaches, and the outline's "On this
page" label, which a pointer or a held finger reads and which takes no
focus, since the walks and the Page Map reach those threads and
questions by keyboard. Each previews its counts under "Before the first
section", which its face doesn't say.

Marks move nothing and stand outside the words, so none reads as their
punctuation: out of flow, one column at every depth, and taller than any
letter beside them. They hold no control; a press on a row still goes to
its section. The crowded margin's open outline takes the column's rule
and inset, so it has the same gutter. Two other looks were tried and
dropped: a dash after the words, which read as an en dash, and dashes
ticked off the rule with every map label inset 6px further, which
rewrapped labels on every map and stacked into a letter E beside a
changed row in the column.

Which section holds an item is the rule On me groups its items by and a
link's preview names a place by, `partOver` (#5616): an item belongs to
the first contents row met climbing from its element through the parts
over it, so a paragraph under a heading `max-level` leaves out counts in
the row above, and an element a row goes to, such as a whole section a
thread is about, counts in that row. `partOver` is now exported from
`widget-api.js` and documented in `module-reading.md`; that is the only
addition to the public package API. Threads stand at the element their
anchor names, On me items are `obligationsIn(main,
readObligations().user)` at the widget asking each, and changes are
`comparisonChanges(main)`, each counted once per section its blocks
touch; a removal counts in the section it was taken from, so a paragraph
removed from a section's end, whose gap stands before the next heading,
marks the section that held it (`toc-marks.js`).

`lf-toc` is now a `LeafElement` so that it draws again exactly when the
threads, the obligations or the comparison change, and for nothing else:
no scroll, resize, pointer move or keystroke recomputes marks. Its
frame, outline and map geometry stay its own imperative work, drawn into
the same nodes. The map's rows no longer carry `z-index: 2`;
`.lf-toc-rows` isolates its own stacking context instead, so a changed
stretch can sit under the lens.

The row previews exposed a placement defect in the preview owner, fixed
here in `clearRoom` (`preview.js`), outside `stand`. A box around a
preview's subject counted as a control to keep clear of wherever it took
the pointer, and `lf-toc` takes it because it draws its own content, so
inside the contents, drawn across the column at 700px, no side held a
line and a row's count preview stood over the next row. A box around the
subject now counts only where a press acts on it, as the card a press
opens around a chart does (#5617), not where it takes the pointer only
to be read; the controls it holds are still tested for themselves. A
row's preview there now takes the owner's ordinary places, clear of the
rows around it, and covers nothing: in the column at 700px, "Record the
baseline" and "Verify" each preview their one line of counts beside
their words, in Chromium and Firefox, where that room held only part of
a two-line preview before its counts became its whole reading. Dropping
every box around the subject instead broke the chart-in-card guarantee
in both engines.

The `sidebar-contents` fixture now holds seeded threads (one on its
lede, one resolved), two questions and an earlier version, and two
stills states reach it: `contents-marks` and `contents-marks-changes`,
each the spine in a wide window and the opened column outline in a
narrow one.

Tests: `tests/runtime/toc-marks.test.mjs` holds which section each item
counts in (a heading over it, a heading `max-level` leaves out, a whole
section, a nested section, the start row, and a removal before, after or
in an element, a section's end included) and the preview's words. In
`test_contents_and_glosses.py`, one test holds the marks on the map and
in the column, that none stands among a row's words, the previews on
focus, a row's its counts alone, and their descriptions, a count kept
whole where the room beside a row holds one line, the title row's and
the toggle's marks, a thread arriving, the changes view, and that no
mark moves a row; another holds the label's marks beside the body.
`test_previews.py` adds an owner test in both engines, failing before
the fix, that a preview inside a widget drawing its own content stands
whole and clear of the links beside it.
`test_a_route_taller_than_the_map_returns_to_an_open_outline` fails on
main as it does here, inherited from #5637 and tracked in #5705.

Open for review: a thread counts at the element its anchor names
(`anchor.section`), so a passage quoted in a paragraph without an id
counts in the section of the nearest element around it that has one, as
a heading's link preview already counts it; a question asked in a thread
marks only as that thread, since `obligationsIn` places no message
obligation; and the preview owner measures a new reading's height with
the room a previous, fitted reading left it, so Tab from a clamped
preview onto the next can take a side too short for it (seen in Chromium
in the owner test's first draft; not fixed here, since it is in
`stand`).

> _This was written by Claude Code on behalf of max-sixty_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants