Skip to content

Skip the living margin's render while the page is in print media - #225

Merged
max-sixty merged 1 commit into
mainfrom
fix/ci-33662045196
Sep 2, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/ci-33662045196

Conversation

@leaf-agent

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

Copy link
Copy Markdown
Collaborator

Problem

The nightly leg of ci failed on run 33662045196 with test_render_gate.py::test_example_renders[button-gallery] reporting seven relativeReplays findings — id=lf-margin-options-N applyAction is relative — with no widget at the door, because the ids that moved are the runtime's own Button clusters rather than anything a page authored. Nothing about lf-options.applyAction is relative. What moved was the margin: the gate takes its paper reading and returns to screen immediately before the replay probe, and print takes every injected control out of the page ([data-lf-offer] in the chrome stylesheet's print block) together with .lf-living-margin itself, so the one contributor-visibility reading a margin render is built on comes back empty there and folds every cluster to nothing. That fold is what the probe snapshotted as the page's state; re-applying the standing log dispatched lf-answered, the margin rendered on screen, the clusters came back, and every id it restored read as a widget stepping.

Solution

A margin render asked for while print matches is refused whole and taken once the screen is back. It is the thread list's head-room rule on the layer's other measuring surface, already stated in skills/leaf/CLAUDE.md: a reading taken where the box is display: none is not a measurement. Fixing it in the margin rather than waiting it out in the gate also fixes the reader's version of it — printing a page left every Button cluster folded on screen until the next render happened to repair it.

test_a_print_preview_leaves_the_clusters_as_it_found_them pins both halves: news arriving while the reader stands in the print preview leaves the Buttons where they were, and reaches them when the screen comes back.

How the finding was traced

The probe compares shallowSigs(document.body) either side of re-applying each standing action. Instrumenting it to print both signatures gave one difference per id, on every one of the seven:

lf-margin-options-1|B="DIV [aria-label=More options for rewrite · nine.ten. hidden= id=… role=group] in=#0"
                   |A="DIV [aria-label=More options for rewrite · nine.ten.        id=… role=group] in=#0"

hidden was the whole of it, and a per-action trace named one culprit — <lf-options id=bg-outcome>/choose — unfolding every cluster on the page at once, which is a page-wide render rather than a widget's own state. Reading .lf-margin-options around a print excursion on the same example showed the render that wrote it:

reading groups
on screen 1:shown 2:shown 3:shown 9:shown …
print emulated, a frame later all hidden, all emptied
back on screen, read at once still all hidden
back on screen, one render later 1:shown 2:shown 3:shown 9:shown …

A MutationObserver on the hidden writes reported print=true for each, so the collapsing render ran on paper, and the page repaired itself a frame after the medium returned — one frame later than the gate's probe.

Testing

test_example_renders[button-gallery] failed 3 of 5 runs before the change (and every run after the first two) and passes 5 of 5 after. The new margin case fails on the parent commit with assert [...] == [...] on the cluster shape and passes with the fix.

The everyday suite is 795 passed, 6 skipped. The complete nightly suite was run locally in module batches — gate, margin, export, controls, aim, projection, reactions, widgets, navigation, pages, startup, conversations, anchors, drafts, options, outbox, semantic selection, commands, mcp, site — all green. pre-commit is clean on the three touched files.

The other failure on that run is not fixed here

test_render_drafts.py::test_a_comment_hidden_by_narrowing_is_revealed_in_the_open_panel[False] also failed on that run, and test_render_reactions.py::test_spilled_reactions_keep_their_target_and_yield_to_the_map[click-390] failed the same way on the next one: a press that produces no send, sends=0 acked=0 pending=0 asked=1 heard=1 at both ends of a 30s wait. It reproduces about once in thirty runs here under artificial load, and the one capture shows the response bar withdrawn and focus moved to another textarea between the fill and the Enter, with the field emptied — the placement gate in showFab refusing the bar around an arriving state read. Waiting alone never withdraws it, so the trigger is the read rather than the geometry at rest. That is a separate defect on a documented contract, tracked in #226 rather than guessed at here.


Automated fix for failed run

Print takes every injected control out of the page and the living margin
with it, so the one contributor-visibility reading a margin render is
built on comes back empty on paper: every Button cluster folds to
nothing, and the fold is still standing on screen when the print preview
closes, until the next render repairs it.

A render asked for while `print` matches is refused whole and taken once
the screen is back. It is the thread list's head-room rule on the layer's
other measuring surface: a reading taken where the box is `display: none`
is not a measurement.

The render gate reads a page's replay idempotence directly after its
paper reading, so it saw those folded clusters as the page's state and
`relativeReplays` reported every re-applied action as relative.
@max-sixty
max-sixty merged commit d6a3242 into main Sep 2, 2026
3 checks passed
@max-sixty
max-sixty deleted the fix/ci-33662045196 branch September 2, 2026 22:31
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