Repository navigation
Keep a docked margin row docked while the room it answered about holds - #373
Conversation
The nightly ring census has been red on main since #365: the corpus walk waits for the page to stop moving and it never does. Three CSS transitions on a reaction pill's tooltip label restart every frame, so the label never outlives its own 90ms delay -- it is invisible for the page's whole life -- and `pageSettled` can never go true. The engine is a layout pass that measures the same thing forever. A docked row is floated back into the rail to ask whether it fits now, and docked again when it does not, every pass. That round trip goes through `moveHost`, which relocates a cluster that may hold the reader's focus: the move emits focusout and the restore emits focusin, both of which paint the standing chrome, and that paint runs syncLayout -> dockSeats -> another pass. #365 made the cycle reachable from two directions. `dockSeats` schedules a pass whenever a reaction seat stands anywhere on the page, and the six emoji it moved into the margin mean one always does; and it put the focused control inside the host being moved, which is what turns a placement into focus traffic. A dock is an answer about a width. Hold it while the width it answered about holds, and re-measure when the room changes or when the row restates itself through register/update, whose own size is the other half of that answer. The pass that could not have answered differently no longer moves the reader's focus to prove it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The loop-break itself holds — I reproduced the guard engaging, and a row it keeps docked no longer round-trips through moveHost. One consequence of the new staysDocked member, though, is that those rows are then counted as hanging in the margin for the rest of the pass. Detail inline.
The one-line fix is on the classification line just above the hunk (else if (!hangs || rect.right > room)), so it isn't offerable as a suggestion here. Happy to push it if you'd like.
|
I was dispatched on run 34079766897, the nightly One thing that bears on the claim that The fourteen, and where each starts#354 (
#371 (
The gallery group is the larger question: several of those cases are about controls being reachable at a width, not about a count, so I'd read them before assuming the fixtures merely need renumbering. Separately, on the reactionless fallback in your last section — the case moved, but so did the capability. With the default vocabulary, a selected passage now has no route to Suggest at all: |
…frame (#394) ## Problem `ci` on main failed on [run 34084018735](https://github.com/max-sixty/leaf/actions/runs/34084018735) with 19 nightly failures. Most of them are the interaction gallery's contained frames taking the page's focus, which #383 fixes, and the reaction readings #371 retired, which landed as #385. Two survive on today's main (`e6adf0b2`) and neither is covered by either. `test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus` times out waiting for `pageSettled`, because the corpus never settles once the ring walk stands on a control in a docked margin cluster: `layoutMarginRows` floats that cluster out of static flow to read where it can hang and docks it back, a document tree has one focus, so the move blurs the control and the restore focuses it again — and `keyboard/dispatch.js` answers that pair by painting the standing chrome. That paint's layout asks for the next placement, so the page laid its margin out, rebuilt its whole key line and refolded its banner row on every frame for as long as the reader stood there. This is the second time this cycle has closed on a different edge; #298 cut the `dockSeats` one. #373 cuts the other edge of this same loop, and has the same ring test green: it keeps a docked row docked while the room it answered about holds, so `moveHost` is never reached in the case that loops. The two compose rather than compete — that one removes a caller's reason to move the host, this one stops any placement move from painting the standing chrome, so it also holds for the callers it does not touch (`float`, the inline `target.after`, and both branches of the Page-map render). Either can land alone and fixes the failing run; landing both is deliberate belt-and-braces, and neither is based on the other. `test_a_reload_mid_flight_never_wedges_round_trip` waits the corpus's whole answer-all cascade out inside one 30-second budget, and the corpus gained an ask in #354. The fact under test — that a ledger carried across a navigation does not wedge the new document — has already settled on that document's first trip. ## Solution `runtime.placingChrome` says a chrome placement is in flight, `moveHost` raises it around the move and the focus it hands straight back, and the focus painters skip while it stands. `moveHost` asks for the paint itself in the one case the placement really did move the reader: the control they were standing on did not survive it. The flag lives in `context.js` rather than beside `living-margin.js`'s existing `settlingOptionsFocus` because what has to know is every reader of where the reader stands, not just the options state machine. The gate test now waits for the new document's first trip rather than for its whole cascade, so the reading stops tracking how many asks the corpus happens to carry. It waits on the press's own attempt leaving the outbox's `pending`, which is delivery with retries folded in: `acked` is counted in a `finally` around the fetch, so a post that throws counts one and is retried, and an empty `pending` is only the momentary gap between the cascade's trips. ## Testing - `test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus`: red on `e6adf0b2`, green with this change. It is the gate — I could not reduce the cycle to a small fixture, and dropped a candidate regression test that passed with the change reverted rather than land coverage that says nothing. - `test_a_reload_mid_flight_never_wedges_round_trip`: red under `-n4` on `e6adf0b2`, green with this change. Its new reading still fails on a wedged first trip: with `/api/event` aborted on the reloaded document it gives up on `sends=16 acked=16 pending=1`, the shape `acked > 0` would have gone green on. - `uv run pre-commit run --all-files`. - The full `--run-nightly` run promised when this opened never got posted — that session ended before it finished. CI runs the nightly cases of `tests/test_render_gate.py` on this PR, the module it touches; the rest of the nightly suite the runtime change drives runs after main moves. <details><summary>How the cycle was found</summary> At the failing wait, `moving()` reported three running transitions on one `.lf-margin-button-label`, restarting continuously. A document-wide `MutationObserver` over one second on that page showed the whole chrome rebuilding at frame rate with nothing dispatched: 125 `lf-key` inserts and 125 removals, 52 `.lf-btn.lf-others` moves between `lf-banner-actions` and `lf-banner-menu`, 50 same-value `style` writes on `nav.lf-living-margin`, and 25 moves of one `.lf-margin-item.lf-docked` between `MAIN` and its `SECTION`. A stack captured inside a `focusout` listener named the mover: ``` at /runtime/living-margin.js:2073 | at moveHost (/runtime/living-margin.js:2379) | at moveExternalHost (/runtime/living-margin.js:2073) | at Object.float (/runtime/living-margin.js:1644) ``` with a second identical one from `Object.dock`, 50 focusouts per second between them, and `requestAnimationFrame` stacks from `paintHere` and from `layoutMarginRows`'s dispatch at 25 per second each. </details> --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/34084018735) --------- Co-authored-by: leaf-agent <[email protected]>
…frame (#394) ## Problem `ci` on main failed on [run 34084018735](https://github.com/max-sixty/leaf/actions/runs/34084018735) with 19 nightly failures. Most of them are the interaction gallery's contained frames taking the page's focus, which #383 fixes, and the reaction readings #371 retired, which landed as #385. Two survive on today's main (`e6adf0b2`) and neither is covered by either. `test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus` times out waiting for `pageSettled`, because the corpus never settles once the ring walk stands on a control in a docked margin cluster: `layoutMarginRows` floats that cluster out of static flow to read where it can hang and docks it back, a document tree has one focus, so the move blurs the control and the restore focuses it again — and `keyboard/dispatch.js` answers that pair by painting the standing chrome. That paint's layout asks for the next placement, so the page laid its margin out, rebuilt its whole key line and refolded its banner row on every frame for as long as the reader stood there. This is the second time this cycle has closed on a different edge; #298 cut the `dockSeats` one. #373 cuts the other edge of this same loop, and has the same ring test green: it keeps a docked row docked while the room it answered about holds, so `moveHost` is never reached in the case that loops. The two compose rather than compete — that one removes a caller's reason to move the host, this one stops any placement move from painting the standing chrome, so it also holds for the callers it does not touch (`float`, the inline `target.after`, and both branches of the Page-map render). Either can land alone and fixes the failing run; landing both is deliberate belt-and-braces, and neither is based on the other. `test_a_reload_mid_flight_never_wedges_round_trip` waits the corpus's whole answer-all cascade out inside one 30-second budget, and the corpus gained an ask in #354. The fact under test — that a ledger carried across a navigation does not wedge the new document — has already settled on that document's first trip. ## Solution `runtime.placingChrome` says a chrome placement is in flight, `moveHost` raises it around the move and the focus it hands straight back, and the focus painters skip while it stands. `moveHost` asks for the paint itself in the one case the placement really did move the reader: the control they were standing on did not survive it. The flag lives in `context.js` rather than beside `living-margin.js`'s existing `settlingOptionsFocus` because what has to know is every reader of where the reader stands, not just the options state machine. The gate test now waits for the new document's first trip rather than for its whole cascade, so the reading stops tracking how many asks the corpus happens to carry. It waits on the press's own attempt leaving the outbox's `pending`, which is delivery with retries folded in: `acked` is counted in a `finally` around the fetch, so a post that throws counts one and is retried, and an empty `pending` is only the momentary gap between the cascade's trips. ## Testing - `test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus`: red on `e6adf0b2`, green with this change. It is the gate — I could not reduce the cycle to a small fixture, and dropped a candidate regression test that passed with the change reverted rather than land coverage that says nothing. - `test_a_reload_mid_flight_never_wedges_round_trip`: red under `-n4` on `e6adf0b2`, green with this change. Its new reading still fails on a wedged first trip: with `/api/event` aborted on the reloaded document it gives up on `sends=16 acked=16 pending=1`, the shape `acked > 0` would have gone green on. - `uv run pre-commit run --all-files`. - The full `--run-nightly` run promised when this opened never got posted — that session ended before it finished. CI runs the nightly cases of `tests/test_render_gate.py` on this PR, the module it touches; the rest of the nightly suite the runtime change drives runs after main moves. <details><summary>How the cycle was found</summary> At the failing wait, `moving()` reported three running transitions on one `.lf-margin-button-label`, restarting continuously. A document-wide `MutationObserver` over one second on that page showed the whole chrome rebuilding at frame rate with nothing dispatched: 125 `lf-key` inserts and 125 removals, 52 `.lf-btn.lf-others` moves between `lf-banner-actions` and `lf-banner-menu`, 50 same-value `style` writes on `nav.lf-living-margin`, and 25 moves of one `.lf-margin-item.lf-docked` between `MAIN` and its `SECTION`. A stack captured inside a `focusout` listener named the mover: ``` at /runtime/living-margin.js:2073 | at moveHost (/runtime/living-margin.js:2379) | at moveExternalHost (/runtime/living-margin.js:2073) | at Object.float (/runtime/living-margin.js:1644) ``` with a second identical one from `Object.dock`, 50 focusouts per second between them, and `requestAnimationFrame` stacks from `paintHere` and from `layoutMarginRows`'s dispatch at 25 per second each. </details> --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/34084018735) --------- Co-authored-by: leaf-agent <[email protected]>
A row the posture read keeps docked reached the classification loop with `hangs === true` and its docked rect, which is measured where it stands, in flow. `rect.right > room` is false there, so it fell through to `inMargin`: counted as hanging in the margin while standing in the document. Before the posture read grew its second reason, every `staysDocked` member had `hangs === false` and re-entered the docked branch on its own, which is the invariant the new member broke. Three readers of `inMargin` were wrong for it -- the band packer, which can write a `translateY` onto a static row that the clear loop then never resets because it `continue`s on `staysDocked`; the `[data-lf-wide]` sweep, which yields right-hand room for a row that is not there; and `docked`, which stayed false while a docked row stood, skipping the re-place of the targets that dock moved. Found in review on #373. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
mainhas been red on the nightly ring census since #365. The corpus walk waits for the page to stop moving and it never does: three CSS transitions on a reaction pill's tooltip label restart every frame, so the label never outlives its own 90ms delay — it is invisible for the page's whole life — andpageSettledcan never go true.The loop
A docked margin row is floated back into the rail every pass to ask whether it fits now, and docked again when it does not. That round trip runs through
moveHost, which relocates a cluster that may hold the reader's focus: the move emitsfocusoutand the restore emitsfocusin, both of which reachpaintHere(), and the resulting paint runssyncLayout→dockSeats→ another pass.#365 made the cycle reachable from both ends.
dockSeatsschedules a pass whenever a reaction seat stands anywhere on the page, and the six emoji it moved into the margin mean one always does; and it put the focused control inside the host being moved, which is what turns a placement into focus traffic.anchors.js'sdockSeatscomment records the same shape being cut once before — "a whole margin render every frame with nothing dispatched and nothing moving… ~350ms of main thread a frame". This is that cycle closing again through a consumer that did not exist then.The change
A dock is an answer about a width, so it holds while the width it answered about holds. The pass remembers the room each row docked against and keeps that answer until the room changes or the row restates itself through
registerMarginRow/updateMarginRow, whose own size is the other half of the answer. The measurement that could not have answered differently no longer moves the reader's focus to prove it.The tooltip is user-facing, not only a probe: before this, focusing a reaction pill showed no label at all, and the page never stopped animating.
Verification
test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpuspasses; it failed five times running onmain5d571319(the four merges before Make reactions direct agent feedback controls #365) and fails at06daeef3, isolated-n0, same machineuv run pytest tests/test_render_margin.py tests/test_render_controls.py tests/test_render_navigation.py --run-nightlyon the merged tree: 250 passed, 5 failedmain's own, confirmed against a detached checkout of8fbf925ccarrying none of this branch: bothtest_an_unchanged_heartbeat_restates_no_margin_namecases and bothtest_the_small_screen_map_is_a_complete_accessible_sheetcasestest_unchanged_margin_refresh_cost_is_bounded_by_refresh_countat22 <= 20, was contention from-n 2; isolated it passesuv run pre-commit run --files skills/leaf/assets/runtime/margin-layout.jscleanReview found one fault in the first version of this change and
41f940d0folds it in: a row the posture read keeps docked reached the classification loop withhangs === trueand its docked rect, sorect.right > roomwas false and it fell through toinMargin— counted as hanging in the margin while standing in flow. EverystaysDockedmember used to carryhangs === falseand re-enter the docked branch on its own, which is the invariant the new member broke.The other #365 red, and where it went
test_other_responses_can_turn_the_compact_field_into_a_suggestionwas red onmainfor a second, unrelated reason: one Tab from the compact composer focuses the fab bar's Other responses trigger, which raises the margin surface, and.lf-fab-bar[data-lf-margin-raised] { display: none !important }then hides the bar the reader is standing in.That was #365 moving where Other responses renders, not a fault, and #372 has since settled it: the case is now
test_reactionless_other_responses_can_turn_the_compact_field_into_a_suggestion, which serves a layer with the reaction tokens stripped and asserts Suggest stays in the compact fallback there. Both readings pass on this branch withmainmerged in, somaingoes green on the nightly ring census and on that case together.Why nothing caught it
#340's gate runs the nightly modules a pull request edits. #365 edited twelve test modules, and neither of the two it broke was among them. The full nightly behind that gate has not completed on
mainsince934bfc4c: four of the six runs after it were cancelled by the next merge landing first.🤖 Generated with Claude Code