Skip to content

Read a root workspace's minimum in the box a bounded allocation would give it - #632

Merged
max-sixty merged 2 commits into
mainfrom
fix/ci-34678426457
Sep 12, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/ci-34678426457

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator

One window, two allocations

test_published_workspaces_keep_their_allocation_under_site_context[live-progress] failed in the nightly run (34678426457) reading flow where 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.

fitRootReadingElement decides 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:

Arrived from Furniture read Minimum height Available Posture
a 1100-tall window 200.3px at 1152 wide 760.3 793 bounded
loading at 900 245.2px at 720 wide 805.2 793 flow

Flow 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 — body width less main'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

readMinimumAt holds 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 each minimumSize implementation 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; choosePosture already forced one through minimumSize's own getComputedStyle and box reads. The work before presentation is unchanged, read from scripts/verify-site-local.sh on this PR's test job against main's:

Route Base, by presentation This change
/ 12 JS / 217 KiB, 16 code / 406 KiB, 23 total / 868 KiB identical
/examples/triage-board/ 11 JS / 191 KiB, 15 code / 380 KiB, 19 total / 383 KiB 19 total / 384 KiB
/examples/feature-gallery/versions/v1.html 30 JS / 384 KiB, 34 code / 572 KiB, 40 total / 720 KiB identical

No 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_from walks 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 reports bounded.
  • tests/test_render_widgets.py::test_reading_a_root_minimum_leaves_the_reader_where_they_had_scrolled_to holds 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.sh did not run: the sandbox has no access to the Docker daemon Wrangler needs for the page container. CI's test job runs it on this PR.

The run's other failure is #631's

test_page_fixture_renders[notification-playground] failed in the same run on the 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 full test_render_gate.py run (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.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Comment thread skills/leaf/references/packages.md Resolved
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.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Tonight's nightly hit this again: 34689533353 failed test_published_workspaces_keep_their_allocation_under_site_context[live-progress] on data-lf-reading-posture reading flow where the assertion wants bounded — the same node and the same divergence this PR diagnoses, with the locator resolving to <lf-monitor id="lp-monitor" … data-lf-reading-posture="flow" data-lf-workspace-context="root">.

That run is main at 4aa102e, which is this PR's own merge base, so it carries none of the fix. It was the run's only failure: 1 failed, 2527 passed. test_page_fixture_renders[notification-playground], the second failure in 34678426457 that this PR's description attributes to #629, did not recur here — consistent with the intermittent rate #631 measures rather than with a second cause.

No new diagnosis and nothing to change here; recording the recurrence so the failure reads as standing rather than as a one-off.

@max-sixty
max-sixty merged commit 9952a44 into main Sep 12, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix/ci-34678426457 branch September 12, 2026 16:16
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