Let the edge trim reach the live tab block's bottom margin - #113
Let the edge trim reach the live tab block's bottom margin#113leaf-agent wants to merge 1 commit into
Conversation
ce73388 gave a rendered lf-tabs its own frame and stated the surrounding margin under the live-page guard, at a weight the :nth-last-child edge trim in theme.css cannot beat. A page whose column ends in a tabs block therefore painted 32px of trapped room inside main's 96px inset, which is exactly the defect TRAPPED_MARGINS reports. The guard is :where() now, so every rule in the block weighs what its own selector says and the trim reaches the margin.
|
Still failing on
The run's third failure is the find-box ring under the margin preview's close button, which is #114. |
|
The third failure this body flags as "its own defect" now has a PR: #114, which takes Base for that run was Same conclusions, reached separately
One difference worth naming, though it is not a defect in #114: |
## Problem `tests/test_render_controls.py::test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus` is red on `main` — [33271145855](https://github.com/max-sixty/leaf/actions/runs/33271145855) and again at `fcf32c2` in [33272278362](https://github.com/max-sixty/leaf/actions/runs/33272278362) — with one fault over 402 stops: `in design mode of gallery, the ring on input.lf-find-box "" is not all there: its top edge is under button.lf-btn.lf-margin-preview-close "×"`. `placePreview` (living-margin.js) measured its room against `innerWidth`. An open panel does not stand over the page — it takes its strip out of the body (`body[data-lf-panel] { margin-right: var(--lf-panel-w) }`, chrome-style.js) — so a card placed against the window reaches across the page's right edge and into the panel. The first thing it covers there is the narrowing box at the top of the thread list, and a preview the reader left open is clamped to `minTop` once its marker scrolls away, which is exactly the band that box sits in. Probing the walk on `gallery` with the panel open: the preview stands at `629,50 → 949,248` while the page's room ends at `x=780` and the panel runs `780 → 1200`, so its `×` sits over the find box's ring at `792,101 → 1056,132`. `ce73388`'s tab frame is what exposed it — it moved the marker that walk opens — but the placement is wrong on its own, and the ring walk is what reads it: a control whose ring the reader can only see half of. ## Solution Take the room from the page's own box (`document.body.getBoundingClientRect().right`) rather than from the window, for both the right-of-marker test and the final clamp. This is the side's version of the line two above it, which already bounds the card by the banner rather than by the top of the window. Where the panel covers the page instead of standing beside it, the preview is already closed and refused (`changePosture`, keyed on the same covering query), so the body's edge is the whole of the answer. The new test opens the panel, hovers the marker, and asserts the card stays clear of the panel's left edge and of the page's room; it fails on `main` (`the preview stands in the panel: {'x': 773, 'width': 320} against {'x': 780}`). ## Testing - `uv run pytest tests/test_render_controls.py::test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus tests/test_render_margin.py --run-nightly -n0` — 14 passed. The ring test fails on this branch's base without the change (reproduced here first, and it passes at `ce73388^`, which is how the exposing commit was identified). - `uv run pytest tests/test_render_aim.py --run-nightly` — 27 passed (design-mode chrome). - `uv run pytest tests` — 715 passed, 6 skipped. - `pre-commit run --files plugins/leaf/skills/leaf/assets/runtime/living-margin.js tests/test_render_margin.py` — clean. The run's other failures are not in this PR: the two `test_example_renders` trapped-margin readings are #113, and the text-entry key and search-geometry reads were fixed on `main` by `3d04843` and `fcf32c2`. --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/33271145855) Co-authored-by: leaf-agent <318509791+leaf-agent@users.noreply.github.com>
Problem
cionmainis red at fcf32c2:tests/test_render_gate.py::test_example_rendersfails on bothgalleryandparallel-workstreamswith<main> draws 96px of inset and shows 128px below what it holds … its last block is a <lf-tabs> reserving 32px against a neighbour it hasn't got.ce73388gave a renderedlf-tabsits own frame and stated the block margin around it in the same rule — inside@media screen { html:not(.lf-copy) { … } }. That guard carries weight: the nested selector ishtml:not(.lf-copy) lf-tabs.lf-rendered, and the edge trim intheme.cssis:nth-last-child(1 of :not(.lf-ui, [data-lf-gen])), which the guard outranks.maindeclares--lf-frame: 1, so on a page whose column ends in a tabs block the trim fired and lost, and the 32px it should have cancelled was painted as page inset — the exact readingTRAPPED_MARGINSexists to report.Solution
Make the guard weigh nothing:
:where(html:not(.lf-copy)). Every rule in the block then says what it weighs on its own, the tabs margin drops tolf-tabs.lf-rendered(0,1,1), and the trim reaches it.:where(html:not(.lf-copy))is already the file's idiom for a medium guard that shouldn't add weight — seven other blocks inpackages/default/theme.cssuse it, and the one nested rule that needs weight against a:not()chain (lf-options[choose]at line 468) states it separately. The fix is at the level of the rule the regression is in rather than at the trim, because a trim that had to outrank whatever a widget declares would be an!importantin a stylesheet a project overlays.What the other rules in the block do at their own weight
Checked each against what it has to beat, since the guard's weight came off all of them:
lf-tabs.lf-renderedlf-tabs(0,0,1); now loses to the trim (0,2,0), which is the fix.lf-tabstrip.lf-tabstrip { display: none }20 lines above and wins on source order> lf-tab::beforelf-tab::before(0,0,2)> lf-tablf-tabs.lf-rendered > lf-tab { margin-top: 14px }and wins on source order> lf-tab:not([hidden]),[hidden],[hidden]:not(…)tests/test_render_navigation.py::test_an_inline_tab_keeps_its_panel_inside_one_visible_boundary—ce73388's own test for the frame, its grounds and its insets — passes, so the surfacece73388built is intact.Testing
uv run pytest "tests/test_render_gate.py::test_example_renders[parallel-workstreams]" "tests/test_render_gate.py::test_example_renders[gallery]" --run-nightly -n0— 2 passed; both fail onmainwithout this change (reproduced here first).uv run pytest tests/test_render_navigation.py tests/test_render_gate.py --run-nightly— 120 passed.uv run pytest tests/test_interact_layer.py— 125 passed, 6 skipped.pre-commit run --files plugins/leaf/skills/leaf/packages/default/theme.css— clean.The run's two other failures are separate and not in this PR: the search-match
bounding_box()read is #111, andtest_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpusreports the page-map preview's close button sitting over the find box's ring in design mode, which is its own defect.Automated fix for failed run