Repository navigation
Repair the two nightly margin tests that read their own arrangement as a fault - #752
Merged
Merged
Conversation
…s a fault Both cases were red on main, and each failed on how it was arranged rather than on the behaviour it names. `test_the_margin_groups_meanings_at_one_destination_without_moving_the_page` pressed ArrowDown from wherever the preview had left focus. The walk is over the markers the viewport holds and never scrolls to reach one, which is the contract this case is named for, so once #746 moved the third marker of this fixture to 969 in a 900-pixel viewport the press landed on the last marker on screen, clamped, and the case read that clamp as a walk that had failed to move. It now presses Home to start at the first marker the walk offers and steps down from there, reading `.lf-walk-position` — the count the walk itself publishes — rather than recomputing which markers the viewport holds. Deciding that here would be a second copy of `visibleRows`, which also drops rows that are hidden, withheld, or invisible. `test_margin_layout_batches_the_composed_page_without_refolding_controls` bounds the browser work of five margin layout passes that change nothing, but its count started before the page's first pass, which reconciles the contained frames it had just waited for. On the corpus that pass costs 4 layouts and 21 style recalculations, against 2 and 3 for every pass after it, and 3 again for a pass that follows a resize: the reconciliation is page startup, not the price of a changed pass. The budget of 30 was therefore carrying an 18-recalculation constant it never named, and went red at 31 where that constant landed one higher. Spending that pass before the metrics snapshot leaves the five measured passes at 10 layouts and 11 style recalculations across the corpus's 39 clusters, so the same bound now states what the test names. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
leaf-agent
approved these changes
Sep 17, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 17, 2026
…ndex scale (#756) Every colour token in `theme.css` now states its light and dark values in one `light-dark()`, so the 29-line `prefers-color-scheme: dark` block is gone and a token can no longer be changed in one scheme and missed in the other. The root already set `color-scheme: light dark`, which picks the half. The MCP app sets `color-scheme` on its shadow host for the host's declared theme, so `split_theme` and the snapshot's `darkTheme` go. The 24 stacking literals in `theme.css` and `chrome.css` now read 17 named `--lf-z-*` tokens, listed in order in `:root`. The values are unchanged. The `@layer` half of the TODO row was tried and backed out; the row stays open with the finding. With Leaf's sheets layered, a page's unlayered `<style>` outranks all of them, so a page `div { position: relative }` moved 53 chrome boxes including the aim (`test_render_aim`). Giving `chrome.css` its own rung also flipped the specificity contests it was written against `theme.css` with, such as a thread's focus tint. Full suite with `--run-nightly` locally, before merging main: 2691 passed, 4 failed, and all 4 also fail when run on a merge-base worktree: `test_a_stale_package_widget_uses_recursive_parent_eligibility`, `test_the_room_is_measured_after_a_late_rail`, `test_the_margin_groups_meanings_at_one_destination_without_moving_the_page` (repaired on main by #752), and `test_a_current_auxiliary_choice_replaces_a_persisted_tray_during_replay`. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5 <[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.
Both cases were red on main, and each failed on how it was arranged rather than on the behaviour it names. Neither runs on a pull request — they are nightly-marked — so the evidence here is local runs, noted below.
test_the_margin_groups_meanings_at_one_destination_without_moving_the_pagepressed ArrowDown from wherever the preview had left focus. The walk is over the markers the viewport holds and never scrolls to reach one, which is the contract this case is named for, so once #746 moved this fixture's third marker to 969 in a 900-pixel viewport the press landed on the last marker on screen, clamped, and the case read that clamp as a walk that had failed to move. It now presses Home to start at the first marker the walk offers and steps down from there, reading the count the walk itself publishes in.lf-walk-position. My first repair recomputed which markers the viewport holds inside the test; that is a second copy ofvisibleRows, and it drops the hidden, withheld and invisible rows that the runtime's copy also filters, so it could predict a neighbour the walk would skip.test_margin_layout_batches_the_composed_page_without_refolding_controlsbounds the browser work of five margin layout passes that change nothing, but its count started before the page's first pass, which reconciles the contained frames it had just waited for. Measured on the corpus:A changed pass costs what an unchanged one costs, so the 21 is page startup rather than the price of a change. The budget of 30 was carrying an 18-recalculation constant it never named, and went red at 31 where that constant landed one higher. Spending that pass before the metrics snapshot leaves the five measured passes at 10 layouts and 11 style recalculations across the corpus's 39 clusters, so the same bound now states what the test names: work that follows the phases rather than the number of contributed controls.
No product change: the margin layout's steady cost is 2 layouts and about 2.1 style recalculations per pass over 39 clusters.
Verification
2 passed in 16.04s.pre-commit run --files tests/test_render_margin.pyclean.tests/test_render_margin.pymodule on this change:108 passed in 126.08s.