Repository navigation
Read a root workspace's minimum in the box a bounded allocation would give it - #632
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
The runtime change does what it claims on the path it names, and the selection I ran holds it: tests/test_render_widgets.py (155 passed, including both new cases) and tests/test_site.py::test_published_workspaces_keep_their_allocation_under_site_context --run-nightly (2 passed, the nightly failure among them). One thing to change, in the reference rather than the runtime.
packages.md now tells package authors that "live boxes a minimum measures describe the posture under decision rather than the one currently drawn". Only the root's own outer box is held that way. The posture attribute is untouched across the reading, so every arrangement rule the posture drives is still the current posture's: under --lf-reading-posture: flow a partition's content stays display: block rather than splitting into repeat(2, minmax(0, 1fr)), the root's own grid-template-rows: auto minmax(0, 1fr) auto is not in force, and the margin: 0 the bounded rule puts on .lf-reading-frame is not applied. So the sentence promises a package root that reads its own grid tracks — the case it sits directly beside — that it reads the bounded ones, and it reads the flow ones.
That is not only prose. A root whose wrapping furniture sits in a nested pane of a columns partition still answers one window two ways, because the pane is stacked at the root's full pinned width in flow where a bounded allocation would give it half: at 1200×1000 it settles bounded opened fresh and flow shrunk down from 1100. The divergence is pre-existing — the same probe disagrees at the same window with this commit's runtime reverted to 4aa102e2 — so it is not a blocker on this change, and the nested case may well be worth its own pass. What the reference says about it is this change's to get right.
The probe
A root workspace holding one lf-partition[direction=columns] whose left pane carries the same four fixed 280×200 badges as FIT_BADGES, swept over 400–1100 at 1200 wide by both routes the new test uses:
| Route | 1100 | 1000 | 900 | 800 | 700 | 600 | 500 | 400 |
|---|---|---|---|---|---|---|---|---|
| opened fresh | bounded | bounded | bounded | bounded | bounded | bounded | bounded | flow |
| shrunk from 1100 | bounded | flow | bounded | bounded | bounded | bounded | bounded | flow |
With skills/leaf/assets/runtime/reading-layout.js restored from 4aa102e2, the two routes disagree at 1000 in the same direction, so this commit neither introduces nor closes it.
The reference told package authors that the live boxes a minimum measures describe the posture under decision. Only the root's own outer box is held that way: the posture attribute is untouched across the reading, so a partition's content stays block rather than splitting into two columns, the root's own grid rows are not in force, and the bounded frame margin trim is not applied. A package root that reads its own grid tracks reads the flow ones, which is the case the sentence sits beside.
|
Tonight's nightly hit this again: 34689533353 failed That run is main at No new diagnosis and nothing to change here; recording the recurrence so the failure reads as standing rather than as a one-off. |
One window, two allocations
test_published_workspaces_keep_their_allocation_under_site_context[live-progress]failed in the nightly run (34678426457) readingflowwhere the published example is meant to hold its bounded desk. It reproduces here at the size the test drives, and the cause is not the site note's height on Linux fonts — it is that the same window allocates two different ways depending on which window the reader came from.fitRootReadingElementdecides posture by comparing the available box against the minimum the root reports, and that minimum is a reading of the root's own live layout. In flow the root stands in the reading measure — 720px inside a 1200px window — while bounded would give it the full 1152px. Furniture that wraps is taller in the narrow one, so a root in flow reports a minimum for a layout the bounded posture would never have. Measured on the published Live Progress page at 1200×900:boundedflowFlow is self-confirming: every reading taken from it is the flow reading again, so the reader who lands there cannot resize out of it. The available width in the same function is already computed as the box bounded would allocate —
bodywidth lessmain's padding, not the measure column the root currently occupies — so the height term was the one reading that still described the posture in force rather than the one under decision.The reading is taken in the box under decision
readMinimumAtholds the root at that width while the minimum is read, and restores it in the same task, so nothing paints between. That leaves the whole subtree — a root's own furniture and any nested pane's — laid out at the bounded width for the reading, rather than eachminimumSizeimplementation having to correct for its current posture.It also holds the root's current height across the reading. Furniture that grows shorter at the wider width shortens the document, and Chromium clamps a scrolled reader's position to the page it measured rather than the one it restores: without the height held, a reader scrolled to the end of a flow page is moved 200px back up its page on the next layout signal.
The added work is one forced layout per posture decision, on the pages that carry a root workspace only;
choosePosturealready forced one throughminimumSize's owngetComputedStyleand box reads. The work before presentation is unchanged, read fromscripts/verify-site-local.shon this PR'stestjob against main's://examples/triage-board//examples/feature-gallery/versions/v1.htmlNo request count moves anywhere, and the one kilobyte is document bytes rather than a resource. Elapsed times move in both directions between the two runs and are diagnostic only.
Verification
tests/test_render_widgets.py::test_a_root_posture_is_the_window_it_stands_in_and_not_the_one_it_came_fromwalks a sweep of window heights down from a tall window and opens each of them fresh, and holds the two routes to the same answer. Its fixture wraps by geometry rather than by text — four fixed badges that stand on one row in a bounded allocation and two in the reading measure — so the divergence does not depend on a platform's font metrics, and a positive control fails the test if they ever stop wrapping. Against the runtime reverted it reports{500: 'flow', 600: 'flow'}where the walk down reportsbounded.tests/test_render_widgets.py::test_reading_a_root_minimum_leaves_the_reader_where_they_had_scrolled_toholds the clamp above. With the height pin removed it reads back 2603 where the reader left 2803.uv run pytest tests/test_site.py --run-nightly— 45 passed, including the failing node.uv run pytest tests/test_render_widgets.py --run-nightly— 155 passed.uv run pytest tests/test_render_gate.py --run-nightly— 101 passed.uv run pytest tests— 1028 passed, with the four failures Name the everyday-suite cases an agent sandbox cannot run #628 documents as unrunnable in an agent sandbox (IPv6 wildcard, read-only/tmp×2, umask).uv run pre-commit run --files …— passed.scripts/verify-site-local.shdid not run: the sandbox has no access to the Docker daemon Wrangler needs for the page container. CI'stestjob runs it on this PR.The run's other failure is #631's
test_page_fixture_renders[notification-playground]failed in the same run onthe runtime never injected its banner. That is #629's startup stall, and #631 is open with the diagnosis and fix — request interception coming down inside the module burst. It reproduced here once in one fulltest_render_gate.pyrun (on a different node and viewport,[dark] … at 1200x900) and cleared on the next, which is the rate #631 measures. Nothing in this change touches it.