Repository navigation
A chart says the value under the pointer, focus or a held finger - #5617
Merged
Merged
Conversation
…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.
…held finger
Every lf-chart now previews the value its reader aims at, in the page's preview face,
above a ring on the point and a dotted rule from it to its axis. A resting pointer reads
the nearest point; a finger held on the drawing reads the one under it and slides along
the drawing to read the next, while a vertical swipe still scrolls the page; and with
the chart focused, which now takes a Tab stop, the arrows step along a series and across
to the next, Home and End reach the series' ends, and each step is announced. Leaving
the drawing, or the chart, puts the ring and the preview away.
Which marks say their values: every line, area, bar, cell, dot and rect, or, where the
author gives any mark Plot's `tip` option, exactly those, so a rule can have one and a
decorative mark can lose one. Plot draws no tip of its own for them. A mark's `title`
channel says its own words, and Plot's `<title>` elements, the platform's tooltip beside
the preview, are removed.
What a tip says: where the point stands (a category, a time, a facet, a series, or x
after its label where both axes measure), then its value before the axis label, a
stacked segment by its own share: "w2 · fixes" over "14 hours".
How the point is found: chart-points.js reads each mark's points through the render
transform Plot gives every mark (its index and `values.channels`), sorts them along the
axis they stand at, and finds the nearest by binary search on Plot's pointer rule
(within 40px, the other axis counting 1% except in a scatter). Plot's own pointer
transform, the one `tip: true` adds, isn't used: no key can move it, it scans every
point on every move, and a mouse press pins it until the next. A move or a step that
reaches another point costs 0.4 to 0.6 ms in Chromium on a chart of 50 points or 5,000,
alone or among fifty charts.
The preview owner (preview.js) gains what a value inside an element needs:
- `lfPreview()` may answer `{words, at}` or `{popover, at}`, `at` a box in client
coordinates. The owner stands an anchor element of its own there, by insets from the
element, so the preview stands by a point no SVG shape could anchor, and it stands
above that point, as a held preview does, leaving the axis below in view.
- `previewChanged(element)` (portable-api.js, an `lf-preview` event) says the element's
preview changed. The owner redraws a standing preview in place, with no dwell or fade,
or shows it on the route reading the element: a finger's hold, including one that slid
off its target onto nothing; focus the browser shows, or a key acts on, since Firefox
shows no focus a key lands on after a pointer gave it; or a pointer over it, after the
dwell.
Docs: lf-chart's instructions tell authors the tips exist, how they read, and how `tip`
and `title` change them; module-input.md, "Previews", gives `{words, at}` and
`previewChanged`, and browser/AGENTS.md names them.
Tests: browser tests for the pointer and keyboard routes, a held finger, and an author's
picked marks and title; runtime tests for the words, which marks say them, the nearest
point against a brute-force search at 50 and 5,000 points, and the steps. A stills
state, chart-preview, shows the gallery's line chart under the pointer.
…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.
The owner's commit takes over what this branch changed in preview.js: a box in client coordinates as where a preview stands, previewChanged(element) and its lf-preview event, a key on a click-focused element counting as the keyboard's in Firefox, and a held finger reading across gaps. preview.js, portable-api.js, widget-upgrade.js, controls.css, browser/AGENTS.md and module-input.md are the owner's as they stand.
…w keeps it up
lf-chart's `lfPreview` answers `{name, detail, at}`, the contract every preview now
shares: the point's place as its name, what it measures as its detail, and the box of
its ring as where it stands. It says the same on every route, and null off a point, so
what holds the chart may say its own.
A preview redrawn in place, as a chart's is each time the pointer, a key or a finger
reaches another point, now stays up. `show()` ended the standing record's watch on its
holder with `standing.stop()`, and ending a watch runs its disconnect, which hid the
preview it was redrawing because `shown` was still that record: on the pointer route the
tip went away at every other point, and on the keyboard's after each step. `shown` is
cleared before the watch ends, as `hide()` clears it.
Tests: the pointer and keyboard test and the author's choice of marks run in Chromium
and Firefox; the pointer test reads the preview open after the pointer reaches another
point, which fails without the fix; Escape puts the chart's preview away and the next
Escape leaves the chart, the owner's step order. The held finger stays Chromium's, since
Playwright holds no finger in Firefox.
A chart's pointer and finger now read the point Plot's own pointer picks, by Plot's rules, where chart-points.js had picked by a model of its own that a review found wrong in nine places. Each mark that says its value gets Plot's `tip` option with a render that draws nothing and reports the point Plot picked and its facet. The tip takes the mark's `frameAnchor`, which Plot's own tip leaves at the frame's middle: hovering a bottom-anchored `dotX` with Plot's `tip: true` shows nothing. It keeps a direction the author named, and a mark with none reads along the axis its points stand at: a bar along x, a horizontal bar along y, a dot in both. Plot's `input` event stays swallowed at the figure, since the render says what it can't, the facet. A mouse press inside the drawing stops short of Plot's listeners, so Plot never pins its pick; Leaf's own press listeners hear it first, in capture. Each move costs Plot's scan of that chart's points, which the window shows, and a strip plot's column is no longer the worst case of a search of our own. The keyboard keeps its own steps, since no key can move Plot's pointer. It places each point by Plot's anchor rule, now with the mark's frame anchor, and gives each facet its own series, so Right moves along a line within its facet and Down moves to the next. Points at one place merge only when they say the same, so two titled dots at one place are both read. Focus landing on a point the pointer reads makes that point the keyboard's, and a pointer that then leaves, or picks nothing, leaves it there. A redraw finds the reader's datum by its mark, facet and values, not by its place in the drawing's order. A time reads to the second or millisecond its datum has. Tests: a browser test, in Chromium and Firefox, moves the mouse over a grid on four charts, each also drawn by Plot alone with the tip lf-chart gives it, and holds the chart's ring to the anchor of Plot's own tip: vertical facets, a dot anchored to the frame's foot, a `tip: "y"` scatter and default bars. It fails when the mark's frame anchor isn't passed. It replaces the runtime test that checked the old search against its own formula. The runtime tests compare points with the circles Plot draws, frame anchor and facets included, and cover the tip options, facet series, two readings at one place, a redraw's datum and sub-minute times. The keyboard test hovers a point, tabs in and moves the mouse away. A `tip: true` mark is read as Plot reads it, nearest in both axes, so the author test aims at its dot.
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.
…itself Plot's pointer can't be a passive picker: it says what it picked only by drawing its tip again, replacing a node in the drawing on every pick, and it pins a pick on a press from a listener of its own. On a 5,000-point strip that replacement and the style pass the next reading forced took a pointer move's p95 to 35.5 ms, 88.7 ms among 99 small charts, and 480 ms on a chart of 100 marks, which also announced 2,671 preview changes over 600 moves. So Plot gets no tip to draw, and the chart owns selection: - Once per drawing, chart-points.js reads each datum from the render Plot gives its mark, under the name the render gives it (mark, facet, index): where Plot's pointer reads it (a band's or an extent's middle, the mark's frame anchor, its facet's offset) moved by the mark's `dx` and `dy`, where Plot draws it and its pointer doesn't look. - A move reads every point of the chart under it once by Plot's pointer's rule: 40px (a tip's `maxRadius`), the axis the tip names or the mark's points stand along counting whole and the other a hundredth inside a facet's frame and whole outside it, and the nearest of each facet and mark compared whole, the first of equals winning. One selection, one preview change, per input. The same pages now take 0.7 ms at p95, and the 100 marks 540 changes. - With no tip, nothing pins and no press is caught: the chart no longer stops a mouse press inside its drawing, and a mark's or an ancestor's listener hears it. - A key crossing to another facet keeps its place in its facet, reading positions within the facet rather than on the page, so from "a · x 2" Down lands on "b · x 2". - A redraw finds the reader's datum by its mark, facet and every channel's value, so two readings at one place, two titles or two fills, stay apart. - Readings at one place merge by what they say, read once each and indexed by it, where each new one was read against all before it: 5,000 titled dots at one place took over a second. - `step` with no point to start from reaches a series' last point on End. The comparison test now also holds the datum each pointer position reads, by title, to Plot's own `input`, adds a chart of two marks, where the chart reads whichever of Plot's tips stands nearer, and moves a mark by `dx` and `dy`, where the ring and datum must be the circle Plot draws under the pointer. It fails without the offsets. The runtime tests cover the weights each mark reads by, `dx` and `dy` against Plot's circles, crossing side-by-side facets and redraw identity for coinciding readings.
Round 4 keeps a standing preview open through previewChanged, the fix this branch carried in preview.js, so preview.js is the owner's as it stands and the branch no longer changes it.
Round 4 lets a pointer's preview take the pointer, so the pointer can cross onto it and read it (WCAG 1.4.13). A chart's preview stands above its point, so it can come up under a pointer resting near the top of a bar, and the chart heard the pointer leave toward it, dropped its point and the preview closed under the pointer. Now the chart keeps the pointer's point while the pointer is on a tooltip, and drops it when the pointer goes on to anything but the chart, whose next move reads from where it comes. The pointer test crosses onto the preview and reads the same words with the ring still drawn; it failed at its first hover without this.
… layout The third round's review found the chart picking less than Plot's own pointer and stalling a resize of many charts. Picking. Points that stand together and say the same were merged before any pick, so the second mark's points were gone: one data drawn with `tip: true` and again with `tip: "x"` read nothing 110px above a point that Plot's pointer picks through the second mark, and the same with `maxRadius: 1` beside `maxRadius: 80`. Now every mark keeps all its points and picks by its own axis and reach, and a pick of a point another stands on reads as the first mark's, so the keyboard still steps each reading once. A tip's `px` and `py` now pick each datum by those values, scaled as Plot scales them, while the ring stands where the datum is drawn; before, the chart ignored them and read "left" where Plot reads "right". Words. A point now says every channel Plot's tip says, the ones a mark's `channels` option adds included, in place of a fixed list of six; a colour written as a colour and the channels Plot's tip ignores stay unsaid. A tip's `format` words them as Plot's does: false leaves a channel out, a function or a d3 format string gives its words, and a format given alone is the title's. The vendored Plot module exports d3's two formatters for this as `d3Format` and `d3UtcFormat`. The format's key order is not kept, since the preview says the place first. The author reference names these options. Sizing. Each drawing read the box's height back with `offsetHeight` to find a legend, which forced a layout per chart: narrowing a page of 100 charts took 8.8s in Chromium and 2.3-7.5s in Firefox, almost all in those reads. The chart now takes its width and its first height from its ResizeObserver's entries, holds the drawing's box at that height, and only a chart with a legend watches its drawing once per width, redrawing into the room the legend leaves. The same resize takes 193ms in Chromium and 106ms in Firefox, with no layout reads. A width delivered while the first drawing is under way is drawn once it is in, and a failed redraw fails soft as before. Plot's pointer could pick for the chart through a stand-in svg; the header now says so, and why the chart copies its rule instead: that drives the pointer through an undocumented context, and a faceted pick lands a frame late. A callback Plot called with each pick would remove the copy. The comparison test against Plot's own pointer gains the two-marks-one-data cases and the px case, and now checks the words of the tip nearest the pointer at every aim, where it read `svg.value` and skipped aims with two tips. The runtime tests cover each mark's rule and reach, px, format and added channels. Two findings stay open, since the preview owner decides them. Leaving the window from the tooltip leaves the chart's ring and its reading behind, and a redraw after Escape shows the dismissed preview again.
…end's height as it changes
The fifth round's review found two errors from one cause, the chart working out
what Plot's tip options mean instead of reading Plot's result, and a legend that
overflowed when a late font made it taller.
Each mark that says its values now gets the tip Plot builds for it (as Plot's
`inferTips` does), made with Plot's own `tip`, `pointer` and `initializer`. The
pointer's listener is left off and the tip draws nothing; the chart reads what Plot
hands it instead. Two errors go with the copy of Plot's rules:
- A tip's `px` and `py` are now Plot's channels, with every transform their scale
applies. With `x: {percent: true}` and reversed pick values the chart read
nothing where Plot reads the opposite datum; now it reads what Plot does. A datum
with no px stays in the reading for the keys, though the pointer passes it by as
Plot's does.
- Which channels a point says, and the words a tip's `format` gives each, are now
Plot's own decision (`getSourceChannels`). The vendored module exports it, as an
adaptation of Plot's tip module, so `format: {fill: true}` brings back a colour
written as a colour and `format: {href: true}` a link, as in Plot's tip.
That deletes the chart's copies of: the list of channels Plot's tip ignores and the
rule dropping literal colours, the chase from a channel to its source, the reading of
`format` (false and null, a function, a string as a d3 number or time format, a
format alone as the title's), the px and py evaluation and scaling, and the patch of
each mark's render. The d3 formatters the last round exported are gone. The module
now exports Plot under `Plot`, which is what an author's chart reads, with the tip
rule beside it, so authors' `Plot` holds only Plot. The bundle is 269 bytes larger
than Plot alone, 104 gzipped.
A legend's height comes from its type as well as its width, so the chart now watches
the drawing holding a legend for as long as it shows, rather than once per width.
When a late font set a 14-team legend 12px taller, the drawing ran 12px past its box
onto the next paragraph; now it draws again into the room the legend leaves. That
redraw waits for the next frame, because the page starts watching a new drawing's
boxes as they arrive, and an observation started at the depth just delivered is one
the browser reports as a ResizeObserver loop.
The comparison test against Plot's pointer gains a pick channel on a percent scale, a
stacked bar and a case with no title whose tip format names channels, `true`
included. It now checks that the chart says every value Plot's tip line says. The
percent case and the format case fail on b8cb73f, and the new legend test fails
there in both engines, the legend 33px and then 45px tall and 12px past the box. On a
stacked bar the ring stands where Plot's tip does, at the middle of the segment, and
both say the segment's own value.
…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.
…hat measured it
What a point says now comes from the lines Plot's tip would draw. The bundle's
adaptation of Plot's tip module exports its row builder (`formatChannels`, as
`tipRows`) beside `getSourceChannels`, each row naming the channel it says. The
chart supplies the words for channels the author's format doesn't word (a time as a
reader says it) and arranges the rows, place first, then the measures. It keeps
Plot's tip's rule of saying a label once. That deletes the chart's own pairing of an
axis's two ends, its length reading of a stack, its skip of a value that is missing
with no scale, and its labels.
One behaviour changes with it: `Plot.dot(rows, {x: "a", y: "b", fill: "a"})` said
"a 1" and then "2 b · 1 a", repeating a's value under the label Plot's tip says once.
It now says "1 a · 2 b", the values Plot's tip says. The comparison test against
Plot's pointer gains this case and now counts each value: a reading must say each of
Plot's values as often as Plot's tip does. The case fails on d52b848.
A redraw for a legend's new height now happens in the ResizeObserver delivery that
measured it, so the frame that shows the new legend shows the drawing fitted to it,
and the frame's wait is deleted. The loop error that wait avoided didn't come from
the runtime. It came from the suite's swap watch (tests/swap_watch.js): while the
chart redraws inside its delivery, the redraw's events reach listeners the suite's
input watch wraps, whose checkpoints take the new nodes' records, and the swap watch
started watching Plot's legend, a flex row, at a depth the browser had just
delivered. It deferred only observations started inside its own delivery. It now
starts every observation at the next frame, which reports at the frame an
observation started in a task reports at. With the runtime unchanged, the 14-team
legend test passes in both engines with no loop error, and fails with it on the old
watch. The watch's own tests pass.
Measured on 100 legend charts, d52b848 against this: narrowed to 360px, where the
legends rewrap, the page settles in 3 frames rather than 4 in both engines, with 200
drawings in each; narrowed to 560px, both take 2 frames and 100 drawings.
The preview owner's round 5 says when a preview ends (`PREVIEW_ENDED`). The chart now takes its point and ring off then, so the ring always matches what the preview says. Two findings from the earlier review close with it: - Leaving the window from the preview left the ring and the chart's reading behind, since the chart was waiting for the pointer to reach something else. Now both go with the preview. The chart's own watch on the document while the pointer was on the preview (`#lend`) is deleted; the owner already follows the pointer there. - After Escape the ring stayed, and a redraw (a resize or a legend refit) moved it to the same datum and called `previewChanged`, which reopened the tooltip. The owner now keeps a dismissed preview closed, and the chart has no point left to redraw. The ring comes off once the task that ended the preview is done, and only if the route whose preview went still holds the point. A Tab puts a resting pointer's preview away before focus moves, and focus arriving takes the point over, as review finding #7 asked. Taking the ring off at once would have hidden it and shown it again in one frame, which the write watch reports. The value test now checks, in both engines, that leaving the window from the preview takes the preview, the ring and the reading away. It also checks that after Escape a redraw for a new width brings back neither. The Escape check fails with the chart as it was before this change.
…ws its preview
Three findings from the sixth review.
A key's step is a new aim. Each arrow, Home or End step now declares a walk
(`beginWalk`, the public declaration a widget makes as it steps through something of
its own), and the page counts a walk landing as the user aiming again. Tab onto a
chart, Escape, then an arrow used to move the ring while the tooltip stayed closed.
Now the tooltip opens again, and the step goes on from the point Escape put away
rather than from the first. Each step announces the point's lines and its place in
its series ("Point 2 of 4"). The pointer's case, where moving to another bar after
Escape leaves the tooltip closed, is unchanged: the owner has no way yet for an element
to say that the pointer aimed at a new point inside it.
A point says a line for each row Plot's tip says, with Plot's label beside its value.
Before, the rows joined into a name and a detail and repeated words merged, so
`Plot.dot([{district: "A", team: "A", sales: 2}], {x: "district", y: "sales", fill:
"team"})` said "A" over "2 sales" where Plot's tip says district A, team A and sales 2.
Now it says "district A", "team A", "2 sales". Where the point stands comes first,
each line reading after its label ("week w2", "kind fixes"); what it measures comes
after, reading before its label ("14 hours"). The comparison test against Plot's own
tip now pairs each line with a row of Plot's, label and value together, so a swapped
label, a merged row or an invented line fails. It gains this case, which fails on
13ba327.
The suite's swap watch watches a row from the frame it is drawn in again. The last
round started every observation a frame late, to avoid a ResizeObserver loop when a
chart redraws inside its own delivery. That missed a row drawn in one frame and swapped
the next. It now wraps the page's ResizeObserver so it knows when one of the page's
deliveries is under way, and starts an observation late only then or during its own
delivery. A new swap-watch test covers the frame-to-frame swap and fails on the
previous watch. The legend test still passes in both engines with no loop error.
…elivery draws
Each line a chart's point says now reads as Plot's tip draws it: the label, then the
value, as in "offline sessions 8,412" and "y 2". The value came first for a measure
before ("8,412 offline sessions"). That made a generic chart alternate "x 2" with
"2 y", read awkwardly with a long label such as "share of checkout traffic (%)", and
asked authors to label each axis by what it counts. The lines keep their order, where
the point stands first and what it measures after. The author reference drops the
clause about labelling axes by what they count, and chart-points.js's header records
the rejected order.
A format that gives a value nothing (`format: {y: () => null}`) said "null y". It now
leaves the label alone, "y", as Plot's tip does, which turns a nullish label or value
into nothing as it draws a line. The comparison test against Plot's own tip gains
this case and now expects each line label first.
The suite's swap watch now knows when a ResizeObserver delivery is under way, the
page's or its own, from the first callback of a rendering update until the next task,
so a chain of microtasks after the callback counts too. Before, the count dropped
after one microtask. An element it first sees then is watched from the next frame. Its
size as seen is kept as its baseline, and once watched it no longer counts as arriving.
That fixes two cases:
- A row the page draws two microtasks into its own delivery, above the box that
observer watches, raised a ResizeObserver loop error.
- A row drawn during a delivery and grown by a swap in the next frame went unseen.
Both now behave in Chromium and Firefox. Two new swap-watch tests cover them and fail
on d9afcfc. Reading a row's size without watching it inside a delivery at all was
tried and lost the frame-to-frame swap. Without the rendering update's boundary, the
watch can't tell a row the frame already painted from one arriving in the same frame
as the swap.
The swap watch's baseline for a row is now its first painted arrangement: the box the browser drew it at in the update that first painted it. An IntersectionObserver takes that box after every ResizeObserver delivery of the update and before its paint, and it may start watching inside a delivery. A ResizeObserver started there, at a depth the browser has already delivered, is a loop error. - Until its arrangement is in, an element is arriving in the frame being judged. - Once it is in, the element stands at that size and at the height it appeared at, and the ResizeObserver, started at the next frame, reports every size after. - The watch reads the entries with each batch of records it takes, so a swap in the next frame is judged against them. The ResizeObserver wrapper and its delivery window are deleted. Every observation starts at the next frame, outside any delivery, so a page's chain of microtasks can no longer start one inside its own. Behaviour this changes, each now a test in both engines: - A row drawn during a page's delivery, in the callback or two microtasks after it, then shrunk by a swap the next frame, went unseen, since its occupant's appearance height was never kept. It is reported now, as the growing swap already was. This fails on c9f6f5f. - A row another delivery of the same update resized before paint was judged from the size seen at insertion, 24px, though the frame painted 40px, so a 40px swap was reported. It is judged from 40px now and isn't reported. This fails on c9f6f5f in Chromium. - A row a task drew after a paint and swapped before the next paint was reported, though its first occupant was never painted. It arrives in the frame of the swap now and isn't reported. This fails on c9f6f5f in both engines. All 25 swap-watch tests pass, and the chart legend test raises no loop error in either engine.
…o ResizeObserver The swap watch no longer has a ResizeObserver. In each update in which the page changed anything, an IntersectionObserver reads every watched box: each flex row, its occupants and the box around each row. The reading comes after that update's ResizeObserver deliveries and before its paint. That one reading gives a row its first box and its appearance height, and gives every box a swap is judged against or by. All of them are in the coordinates the user sees, transforms included. A judgement before trusted input measures in the same coordinates. The previous box is the one the last such update read. A box that changes while nothing in the page changes, such as an image or font arriving or a transition running, is judged against the box before it. A hidden tab runs no update, so whatever it changed is read in the first update after it returns, which the return exemption covers. Deleted: the ResizeObserver and its re-watch after each judgement, the first-arrangement observer and its special case for arriving elements, and the pending and observed sets. Behaviour this changes, each now a test in both engines that fails on e1cb779: - A row under `scale(.96)` whose 40px occupant gives way to another 40px one was reported as 38.4 → 40. Its first box came from the IntersectionObserver, which includes transforms, and later boxes from the ResizeObserver, which doesn't. It passes now. Main does not have this bug; e1cb779 introduced it. - A row inserted at 24px, then grown to 40px by another observer before its first paint, then shrunk to 24px by a swap, went unreported, because its appearance height was only kept while it was arriving. It is reported now. Main and the merge base 6b3159d have the same swap watch and miss it too. - On a row that had stood for a few frames, a page observer on a deeper box replaced the 24px occupant with a 40px one inside its delivery. With the watch installed, both engines raised a ResizeObserver loop error, and without it neither did. The swap went unreported on e1cb779. Main reports it but raises the same loop error. Now it is reported with no loop error. Cost, at 9,000 watched boxes per changed update (about the largest scaling page's 8,728): about 1.0 ms of observe calls and 1.4 ms of delivery in Chromium, and about 0.45 ms and 4.1 ms in Firefox, with no long frames.
…ries The chart branch's swap watch (tests/swap_watch.js) goes back to main's, with one change, the one d9afcfc made. The branch's later sensor rewrites (c9f6f5f, e1cb779, 3375ff0) each fixed cases main also gets wrong and broke cases main gets right. Redesigning the sensor becomes a change of its own. The one change: the watch wraps the page's ResizeObserver, so it knows when one of the page's deliveries is running. An observation the watch starts then, in the callback or in a microtask the callback queued, waits for the next frame. Main's watch already waits like this for an observation started in its own delivery. The chart refits its legend inside the delivery that measured it, and the swap watch takes that redraw's records there. Main's watch then started observing Plot's legend row at a depth the browser had already delivered, a loop error in Chromium on test_a_chart_gives_its_legend_the_room_a_late_font_takes. The wrapper's comment now also says that a microtask queued by those microtasks runs after the count drops, which d9afcfc's comment claimed to cover. Which behaviour is main's and which is the branch's, from every swap-watch reproduction in review rounds 7 to 11, run against both watches in Chromium and Firefox. The two engines agree on every case. - The branch's: the legend test raises no loop error. A row the page draws in its own delivery's callback, which main observed at once into a loop error, is observed from the next frame. Its growth or shrink still goes unseen, as on main. A row one observer draws and a second resizes before paint is no longer a loop error, and its later equal swap isn't reported. - Main's, unchanged: a row drawn two microtasks after a delivery is a loop error, and its swap goes unseen. A standing row that a page observer swaps in its delivery is reported with a loop error, and one a second observer restores before paint is a loop error with nothing to report. A row grown before its first paint and then shrunk goes unseen. - Right on both: a row drawn in an animation frame and grown the next, a row drawn after a paint and swapped before the next, a scaled row's equal swap, a swap a page IntersectionObserver undoes, an image, a finished animation or a sibling selector changing a row before an equal swap, a CSS hover swap, and padded rows growing under scale(2) and zoom:2. The reproduction tests this watch fails leave the branch for the sensor's own change: test_a_row_the_page_draws_in_its_own_size_delivery_is_watched, test_a_row_grown_before_its_first_paint_is_judged_at_that_size and test_a_standing_row_a_page_observer_swaps_is_judged_without_disturbing_it. The tests it passes stay: a row drawn in one frame and grown the next, a row judged by the arrangement it was painted in, and a scaled row's equal swap. Input costs stay main's. On scaling's asks page at 512 sections, timed as `leaf-dev scaling` times them, over eight alternated runs of each watch: | ms per input | main | this watch | paired difference | |---|---:|---:|---:| | Chromium key | 12.3 | 12.8 | +0.55 ± 0.45 | | Chromium wheel | 11.4 | 11.2 | −0.17 ± 0.49 | | Firefox key | 11.7 | 12.5 | +0.81 ± 0.68 | | Firefox wheel | 11.1 | 11.2 | +0.11 ± 0.26 | The wrapper's only work is a count and a microtask for each of the page's deliveries, and that page makes 0.1 to 0.2 per keystroke.
Main's owner wins every conflict. The branch carried the owner's earlier rounds, which main has since reworked, and those files now read as main's: preview.js, focus.js, widget-upgrade.js, contribution-controls.js, the trace timeline, the owner's tests, the render harness, and the prose that documents them (browser/AGENTS.md, keyboard/AGENTS.md, module-input.md, notes/browser-support.md). Three files merged without conflict but carried those earlier rounds too, and they are main's again: check-api.js no longer exports `pointRange`, which main's owner no longer has; dispatch.js no longer counts a command that is running, which main's owner no longer reads; and controls.css loses the preview face, which main keeps in the runtime's chrome.css. What stays the branch's: the chart (lf-chart.js, chart-points.js, chart.css, its registry line), Plot's bundle seams, the gallery's chart-preview state, the chart's tests, and the swap watch as main's plus its one wrapper.
… until the next touch Main's preview owner (#5614) reads a pointer or key reaching something new inside an element as a new aim, `previewChanged(element, {aim: true})`, which shows its preview whatever put the last one away. The chart now says so wherever the pointer or an arrow reaches a new point, so after Escape the next point the pointer reaches shows its preview. A pointer still on the point Escape put away reads nothing until it reaches another. A key's step still declares its place in its series (`beginWalk`), which main's owner no longer reads as an aim. Main's hold rule reads a finger at the platform's long press, and the release presses nothing and leaves the preview standing until the next touch. The chart keeps a held finger's point and ring after it lifts, while the chart wears `data-lf-held`, until the owner ends the preview. One change to the owner. It placed a preview afresh at every aim, so each of a chart's points chose its side again. On a chart at the window's top, the preview flipped between above and below its points as the pointer swept them: four flips in one sweep of 35 points. An aim inside the element the preview already stands for now keeps where it stands, its side and offsets carried to the new point's box, and the preview moves only when that room no longer holds a line. The same sweep now changes side once, at the first point too high for above, and in the window's middle it stays above every point. No sweep puts it over a point. `show` and `stand` lose the flag that carried the aim. Tests: - The pointer test now checks that Escape keeps the pointer's point quiet and that the next point shows its preview again. - The hold test follows main's rule: the reading comes at `long_press`, and the lift leaves the preview and ring until a touch elsewhere puts them away. - A new test sweeps a chart at the window's top and checks the preview keeps its side. Each new assertion fails on the code before this change. The side test fails on main's owner in both engines, reading above, below, above. Measured against 0666c74, the branch before main's owner: - A pointer move on the 5,000-point chart is still at most 1 ms at the 90th percentile. Chromium's p90 went from 0.7 to 0.5 and 0.8 ms; Firefox's went from 2–3 ms to 0–1 ms, read on Firefox's 1 ms clock. - Narrowing a page of 100 charts to 680 px took 192–200 ms against 290–296 ms in Chromium, and 151–176 ms against 182–212 ms in Firefox. The earlier version always ran first, so part of that gap may be order.
…rk ends with its reading Three fixes from the pre-landing review of ad89ef5. Each has a test that fails on ad89ef5. A new aim keeps the preview's side and the edge it stands by. A new point inherited the previous preview's top corner, so a longer reading after a shorter one grew down toward its point and was cut to what fit there. Moving from a dot titled "First" to one titled "Second / 20 hours / 3 tasks" at the same height showed only "Second" in both engines, though there was room above. The preview now stands on the same side of the new point, by that side's edge: its bottom when above, its top when below or beside. The reading's height follows its words, so the three lines show whole, still above the point. A redraw of the same reading still keeps the top corner, so words that grow there never move its first line. Side-keeping is unchanged: on a chart at the window's top the preview moves below once and stays there. A mark ends with the reading it was drawn for, by that reading's identity. Tab onto a chart, point at another datum, then press Escape: the preview went, but the ring and the chart's reading stayed in both engines. The chart compared route names, and it took the reading for the pointer's while the owner held it on focus. `PREVIEW_ENDED` now carries `detail.declared`, the object the element's `lfPreview` returned for the reading that ended, in place of `detail.route`, which nothing else read. The chart takes its ring off only where that reading is still its last and its point is unchanged. A Tab that puts a resting pointer's preview away still hands the point to the keyboard, because focus arriving reads it again first. A hold that shows a reading has read, wherever the reading came from. `show` now records it once for every caller, where the long press and a slide onto a neighbour each used to record it themselves. Before, a finger held where no point was near enough read nothing at the long press, then slid onto a point, which read it. The release then clicked and the preview closed. Now it presses nothing and the preview stands. That test also found that the chart swallowed every event dispatched at its drawing, including a script's long press over empty space. Only the `input` that Plot's pointer dispatches is meant to be held back, so now only that is.
… reading whole, and a hold reads where the finger is This fixes three findings from the review of d057bcd and adds one contract sentence. Each fix has a test that fails on d057bcd. A new aim keeps the preview's side only where that side's room holds the new reading whole; otherwise the preview is placed afresh. On a chart near the window's top, the pointer moved from a low point saying one line to a high point saying six. The preview kept its side above, where one line fit, and showed only "Highe…" in both engines, though the whole reading fit below. The six lines now show whole, below. A redraw of the same reading still keeps its top corner, which is a separate rule: words that grow never move its first line. A preview that stands for a box inside its declaring element, as a chart's point does, takes no pointer (`data-lf-covers`, the owner's existing pass-through), so the pointer goes on reading the element beneath it. Placement tests only other controls and what the preview is about, so it can't see a widget's own points. In the gallery, baseline run 1's preview covered run 2's point, and the pointer moving straight there kept reading run 1 in both engines. It now reads run 2. Treating the drawing as an obstacle instead would have pushed every chart's preview off the plot. A chart's preview therefore no longer takes the pointer, and the chart's rule that kept its point while the pointer crossed onto the preview is deleted. A hold reads the point nearest where the finger is at the long press, rather than the chart's last point. The press that starts a second hold puts away the first hold's preview, and with it the point that preview read, so holding the same point twice read nothing the second time. That was older than this branch. The shipped contract now says that `lfPreview` returns a new object for each reading, since `PREVIEW_ENDED`'s `detail.declared` relies on it. It also says that a preview standing for a box inside the element takes no pointer.
leaf-agent
previously approved these changes
Nov 6, 2026
… ends Each of the last three changes added a way for a reading to outlive its subject's visibility, and then a way to end it: a wait, a suspension for every route, then an announcement of every Escape (`ESCAPED`). Each case came from a pointer's or a finger's reading staying alive while out of sight, which then had to hear every way the user's context could change: a native close the page holds no watcher for left one alive behind a closed popover, and ending a held reading on any focus move took a reading the user still held when a redraw gave focus back (`holdFocus`). A pointer's or a held finger's reading now ends when its subject leaves view, as main ends these: the gesture that aimed is over once its subject has gone. Only a focus reading is suspended, since focus stays and ends on its own: blur, another element focused, or a surface closing with focus in it. It comes back as its subject shows, so a focused control under a sticky header and a chart's focused point return with them. `away()` ends the reading for any other route. `ESCAPED`, its two dispatcher hooks and its keyboard notes are gone, so `keyboard/dispatch.js` and `keyboard/AGENTS.md` match main again, and so is the rule that focus moving ends a held reading. Escape with only a suspended focus reading does its normal work and leaves the reading to come back. On main the CSS-hidden preview took that Escape instead: a probe of a focused control scrolled out of its box, with an Escape step of its own, shows main's step not running and the reading gone, in Chromium and Firefox, where in Firefox the preview stood above the box rather than hidden. A focus reading's description is set before it stands, so a reading that ends there restores it too. Offline, the register admits no page scope, so the preview's own keydown listener takes Escape. It now consumes the press while a preview shows, so a modal dialog around the preview stays open, as on a live page; before, and on main, one Escape closed both. Tests, each failing on 410e9d5: - `test_a_held_reading_ends_as_its_control_scrolls_away`, in Chromium, after nothing, Escape or a back gesture: the element hears `PREVIEW_ENDED` as the control leaves view, and the control scrolled back shows no preview. - `test_a_held_reading_stays_as_a_redraw_gives_focus_back`, in Chromium. - `test_an_export_s_preview_takes_escape_before_the_dialog_around_it`. The sticky-header and chart focus tests from the last two changes stand unchanged.
… a tab panel `test_a_covering_range_preview_stays_while_the_pointer_is_on_it_over_inert_words` aimed at the preview's right edge less 8 px. The passage doesn't wrap, so where its words run wider, as in Chromium on Linux, the preview runs past the field's right edge and the aim found only `body` (`assert '' == 'under'` in CI at a1e6302). The aim now stands inside both. A 1070 px window reproduces CI's geometry locally, the old aim failing there as in CI and the new one passing. `test_a_reading_stays_while_the_pointer_crosses_onto_it_past_the_chart` gains a chart inside an open `lf-tabs` panel, whose tab stop takes no pointer (`aimableAt`), so the reading keeps a pointer that crosses the panel's words onto it. The test checks that the words under the reading are the tab stop's. It passes in both engines with no change to the code.
leaf-agent
approved these changes
Nov 7, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 7, 2026
… away first These tests have failed on main since #5614 (the preview owner), each asserting behaviour #5614 replaced on purpose. Run singly, each passes at 62cb54f, the parent of #5614, and fails at 84d9186. The behaviour each protects stays asserted. - Leaf's own controls write no `title` on Leaf; their words are their preview. A held-news notice's whole label ("1 new reply · 1 message edited"), an All pages row's account, a diff row's cut path, an On me choice's words and the joined notice in Threads were read as a title, or as the accessible description a title gave. They are now read off the element's preview declaration (`expect_preview_words`) in test_thread_surfaces, test_summaries, test_render_read_state, test_agent_replies, test_render_application_boundary, test_status_and_news, test_render_controls, test_render_floating_panel, test_diffs and test_on_panel. A screen reader now hears a notice's label as its description while its preview stands on focus, not at rest. - Focus the user moves onto a control, by Tab, an arrow or a walk, shows its preview, and Escape's first step puts that away and does nothing else (keyboard/AGENTS.md, "Escape"). A script's `.focus()` stands in for such a move. Tests that expected one Escape to close the surface the control stands in now put the preview away first, with `put_preview_away`, a new helper in render_harness.py, and then assert the step they protect: test_live_samples, test_clusters, test_entries, test_render_reactions (three tests), test_rewrites, test_playgrounds and test_render_anchors. The sites #5614 and the key-scope commit wrote inline (test_command_routes, threads/test_navigation, test_key_scopes) use the helper too. test_playgrounds still fails, now on the step it protects: once 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. That is a lost Escape for the user, not the test. Four journey tests, which run only nightly, read the same titles and descriptions: test_render_anchors, test_render_threads and test_website_server now pass; test_render_files passes the title step and fails earlier, where #5617 changed what an external file update does to the editor's gutter. A failure at line 743 of test_summaries.py, older than these PRs, hides the same notice description at line 769 in test_a_root_summary_keeps_thread_actions_outside_its_fold, which now reads the preview too. > _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 7, 2026
… wherever they show; the shift watch credits a preview riding its target (#5638) This fixes the causes left on `main` after #5614 and #5617 that #5629 didn't cover, and two gaps review found in the preview's Escape step. The file editor's gutter finding was not caused by #5617 (see **Left open**). ## Keys a control says #5614 made a control's `aria-keyshortcuts` and its preview's key chips name every key any row binds to it, wherever the user stood. A screen reader announces the attribute with no context, so it promised keys that did nothing. The Inspect button in `test_obligation_contextual_bindings_are_independent_of_widget_bindings` said `x y` while the user was on the suggestion, where only `3` presses it, and kept `x` after a nearer, unavailable declaration took it. Both now come from one reading: the dispatcher's reachable bindings from where the user is (`availableCommandRoutes`), each under the control its row or route names (`reachingNow`, `keyboard/control-keys.js`). The preview reads it as it shows. `paintCoreControls` writes the attribute each frame for the controls whose keys moved. The command hints read the same reading for their faces, and their separate per-frame `aria-keyshortcuts` projection is gone. Exports paint the attribute too. Behaviour changes against `main`: - Resolve says `r` only where `r` presses it, on its thread. With the caret in the reply, where `r` is typed, it says no key. - A focused control's own Enter and Space, the platform's press of any control of its kind, draw no chip. Its attribute still names them. - A close control says Escape only where a row says Escape presses it, as the image viewer's does. The floating panel's ✕, a margin card's and Page Map's say no key, since their Escape steps don't name the control, though Escape from inside those surfaces closes them. The panel field's Close, added in #5630, keeps its own `esc`. `test_a_control_previews_its_word_and_every_key_that_presses_it` asserted the old rule (a hover chip `r` with the caret in the reply). It now expects no key there and `r` once Escape leaves the reply for the thread. ## The preview's Escape step While a preview stands, Escape's first step puts it away. Three gaps broke that. **Inside an open popover.** In `test_a_playground_opens_its_instruction_over_the_page`, after Tab showed Copy's preview inside the instruction popover, the first Escape put the preview away, the second did nothing, and the third closed the instruction. While Escape has a step of Leaf's to take, the page holds a CloseWatcher (`keyboard/close-requests.js`), which it reads in the repaint frame. A standing preview is such a step, so the frame after the Tab made a watcher above the popover's own. Putting the preview away asked for no frame, so the stale watcher took the next Escape's close request and found nothing to do. The preview now reads the watcher again at once whenever its step comes or goes (`stepMoved` calls `paintCloseRequests`). That holds for a key and for Back alike, even with two presses inside one frame. **Back.** An earlier version of this branch refreshed the watcher from an Escape keydown listener, which ran ahead of `back_gesture`'s blocker, so the back-gesture tests got a refresh real Back never makes. That listener is gone. `test_a_back_gesture_after_a_preview_put_away_closes_the_popover_under_it` is the back gesture's form of the playground test. It and the playground test fail with `stepMoved` disabled, and pass with it. **Inside a modal dialog.** A preview of the image viewer's Close lost its first Escape, which closed the viewer and the preview together, in Chromium and Firefox; `main` does the same. The preview shows inside the topmost modal, but its scope had no root, so the modal's floor (`keyboard/dispatch.js`, `stack`) dropped it. The scope is now rooted at the preview itself. `test_a_preview_inside_a_modal_takes_escape_before_the_modal` fails in both engines without this. Letting the browser take the preview's Escape, tried before, closed the panel's thread view under the preview, so the preview keeps its step. ## A preview standing clear of news drawn beneath it In `test_threads_holds_a_row_that_joins_or_moves_behind_a_notice`, the landed row's focus preview stood where news then drew the notice of a resolved thread, and the preview stood afresh clear of it, moving its words 330 px, which the shift watch reported. That move is the preview's deliberate answer to content arriving where it stood, as on `main`: a notice arriving exactly under a preview is a rare path, which may move the preview rather than carry a hold of its own (SOUL.md, "Keep the foundation small and extensible"). The test now asserts that the rows hold still behind the notice and that the preview stands clear of it, and consumes that one move by its preview nodes, as other tests consume a deliberate move; the watch itself is unchanged for everything else. ## The shift watch and a preview riding its target Three tests that fold the panel with a focus preview on the Leaf button errored at teardown. The browser carries the preview exactly with the button (`position-anchor: auto`, `showPopover({source})`), but the watch couldn't prove the preview anchored: - it found anchors only by name; it now also reads the `source` of the `showPopover` or `togglePopover` call that opened the popover, and only that call, since one made while the popover stands open leaves the browser's anchor as it was; - it read insets only with pixel offsets; it now also reads an offset from a custom property, and a script changing that property still reports; - it required every declaration that might be in force to be anchored. The preview stands under the chrome guard's `all: revert-layer` and its own `inset: auto`, and the guard's rollback branch read that `auto` without asking Typed OM whether the inset is still `auto`. This third gap is why the implicit-anchor patch from triage passed its own tests, which had no guard, and left the finding in place. The watch's anchor tests gain the preview's shape: a guarded popover on its implicit anchor, carried by its source's translation and by its source's scroll, clean and faulted, and one asked to show again with another `source` while open, whose independent move must still report. The clean cases fail on the old watch and on the triage patch alone, and the re-shown case fails with a wrapper that records every call's source. ## Left open - Escape steps other than the preview's still rely on the repaint frame to bring the close watcher up to date. With an `lf-draft` in an auto popover, two quick Escapes swallow the second, on `main` too. The watcher's sync belongs with any change to the step Escape has available, as the preview's now is (`stepMoved`). - The journey `test_file_editor_saves_quietly_and_preserves_inflight_edits` fails at line 142 intermittently, before #5617 as well as after: locally it reported the gutter in 2 of 4 runs at `ef6c01ed8` that reached that line, 0 of 2 at `84d918681`, 1 of 4 on `main` and 0 of 5 on this branch. Right before the external write the gutter matches its lines. The watch sees the two frames after it, where CodeMirror draws the gutter rows 16 px tall beside 24 px lines before its measure corrects them. So #5617 has no hunk to bisect to, and the fix belongs in how the editor applies an external update, or in what the watch counts as content that update replaces. - `test_tab_at_a_control_scrolled_away_goes_on_in_the_column_the_pointer_is_in[firefox_browser-input]` fails intermittently on `main` as on this branch, run alone 1 time in 4 on `main` and 1 in 3 here. ## Checks `pnpm run check`, pre-commit on the changed files, and each changed or nearby browser test by node id in Chromium and Firefox where it runs in both: every test asserting `aria-keyshortcuts`, the preview's placement, focus, Escape, modal and back-gesture tests, the close-request tests, the playground, the fold tests, the Threads test and the watch's anchor tests. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
added a commit
that referenced
this pull request
Nov 8, 2026
…5701) The nightly journey `test_a_wait_takes_the_suites_deadline` has failed since scheduled run [42365682113](https://github.com/max-sixty/leaf/actions/runs/42365682113). It found 24 waits with literal 2 s or 3 s timeouts, added by #5617 (`test_previews.py`, `test_charts.py`) and #5618 (`test_render_anchors.py`). This PR drops each `timeout=` argument, so those waits take the suite's default deadline (`SERVED_TIMEOUT_MS`, which `render_harness` sets). What each wait waits for doesn't change. The literal values were sized to a fast machine, which is why the check rejects them. Verification on main `fcad5fa09`: the check fails before this change, listing all 24 sites, and passes after it. The 19 browser tests that hold those waits pass under `--run-main` (42 cases). The same check went red for the same reason on Nov 5, and #5455 fixed that. It's a 2–6 s static scan of the test sources, but it lives in `tests/journeys/`, which only the scheduled run reaches. So a pull request that adds a literal deadline passes its own CI, and main finds out the next day. The durable fix is to run this check on every pull request; I'm filing that separately. Refs #4225 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 8, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 8, 2026
…; the sidebar outline marks its introduction on its label The preview owner kept a preview clear of every box around its subject that took the pointer (`taking` in clearRoom, preview.js). `lf-toc` draws its own content, so the whole contents counted as one control: inside it, drawn across the column at 700px, no side held a line, and a row's count preview stood over the next row, letting the pointer through. A box around the subject now counts only where a press acts on it (`CONTROL`), as the card a press opens around a chart does (#5617), and not where it takes the pointer only to be read, as a widget drawing its own content or a box that previews; the controls it holds are still tested for themselves. Dropping every box around the subject instead broke the chart-in-card guarantee in both engines. The change stays in clearRoom, out of `stand`. The outline a track beside the body shows no longer gains the title row: its "On this page" label carries the marks of what stands before the first section, and a pointer or held finger resting on it reads them; it takes no focus, since the walks and the Page Map reach those threads and questions by keyboard. The toggle and the label preview only while their marks show. Tests: an owner test in both engines, which failed before the change, holds a preview inside a widget drawing its own content standing whole and clear of the links beside it; a contents test holds the label's marks beside the body.
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_
leaf-agent
added a commit
that referenced
this pull request
Nov 9, 2026
…sured it Since #5617 a chart with a legend finishes its first drawing in the delivery of its legend watch. The pending task the chart hands the page settles there, so the page's first presentation (the upgraded, applied and presented stamps, the margin, the details shelf) ran in that delivery's microtask checkpoint and resized boxes shallower than the legend's figure. Chrome reported "ResizeObserver loop completed with undelivered notifications" on heat-loss and other corpus pages with charts. The drawing still refits its legend in the delivery that measured it, so the frame that shows the legend shows the drawing fitted to it, as #5617 intended. Only the drawing's settling waits for Leaf's next rendering pass (nextRender), where work asked for from a size delivery runs. Refs #5708
leaf-agent
added a commit
that referenced
this pull request
Nov 9, 2026
… its ResizeObserver delivery (#5736) The floating panel's size observers call `followBox`, which wrote the root's `scroll-padding-bottom` inside the ResizeObserver delivery. The margin's page MutationObserver (`margin-layout.js`, `heardPage`) hears the root's `style`, so a margin pass ran in that delivery's microtasks. Its `lf-margin-layout` event re-placed the open thread card, widening `#lf-margin-preview` (320 → 403 px) after the delivery had already gone deeper than the card. Chrome then reported `ResizeObserver loop completed with undelivered notifications`. `page-layout.js` already states the rule this broke: a size delivery may write only what nobody observes, or queue work for a frame. The fix keeps `stateFootBand` immediate, since Leaf's own landings read the band from it. The root's padding, which only the browser's own reveals read, and `announceRoom` now land in the next rendering pass (`nextRender`, coalesced). **Why it surfaced at #5630:** at #5630's parent the same writes happen in the same frame. There, though, the panel observer's first round included a detached `<svg>` at depth 1, so Chrome's second round still reached the card (depth 4). #5630 keeps that svg connected (depth 11), which leaves the panel host (depth 5) as the shallowest first-round target, and the card's resize goes undelivered. So #5630's intent and interface are untouched; it removed an accident that had hidden the write. **Verification:** `tests/journeys/test_render_drawing.py::test_a_drawing_is_sent_and_replayed_as_an_ordinary_comment` fails on main `2f47830e4` and passes 3 of 3 runs with the change. Other checks run locally, all passing: - the whole drawing journey file; - the tests that read the panel's band or land clear of it (`test_chrome_contracts`, `drafts/test_keys`, `navigation/test_threads`, `widgets/test_obligations`, `controls/test_focus`, `threads/test_composing`, three `test_render_floating_panel` cases): 35 passed; - `pnpm run test:runtime` (906), the browser type check and pre-commit. <details><summary>How the writer was found</summary> Ran an instrumented copy of the journey that wrapped `ResizeObserver` and logged each delivery with its targets' flat-tree depths, each `--lf-thread-width` write with its stack, and the margin's `heardPage` records. The error frame is the `g` `T` that opens Threads. The panel's `follow` observer (`floating-panel.js`, `sizeObserver` → `followBox`) delivers, and then a microtask's `heardPage` sees `HTML.style = scroll-padding-bottom: 192px`. It runs `layoutMarginRows`, and `margin-projection.js`'s `lf-margin-layout` listener calls `card.place()`, whose placement writes `--lf-thread-width: 553px`. At the parent the same sequence runs, with the extra depth-1 entry in the first round. `layoutMarginRows` is also a size observer's callback itself (`layer.sizes`), so the same card placement can happen inside a delivery by that route. This run neither reproduced nor changed that route. #5708's corpus-page loop errors have a different onset (#5617) and are not established to share this path. </details> Closes #5709 — automated triage Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Nov 9, 2026
…sured it (#5743) Since #5617, a chart with a legend finishes its first drawing in the delivery of its legend's ResizeObserver. The pending task the chart hands the page settles there, so the page's first presentation ran in that delivery's microtask checkpoint. That covers the `data-lf-upgraded`, `data-lf-applied` and `data-lf-presented` stamps on body, the margin and the details shelf, and it resized boxes shallower than the legend's figure (depth 8). Chrome then reported `ResizeObserver loop completed with undelivered notifications` on `heat-loss` and the other chart pages in #5708. Before #5617 the chart measured its legend synchronously (`offsetHeight`), so its drawing settled outside any delivery. The chart still refits its legend in the delivery that measured it, so the frame that shows the legend shows the drawing fitted to it, as #5617 intended. Only `draw()`'s settling now waits one hop, to Leaf's next rendering pass (`nextRender`). That is where `rendering.js` runs work asked for from a size delivery, and `page-layout.js` states the same rule: a size delivery writes only what nobody observes, or queues work for a frame. What the page draws doesn't change. Page readiness can come one frame later for a chart whose drawing finished inside a delivery. **Verification on Linux.** Each of these fails on main `2f47830e4` with the loop error and passes with the change: - `tests/journeys/test_render_gate.py::test_page_fixture_renders[heat-loss]` - `tests/journeys/test_render_gate.py::test_page_fixture_opens_without_firefox_console_warnings[heat-loss]` - `tests/journeys/test_render_navigation.py::test_presses_and_fills_leave_no_element_naming_stale_keys[heat-loss]` - `tests/journeys/test_site.py::test_a_published_decision_survives_reload` The two intermittent site journeys from the issue each passed once with the change: `test_what_a_user_leaves_on_one_page_stays_on_it` and `test_every_published_page_stands_as_a_live_page`. Eleven chart tests in `tests/browser/widgets/test_charts.py` covering legend, redraw, resize and Plot-pointer agreement pass, and so does pre-commit. **What this leaves in #5708.** The macOS-only failures need the next scheduled `test-macos` run. `live-progress` holds a chart and should be covered. `thread-panel-gallery` and `worktree-diffs` hold none, so their errors may have another cause; #5736 fixes one such path in the floating panel. The faceted pick mismatch in `test_a_chart_picks_the_point_plot_s_own_pointer_picks` is a different symptom and isn't addressed here. <details><summary>How the writer was found</summary> An instrumented load of `heat-loss` logged every ResizeObserver delivery with its targets' depths, plus DOM mutations by frame. The error frame delivers the legend watch on `div.plot-*-figure` (depth 8), which replaces the drawing. That frame's mutations then show the chart's `lf-rendered`, body's upgraded, applied and presented stamps, margin-cluster writes and the details shelf, before a deeper floating-panel delivery and the error. Deferring the repaint itself (`requestAnimationFrame`) left the error in place. Deferring only the legend watch's `settled()` removed it, as does this change's single hop at the end of `draw()`, which also covers a chart with no legend whose width delivery finishes the drawing. </details> Refs #5708 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 9, 2026
Open
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A chart now says the value under the reader's aim. Rest the pointer on a point, focus the chart and step with the arrow keys, or hold a finger on it, and the page's preview names that point. It says one line for each row Plot's own tip would draw, label first: "week 6" over "offline sessions 8,412". A ring marks the point, with a dotted rule to the axis it stands at.
How a point is found and said
Plot draws the chart and the chart only reads what Plot drew (
chart-points.js). Each mark that says its values gets a reader built from Plot's owntip,pointerandinitializer. The reader draws nothing and listens to nothing, so Plot hands it exactly what it would hand its own tip: the mark's index, its channels scaled and raw, and itspxandpywith every transform applied.A point stands where Plot's pointer reads a datum: the middle of a band or extent, the mark's
frameAnchor, its facet's offset, and then itsdxanddy.The pointer and a finger pick by a copy of Plot's pointer rule: within 40 px, along the axis the tip names, each mark by its own tip, then the marks compared. Plot's own pointer could pick only if driven through a context Plot doesn't document, and it delivers a faceted pick a frame late. If Plot ever calls a function with each pick, the copy can go. A test compares every pick with Plot's own pointer.
The words are Plot's tip rows. The bundle exports the tip module's
getSourceChannelsandformatChannelsastipSourcesandtipRows, through three seams inbuild/vendor.mjs. Each line names the channel it says. Places come first: facets, then the axis the point stands along, then its series. Measures come after. Atitlechannel replaces the words, and the tip'sformatis honoured.By default every line, area, bar, cell, dot and rect says its values. An author who gives any mark Plot's
tipoption chooses exactly which marks do.A chart with points takes a Tab stop. The arrows step along a series and across to the next, Home and End reach a series' ends, and each step says its place in the series. A redraw keeps the reader on their datum.
Plot draws no tip of its own, so the page's single preview says every point. It follows Leaf's pointer, focus and hold routes, Escape, and placement.
Crossing the drawing where no point is within reach keeps the reading and its ring, and the next point within reach takes its place. Plot's own tip clears in empty space. This one stays because it can be read: the preview lets the pointer through and stands over the drawing, so a pointer moving toward it crosses empty space, and past the chart's edge the preview owner keeps it while the pointer is over the preview's box. Leaving both, Escape or a press puts it away.
A chart's legend refits in the ResizeObserver delivery that measured it. The frame that shows a new legend therefore shows the drawing fitted to it.
Costs
A pointer move on a chart with a 5,000-point series costs 0.4 ms median and 0.6 ms at the 90th percentile in Chromium, and at most 1 ms at the 90th percentile in Firefox (whose clock reads whole milliseconds). A key step costs 0.3 ms at the 90th percentile. Main's chart answers no move.
Narrowing a page of 100 charts to 680 px took 181–202 ms in Chromium and 176–184 ms in Firefox. On main it took 27 s and 6.3–8.0 s, about half of that in one forced layout per chart (
offsetHeight), which the chart no longer reads.Changes to the preview owner, whose one caller is the chart
previewChanged(el, {aim: true}), a chart's next point) keeps the preview's side and the edge it stands by, where that side holds the new reading whole. Otherwise it is placed afresh. A redraw of the same reading keeps its top corner, as before.data-lf-covers). The pointer under it goes on reading the chart, because placement can't see a widget's own points.aimableAt, widget-elements.js), inside the element holding the subject as anywhere else. A field, a titled link, a chart's drawing or a card a press opens around a chart takes the pointer, whether or not it previews; a scrolling or focusable box takes nothing, so words beside a chart inside one keep the reading. Range previews use the same decision:pointRange(null)keeps a range's preview while the pointer is on it over unmarked words, and a field in the passage's own paragraph takes the pointer from it. Being on the preview is the pointer's place, judged at every move, so a pointer sliding into the preview over the element it was already on keeps it, though it crosses no element's boundary. A pointer can then cross from a point to its words past the chart's edge.keepsAccess), so code, a tab panel and a frame stay clear of a preview as on main. A box the subject stands in is skipped only where it takes nothing. A card a press opens around a chart is kept clear of, so the reading stands below its point inside the chart rather than over the card's words; a scrolling or focusable box around the chart is still skipped.position-visibility: anchors-visiblejudges only the anchor element, so a chart's point scrolled out of a box left its reading standing above the box.PREVIEW_ENDEDdoesn't fire meanwhile, so a chart keeps its ring on a focused point scrolled away, and the point's reading comes back with it. Escape with only a suspended reading does its normal work and leaves the reading to come back. This replaces the separate wait main kept for a preview aimed at out of view, which listened only to the platform's IntersectionObserver: that observer sees a control under a sticky header as intersecting, so a reading waiting on it alone never came back. The observer stays as one more trigger, for a layout that moves the element into view without a scroll.detail.declared:PREVIEW_ENDEDcarriesdetail.declared, the objectlfPreviewreturned for the reading that ended, in place ofdetail.route. A widget takes its mark off by that reading's identity, andlfPreviewreturns a new object for each reading.hold.readin one place:show()records a hold's reading for every caller. A finger that reads only after sliding onto a point presses nothing on release.The swap watch
tests/swap_watch.jsis main's watch plus 25 lines. They wrap the page's ResizeObserver, so an observation the watch starts during a page's delivery, or in a microtask that delivery queued, waits for the next frame, as main's watch already does in its own delivery.The chart redraws its legend inside its delivery. Main's watch then started observing Plot's legend row at a depth the browser had already delivered, and
test_a_chart_gives_its_legend_the_room_a_late_font_takesraised a loop error in Chromium.Three rewrites of the sensor on this branch each fixed cases main also gets wrong and broke cases main gets right. The redesign therefore becomes a change of its own. On every reproduction from those reviews, this watch is no worse than main.
Behaviour changes against main
inputevents. Every other event dispatched at it reaches the page.PREVIEW_ENDED's detail carriesdeclaredand no longerroute.Tests
tests/browser/widgets/test_charts.pyadds twenty-four tests, one for each guarantee above. They cover the pointer and keys, holding a finger, the author's picks, agreement with Plot's own pointer, a late font's legend, keeping the preview's side, a longer reading, Escape ending the reading by identity, a hold that reads late, a side too small for the reading, the pointer passing through, a reading kept across empty drawing, a reading kept past the chart's edge, on the page and in an open tab panel, a reading kept over words in a box the chart shares, a card's words beneath a reading reaching the card, a reading keeping clear of the card its chart stands in, a reading going as its point scrolls out of a box, a focused point's reading returning as its box scrolls it back, a reading kept as the pointer slides onto it over one paragraph, a titled link beneath a reading taking the pointer, the next point after a click, a held reading kept through a resize, a tap after a hold, and a second hold.tests/browser/controls/test_previews.pyadds seven tests: a pointer reaching a field or a titled link beneath a preview that lets it through puts the preview away, as main does; a covering preview stays while the pointer is on it over inert words; it stays as the pointer slides onto it over one element; and a covering range preview stays over unmarked words and goes as the pointer reaches a field, beside the passage or in its own paragraph; a focus preview goes under a sticky header and returns with its control; a held reading ends as its control scrolls away and stays gone when the control returns, whether nothing, Escape or a back gesture comes between; and a held reading stays as a redraw gives focus back to a replaced field (holdFocus).tests/runtime/chart-points.test.mjsadds eleven tests for picking, wording, stepping and keeping a datum across redraws, without a browser.tests/browser/test_render_export.pyadds one: an export's preview takes Escape before the modal dialog around it.tests/browser/test_render_swap_watch.pyadds three tests that hold the wrapper to main's behaviour: a row drawn in a frame, a row judged by the arrangement it was painted in, and a scaled row.Trade-offs
aimableAt) and what a press must still reach (keepsAccess). A plain tab stop or a scrolling box is the second and not the first, so a pass-through preview over one stays, while placement still keeps clear of it.detail.routegone, a widget can't tell which route read its preview. Nothing read it.