Repository navigation
Drop the swipe control fixture and pressed-reaction ink main already landed - #297
Merged
Merged
Conversation
…landed #291's base merge stacked its swipe work on top of equivalent content main had landed independently, in two files git merged without a conflict. `CONTROL_STABILITY_PAGE` gained a second `stable-swipe-decision` deck beside main's, so the page declares seven ids twice and every parametrization of `test_each_control_archetype_holds_its_neighbours_still` fails before the browser opens. Main's `swipe-verdict` archetype covers `.lf-swipe-controls > button`, a superset of the `:is(.lf-swipe-pass, .lf-swipe-keep)` the second entry declares, so both halves of the addition go. `.lf-margin-button.lf-react[aria-pressed="true"]`'s `color: var(--ink-2)` repaints a pressed margin reaction away from its resting ink. Main fixed the same problem one level down by excluding `.lf-margin-button` from the `.lf-react-palette` repaint rules in `theme.css` and the chrome's `@scope` block, so the override is redundant and breaks `test_selected_reactions_keep_neutral_button_furniture` in both schemes.
max-sixty
pushed a commit
that referenced
this pull request
Sep 5, 2026
…action (#298) ## Problem Main's nightly run [33950527888](https://github.com/max-sixty/leaf/actions/runs/33950527888) failed 13 tests. Ten are already repaired on main by #286, #291 and #297; the three that remain are all on the feature gallery, and they share one cause: that page never stops rendering its margin, so its main thread runs back-to-back ~350ms tasks forever and every Playwright read of it waits on one. The cycle is a layout hook that restates content. `syncLayout` ends in the anchor runtime's `dockSeats`, which called `record.margin.update()` on every reaction seat; `update()` restates the offer, so it ran a full margin render; a margin render ends in `paintKeys`, which ends in `paintHere`, whose animation frame ends in `syncLayout`. Any page carrying a standing reaction closed that loop and ran a whole margin render every frame with nothing dispatched and nothing on the page moving. #289 measured the same thing from the other side and named it as a finding it did not fix. ## Solution `dockSeats` asks the margin to repack its rows — `scheduleMarginLayout()` — rather than to restate what the seats offer. That is what the hook is for: the chrome moved, so the rows a seat hangs in have to be packed again. The end state is the same pass the render was scheduling anyway, minus the render. `test_a_settled_page_with_a_standing_reaction_stops_rendering_its_margin` counts `lf-margin-layout` over 30 frames on a settled gallery and asserts at most one, which is the two-second heartbeat's share. It asserts the reaction seat first, because a page with no seat visits nothing in `dockSeats` and would pass saying nothing. <details><summary>How the cause was found, and the numbers</summary> `told()` failed with `waiting for X, the page last applied X` — the two readings equal. They were equal: the page had taken in what the server held, but `page.wait_for_function` could not complete inside its 500ms round, because on that page a trivially true `wait_for_function` took ~700ms and a bare `page.evaluate("() => true")` took ~370ms. A `longtask` observer on the same page reported ten consecutive tasks of 325–394ms over three seconds, with nothing dispatched. A CDP sampling profile named the loop: ``` (anon)@living-margin.js:836 <- [email protected]:818 <- [email protected]:2164 <- [email protected]:26 <- [email protected]:128 <- [email protected]:375 <- [email protected]:1190 <- [email protected]:233 <- leaf.js:533 (the paintHere frame) ``` and a stack capture on `paintHere` closed it: 42 of 48 calls over two seconds arrived from `paintKeys` reached from that same margin render, i.e. one per frame. Bug-back on the new test with the one-line fix reverted: 30 margin layouts over 30 frames, against `<= 1`. The suite is also faster where it touched the gallery — the seven tests #291 covers ran in 329s on main and 243s with this change. </details> ## Testing - The three failures this fixes, on this branch: `test_the_feature_gallery_exercises_core_reader_workflows`, `test_the_feature_gallery_exercises_live_and_snapshotted_external_data`, `test_r_immediately_opens_the_gallery_reactions_and_digit_chooses` — passed. The first was reproducing on main before the change (121s, failing) and now passes in 18s. - `uv run pytest tests` — 864 passed, 6 skipped. - `--run-nightly` on `test_render_margin.py`, `test_render_anchors.py`, `test_render_navigation.py`, `test_render_reactions.py` — 279 passed; `test_render_aim.py`, `test_render_semantic_selection.py` — 74 passed; `test_render_controls.py`, `test_render_conversations.py`, `test_render_pages.py` — 196 passed. - The new test, three consecutive runs — passed. - `pre-commit run --all-files` — passed. --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/33950527888) Co-authored-by: leaf-agent <[email protected]>
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
#291's last commit was a base merge, and it stacked the PR's swipe work on top of equivalent content main had landed independently. Two files merged textually without a conflict, so both copies survived and landed on
mainas7ffb4d4. Eleven nightly tests are red there now, deterministically.CONTROL_STABILITY_PAGEgained a secondstable-swipe-decisiondeck beside main's. The page declares seven ids twice, so every parametrization oftest_each_control_archetype_holds_its_neighbours_stillfails before the browser opens:.lf-margin-button.lf-react[aria-pressed="true"]gainedcolor: var(--ink-2). Main had already fixed that problem one level down, by excluding.lf-margin-buttonfrom the.lf-react-palette > .lf-react:not(…)repaint rules in bothskills/leaf/assets/theme.cssand the chrome's@scopeblock, so a margin reaction keeps its own furniture without an override. Layered on top, the override is what now moves the ink between resting and pressed — the thing the test forbids. Dark readsrgb(201, 195, 182)pressed againstrgb(232, 228, 219)resting; light readsrgb(60, 57, 52)againstrgb(28, 27, 24).Solution
Drop both, since main carries the working form of each. The archetype entry goes with the fixture rather than being re-seated: main's
swipe-verdictcovers.lf-swipe-controls > button, a superset of the:is(.lf-swipe-pass, .lf-swipe-keep)the second entry declares, so the coverage half needs nothing. Both files return to theirf37fc167content, which is the only thing #291 changed in either.Verification
uv run pytest tests— 864 passed, 6 skippeduv run pytest tests/test_render_controls.py tests/test_render_reactions.py --run-nightly -n0 -k "each_control_archetype_holds_its_neighbours_still or selected_reactions_keep_neutral_button_furniture"— 10 passed (the 11 that are red onmain)uv run pytest tests/test_render_controls.py --run-nightly -n0 -k composed_corpus_declares_every_control_row_archetype— 1 passed, so dropping the archetype entry leaves the corpus fully declaredThe two repairs #291 was actually about survive the merge and are untouched here:
composing/targets.js'sline.right + gapseat and thethemedclass-surface pin both pass at7ffb4d4.