Repository navigation
Give the base layer's widgets their upgraded box at first paint - #1484
Conversation
…t), and draw lf-chart at it A widget whose drawing cannot be sized from its markup now states its height up front: the registry's `x-height` gives a default in CSS pixels (or `true` for none), and an occurrence overrides it with `data-height`. Delivery paints it as `data-lf-height` through the declared marks, `markDeclared` paints it in a message, and the kernel theme holds a live page's box to it from the first paint until the module marks the widget `lf-rendered`. `page check` takes `data-height` only as a whole number and only on a widget declaring `x-height`. lf-chart declares 400 and draws Plot at the stated height, drawing once more with the legend's height taken off, so the chart's box no longer grows from its source's height to Plot's at upgrade. Its pre-upgrade source is hidden inside the reserved box. A body that sets `height` in Plot's options now fails soft asking for `data-height`; the shipped examples moved their chart heights onto the element. Behavior moved: lf-chart's `keeps-first-box` finding is gone from `known_widget_findings.py`; the bad-chart test gains a body `height` case. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
On a live page (`html[data-lf-live]`) the default package's theme now lays out what each module will draw, so the upgrade moves nothing below the widget: - lf-gloss keeps its tip out of the line; the module shows it in the card. - lf-options gives the last authored cell the hairline it draws above the reserved Add and Done cells, and reserves them only on a live page. - lf-milestone reserves one row of chips for `when` and `tags`. - lf-tree sets each body line at its rendered row's pitch. - lf-code frames its source as its numbered lines, wrapping where they wrap, and a note wears its own band wherever it stands, so the module docks the note itself rather than a wrapper around it (`.lf-code-note` is gone). - lf-tabs draws its flow's frame, an empty strip row of the stated `--lf-tabstrip-h` (a boxed strip now takes that height too) and its first panel. - lf-shot stands its rail and a frame in the pair's shape. Delivery reads the size of the page media an element names from the bytes and paints the largest width and height as `data-lf-media-width` / `data-lf-media-height` (`mark_declared`, `media_size`), which the theme reads with typed `attr()`. Behavior moved: the keeps-first-box findings for lf-code, lf-gloss, lf-milestone, lf-note, lf-option, lf-shot, lf-tab, lf-tabs and lf-tree leave `known_widget_findings.py`. lf-activity, lf-text-document and lf-toc stay, each with the reason its size is not known at first paint. Tests that read `.lf-code-note` read the docked `lf-note`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # tests/known_widget_findings.py # tests/test_revision_delivery.py
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The lf-tree first box still changes on the bundled feeder-tree fixture. uv run pytest -q tests/test_widget_quality.py -k default -n 0 fails reproducibly: the box is 720×107 at first paint and 720×109 once presented. The new line pitch reservation has not settled the claimed finding, and deleting its known entry leaves the widget gate red.
The early bootstrap sets data-lf-live before the entry module loads. If that load fails, lf-tabs never gets its controls, but the new lf-tab:not(:first-of-type) { display: none; } rule keeps every later panel hidden. I verified the second panel computes to display: none with the shipped theme and no widget module. Preserve readable panels on the startup failure path; data-lf-live alone does not establish that tabs will upgrade.
…tree rows to their line Review and CI on the first-paint change found four defects: - A live page drew only a tab set's first panel before upgrade, so a page whose runtime could not start left the rest unreachable. The tab and gloss reservations now stand only while no startup error is recorded (`data-lf-startup-error`, bootstrap.js). - A tree's change badge, set in the sans at the row's 19px line height, grew rows on Linux's fonts; it now rides the line's top, so a row is the line's height everywhere. - `media_size` raised on a PNG cut short after its signature, which the upload door admits; it now answers None, as it promises. - The options hairline and the milestone chip reservation put a `:has()` where the layer's lint reads it as standing on a root; both stand on the widget again. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The widget quality check (#1474) found every Command Hub widget changing size between first paint and presentation. This fixes the three whose final size the authored page already settles, each by its cause rather than per widget. **Goal layout keyed on markers the upgrade wrote.** `lf-command.js` stamped `data-lf-command-goal` and `data-lf-command-worker`, and the package theme hung a goal's layout on them: a block title, a contained float, and workers shut behind the crew chip. The markers derive from the authored tree, so the theme now selects that tree (`lf-command lf-task`, `lf-task > lf-agent`) and the markers are gone. Hiding a goal's workers is scoped to `html[data-lf-live]`, since a reading without the runtime has no crew chip to open them. A package adding its own goal or worker widget to `$command.widgets` lays it out in its own theme. **Generated parts with no room held for them.** Where the authored tree says a part will be drawn, the theme holds its room at the place the upgrade draws it, until it is drawn: - an agent's live line, now one line of the row's own type tall, which is also the height a `doing` clause sets, so a report fills the line instead of growing the row; - a worktree's shut head; - the chip row of a task outside a command, when it has a non-empty owner, `when` or tags, or subtasks: one row of chips, under the title or at the top of a task with none. Chips that wrap onto a second row are not held, since how many fit on a line is known only once they are drawn; the base layer's lf-milestone (#1484) holds its `.lf-chips` row the same way. Holding a wrapped row would take either a chip row that never wraps or the server drawing the row, and neither is in this change; - a `talk` goal's composer. **The composer's height lived inside one rule.** It is now `--lf-compose-h` in `shadow.css`, stated at the root for a widget holding a composer's room, and on each field, so a field whose context sizes its action (lf-options' Add row) still derives its own. lf-agent, lf-task and lf-worktree leave `tests/known_widget_findings.py`. lf-command and lf-command-readings stay, with the reason beside them: the readings hold a row per stopped goal and live worker and a tile for quiet ones, and the command model reads those from the log and the clock, which first paint has neither of. The command's worked example gains `talk`, so the check now covers the composer's held room (turning the reservation off brings back `goal-feeders` 27→75). Visible change: an agent row is about 5px taller, because its live line is one line of the row's type. `leaf-dev stills` shows no other difference. **Also: main's red tab test.** Since #1472, `test_a_revision_inside_one_tab_keeps_the_tab_set_and_every_other_tab` fails on main: a revision that adds a tab rebuilds the page's tab set, and the outgoing set withdrew `--lf-root-headers` from `html` before its replacement declared it again, a remove-and-restore the write watch refuses. `lf-tabs.js` now withdraws the header once the operation that disconnected the set is over, and only if no strip took its place. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
… reserve a label's room once its control is drawn, and settle main's nightly (#1497) Four nightly failures on main, each fixed at its cause. **A diagram whose renderer never arrives took the room (#1485).** A live page gives an unrendered `lf-diagram` the drawing's `available` width from first paint, and only `html:not([data-lf-interactive])` gave the source the column back. When the renderer failed to load, the page did not start, but the mark stayed, so the source sat at the room's left edge, 1552px wide against a 720px column. The tab and gloss rules each restated the fault as `:not([data-lf-startup-error])`; the diagram's rule, the `x-height` clip and the chart's hidden source did not. Now `prepaint.js` takes `data-lf-interactive` off when a fault is `incomplete` (something the page needs did not arrive), so every rule keyed on the mark gives back its fallback at once, and the tab and gloss rules drop their copy of the fault. An uncaught error in code that did load keeps the mark, since the page may still present. `data-lf-startup-error` still names the reason. Behavior moved: `test_a_drawing_that_has_not_drawn_claims_no_room` held that the source reads in the column through every page's loading interval; since #1485 a live page reserves the room then. It is now `test_a_drawing_that_will_never_draw_claims_no_room`, with the same assertions, about the page whose renderer cannot arrive. **The interaction gallery's Play press moved Loop and Viewport (#1484).** #1484 shows only a tab set's first panel before it upgrades, so the gallery, in the Interactions panel, reserved its toggle's words while undrawn: a 0px floor, which a face-change re-measure never replaced. `reserve` now takes its floor inside `measure`, now where the control has a box and otherwise the first time it has one, so no caller can reserve from an undrawn place. The playground's own `measure` wrapper goes. Since a floor is now often taken inside a resize delivery, the root that face changes are watched on is observed once at module load rather than by each floor, which inside a delivery Chrome reports as "ResizeObserver loop completed with undelivered notifications". **The passage sweep counted chart sources a drawing then replaced.** The feature-gallery sweep unhid every panel and collected its blocks in the same script; a chart in a shut panel draws once it has a box, and on a slow machine its drawing replaced the source mid-sweep, leaving a detached range (reproduced on main at 6x CPU throttling, about one run in three). Whether the charts have drawn before the sweep depends on timing, so no single commit flips it. The test now waits for the page to finish what the reveal started before it sweeps. **The diff test asserted the native disclosure marker (#1472).** #1472 made a file's row a flex row that draws its own triangle. The test now holds that each row shows ▶ when shut and ▼ when open. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…r it (#1903) At 390px a side-list queue (`lf-tabs list="side"`) wrapped its list into rows above the open item. On a 20-item queue the list ran 629px and the first item started 770px down, below the fold. The theme already described the narrow list as "a row over" the item, but only the page's own strip was held to one row; every other strip wrapped. ### What changes - **Every tab strip is one row** (`skills/leaf/packages/default/theme.css`). A strip's names scroll sideways when they outrun it, under the edge presses the page strip already had. On the 20-item queue the list is one 70px row and the item starts 71px below the queue's top. A side list's column at desktop width still runs down. - **The edge presses follow the marks.** They show wherever the layer marks more names that way (`data-lf-more-before`, `data-lf-more-after`), not only on the page strip. They stick at the strip's edge rather than inside its inline padding (`--lf-tabstrip-pad`), and their fade uses the strip's own background. - **The open tab stays in the row** (`lf-tabs.js`). A walk, Home/End, or a press brings it in, including onto the tab already open, so Home is a way back after a swipe. So does any change to the strip's size: a narrower window, a panel opening beside the page, or a side list's column turning into a row. - **A narrow queue's first paint keeps its row.** A row's summary is a line of a stated height (`--lf-tab-summary-h`), and the reserved strip includes it where any row has a summary. - **The reserved margins sit under `:where`**, as the upgraded set's do, so a set at its frame's edge loses its margin at first paint too. ### Behavior that changed for the user - A framed tab set with more names than fit scrolls them sideways rather than wrapping them onto more rows. - A tab set first in `main` no longer jumps 24px up when it upgrades. - A side list's desktop rows are 1–2px shorter: the summary is now a 17px line with no 2px foot. - In a right-to-left page, ArrowLeft walks to the next tab and ArrowRight to the previous one, as the ARIA tabs pattern asks. Review found this while walking an RTL strip. ### Is there a more underlying fix? **Yes**, in two rounds. The first version of this branch fixed only the side list's narrow row. The queue was one case of a wider defect. The first paint keeps one row for every strip (`--lf-tabstrip-h`), every strip except the page's wrapped, and #1484 listed "names that wrap the strip onto a second row" as not reserved. A framed set with 20 tabs at 390px wrapped onto five rows and moved its panel 184px at startup. The fix makes one row a property of every strip and deletes the page strip's private copies of the scrolling and press rules, along with the "names that wrap" exception. The new first-paint case `tab-names-outrunning-a-phone` failed on the first version and passes now. Running it also exposed the 24px first-paint margin above. Review then ran the other routes to a strip that runs past its row, and three rules held only for the page strip, which never changes from a column and has no inline padding. The open tab came into view only when a tab opened. The presses sat 8px inside a padded strip. A row made from a column had no presses at all. The first two are fixed here, and each failed when run: taking out the size watch, the press inset, or the press on the open tab fails `test_a_tab_strip_keeps_its_open_tab_in_its_one_row`. The third is general rather than a tab-strip case. `reach.js` reads which boxes declare a scroll only when it sweeps them, so any box that a narrower window or a container turns into a scroller gets no stop or continuation marks. A plain `div` with `@media (width < 600px) { overflow-x: auto }`, loaded wide and narrowed, shows it. Re-running the sweep from lf-tabs would repeat reach's rule in one caller, and #1902 is changing `reach.js`'s `classify`. So this PR records the defect as a strict xfail (`test_a_box_that_starts_scrolling_at_a_narrower_window_takes_a_stop`) and leaves the fix to `reach.js`. Until then, a queue narrowed from a desktop width shows no edge presses until reload. Swiping and the keyboard walk still reach every tab. ### Evidence - `test_a_side_list_is_a_queue_beside_the_item_it_opens` checks that the phone list is one row that runs past. It fails against the old theme. - `test_a_tab_strip_keeps_its_open_tab_in_its_one_row` is new (above). - `test_a_widget_first_paints_the_box_it_presents` gains a framed set and a queue at 390px. Both failed before this change. - `uv run pytest` over the render, gate, widget-quality, pages, threads, anchors and chrome-contract files, selecting tab, strip, queue, side, first-paint, widget, reach and scroll cases, passes. `npm run test:runtime` passes. - `leaf-dev stills` (new state `alert-queue-touch`): the alert queue at 390px goes from a 14-row block before the first alert to one scrolling row over it. The other changed states are on pages without a tab set and differ by caret or timestamp pixels between runs. ### Not in this PR - "Let a queue group its items" stays in TODO.md. No convention in the registry or references settles its markup form, so it went to Max as a question. - Narrowing the window on `alert-review` switches the queue from the open alert back to the first one, on main as well. Version continuity's resize restore reveals a reading recorded before the switch, because lf-tabs brackets a switch with `preserveReadingRegions` only in page flow. #1897 is changing that continuity code, so this went to the coordinator. - `reach.js` re-reading which boxes scroll after a width change (above). > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
On a live page the default package's widgets now paint the box their module will draw from the first paint, so upgrading them moves nothing below them. This clears nine of the base layer's
keeps-first-boxfindings fromtests/known_widget_findings.py(lf-code, lf-gloss, lf-milestone, lf-note, lf-option, lf-shot, lf-tab, lf-tabs, lf-tree). #1481 already cleared lf-chart.Each rule is scoped to
html[data-lf-live], which the served page's inline bootstrap sets before first paint, so a page read with no runtime keeps its readable pre-upgrade fallback. The two rules that hide authored words until the module shows them (lf-tabs' later panels, lf-gloss's inline tip) also stand down once the bootstrap records a startup failure (data-lf-startup-error), since no module will come to show them.Theme rules, one per widget (
skills/leaf/packages/default/theme.css)whenandtags.lf-noteitself and the.lf-code-notewrapper is gone.--lf-tabstrip-h, as a page strip already does, so the reserved room is one number.Served media size (
revision_delivery.py). An lf-shot has no height until its images decode. Delivery now reads the size of the page media an element's attributes name from the image bytes (media_size: PNG, GIF, WebP, JPEG; a file cut short reads as no size).mark_declaredpaints the largest width and height asdata-lf-media-width/data-lf-media-height. The lf-shot theme turns them into the frame'saspect-ratiowith typedattr().packages.mddocuments the attributes for other packages' media widgets.Still in the known list, each with its reason in a comment
data-lf-margin), made after first paint from the room it measures.Not reserved. Chips or tab names that wrap onto a second row; an excerpt's elided rows; a tab set that opens on another panel because the URL's fragment is inside it or this browser tab left it open. The browser matches
:targetonly once the document has loaded.🤖 Generated with Claude Code