Repository navigation
Skip the living margin's render while the page is in print media - #225
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The nightly leg of
cifailed on run 33662045196 withtest_render_gate.py::test_example_renders[button-gallery]reporting sevenrelativeReplaysfindings —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 aboutlf-options.applyActionis 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-marginitself, 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 dispatchedlf-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
printmatches 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 inskills/leaf/CLAUDE.md: a reading taken where the box isdisplay: noneis 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_thempins 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:hiddenwas 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-optionsaround a print excursion on the same example showed the render that wrote it:1:shown 2:shown 3:shown 9:shown …hidden, all emptiedhidden1:shown 2:shown 3:shown 9:shown …A
MutationObserveron thehiddenwrites reportedprint=truefor 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 withassert [...] == [...]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-commitis 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, andtest_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=1at 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 theEnter, with the field emptied — the placement gate inshowFabrefusing 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