Skip to content

Paint the optional packages' widgets at their presented size from first paint - #1485

Merged
max-sixty merged 12 commits into
mainfrom
agent-aa1d908bdd12682dc
Oct 1, 2026
Merged

max-sixty merged 12 commits into
mainfrom
agent-aa1d908bdd12682dc

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

The optional packages' widgets now paint their presented box at first paint wherever that box can be known before the module runs, so upgrading them moves nothing below. Two mechanisms cover the causes, one per cause:

  • An arrangement the markup already determines is laid out by the package theme under html[data-lf-live] before the module runs. The swipe deck reserves each pile's verdict label and its row of controls (one height token, --lf-swipe-press, now sizes both the presses and their reserved room). A ledger row also keeps its Return control's room while the control is hidden, so a classified card's row does not grow when the log makes it returnable. The deck reads "quoted" from the painted data-lf-exhibit instead of a class the module set at upgrade, so a quoted deck is flat from first paint. Given a stated height, the playground's stage stands in its region from first paint.
  • A drawing or data view whose height only the module knows declares x-height: true (Reserve a stated height for a widget that draws into its box (x-height), and draw lf-chart at it #1481) and adds lf-rendered once drawn: lf-diagram, lf-diff, lf-targeting, lf-playground, lf-pull-request, lf-call-diff, and lf-visual-review. The data widgets remove lf-rendered while their data is absent, so the reservation holds until the data arrives. An unrendered live diagram now takes its available width from first paint; only a page without the runtime keeps its source in the column.

page check --render now advises the page's author which height to state: for each x-height widget whose box changed between first paint and presentation, it prints <lf-diagram id='flow'> draws 287px tall where its first paint reserves no height, so what follows it moves when it is drawn: state data-height="287". It is advice and refuses nothing. The shipped examples and site pages state the heights it reported.

Worked examples: the diagram, diff, pr-review, and visual-review examples state data-height, and the playground example gains a preset, so lf-playground-preset and lf-playground-setting have an example.

Removed from tests/known_widget_findings.py: diagram, diff, pr-review (both), swipe (both), visual-review, and the missing-example findings for lf-playground-preset and lf-playground-setting.

Left, with the reason in the file:

  • lf-margin-entry-gallery, lf-targeting, and lf-playground with its preview: their generated interface wraps words, so its height follows the viewer's fonts. The same examples drew 22px to 45px taller on CI's Linux than on macOS, so no stated height holds on every platform, and their examples state none. A page's data-height on targeting or a playground is the author's estimate: on the targeting example, a height taken on macOS leaves Linux a 39px shift where stating none leaves over 500px. The same limit applies to a pull request's or visual run's real data, which wraps words too; their examples carry no data and so measure only the reservation holding.
  • lf-playground-control, -output, and -value: the module builds each control's Web Awesome inputs and writes the controls' current values into the instruction, restoring them per viewer from the tab's storage, so the rail's contents do not exist until it runs.

Tests: test_a_widget_drawn_at_a_height_its_first_paint_did_not_reserve_gets_advice covers the advice (an unreserved occurrence, a mis-reserved one, and a correctly reserved control that goes red if the kernel's reservation is removed). The widget-quality test covers each fixed widget through its example.

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

🤖 Generated with Claude Code

max-sixty and others added 11 commits September 30, 2026 16:16
…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]>
# Conflicts:
#	skills/leaf/references/packages.md
#	skills/leaf/references/page-authoring.md

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The removed keeps-first-box findings still occur in the package examples. uv run pytest -q tests/test_render_gate.py::test_a_widget_drawn_at_a_height_its_first_paint_did_not_reserve_gets_advice tests/test_widget_quality.py passes the new advice test but fails widget quality: lf-margin-entry-gallery grows from 670 to 715 px, lf-targeting from 767 to 806 px, and lf-playground-preview from 598 to 620 px after presentation. Those shifts contradict the first-paint claim and make the three deleted findings premature. The reserved boxes and the playground preview need to match their presented sizes before those entries can be removed.

…n list, with no stated height in their examples
@max-sixty
max-sixty merged commit a7e08ed into main Oct 1, 2026
5 checks passed
@max-sixty
max-sixty deleted the agent-aa1d908bdd12682dc branch October 1, 2026 01:25
max-sixty added a commit that referenced this pull request Oct 1, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants