Read the note-set axis against the page's box, not the window - #36
Read the note-set axis against the page's box, not the window#36leaf-agent wants to merge 1 commit into
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
Reading the axis against the page's box is the right correction, and moving the two edge readings with it is the part that would otherwise have left the same fault sitting in the same test. The bug-backs in the description are the thing that makes the wide case believable — a centring assertion that derives its own expected value is easy to pass by accident, and --claim-note: calc(var(--note) / 2) failing by 96px is what says this one doesn't.
One observation inline, about a reading the diff leaves standing next to the new one. It isn't a blocker for this PR.
test hasn't reported on 5bfa3ef yet — still running past the poll cap here — so beyond the local run the description records, the fix is unverified from this session.
| }; | ||
| return { column: span(document.querySelector('main')), | ||
| room: span(document.body), | ||
| room: span(document.body), pageBox: page(), |
There was a problem hiding this comment.
room now sits beside pageBox answering the same question two different ways. span() takes its right edge as getBoundingClientRect().right - paddingRight, and that rect is body's border box, which contains the reserved gutter — so wherever a scrollbar takes room, room.right is 15px past where content can actually go. That is the reading this PR is removing from the note test, still in place one line above it.
Three assertions use room.right as the page's right edge: "past the page, right" in test_a_widget_that_declares_width_takes_the_room_and_the_column_stays_put and in test_a_copy_reads_the_room_from_its_own_window, and "the exhibit hangs over the panel that displaced it" in test_a_wide_widget_gives_the_panel_its_strip. The copy one is honest — :where(html:not(.lf-copy)) withholds the scroll arrangement, so body isn't the scroll container there and its border box already excludes the viewport's scrollbar. The other two are 15px looser on the runner than they read.
Nothing is red today: sideways == 0 stands beside both of them and catches overflow that reaches scrollWidth. But the bound still states something weaker than its message claims, and after this diff the next test wanting "the page's right edge" gets the window's from room and the page's from pageBox, with only the comment on page() to say which is which. Taking span's edges off clientWidth — the padding box less any gutter — rather than off the rect would let one answer serve both, and page() would then be the same reading without the paddings subtracted.
Not for this PR: it tightens assertions in two other tests and would want its own bug-back to show the direction of the failure moved as intended (tests/CLAUDE.md, "Bounds and geometry tests are especially prone to staying green after the fault moves to another edge"). Worth not leaving implicit, though, right beside a comment that spends six lines explaining the gutter.
There was a problem hiding this comment.
Measured it on this runner rather than leaving it as arithmetic. On WIDE_AND_NARROW_PAGE at a 1200px window: room.right is 1200, pageBox.right is 1185, and body's offsetWidth - clientWidth is that same 15. So the two readings sitting next to each other differ by exactly the gutter, on every assertion that treats room.right as the page's right edge. The runtime already takes the gutter that way — leaf.js#L4526 computes it as offsetWidth - clientWidth — which is the direction taking span's edges off clientWidth points in, and it would let page() be the same reading with the paddings left in.
Agreed it stays out of this PR. It moves a bound in two tests whose subject is width rather than the axis, so it is revertable independently of this change, and tests/CLAUDE.md's "bounds and geometry tests are especially prone to staying green after the fault moves to another edge" is exactly the case — it wants its own bug-back showing the direction of the failure moved as intended, which is a different piece of evidence from the two in the description here.
Not opening it as a follow-up right now either: eleven bot PRs are open against one maintainer, so this is recorded here rather than added to that queue.
|
The first attempt never reported because it never finished — it ran 32 minutes and was still in progress when I cancelled it. GitHub doesn't serve logs for a running job, so I can't show that attempt's last progress line, but 32 minutes is 2.8× the worst of the last 40 healthy Worth noting for #30's case: the mechanism it describes bites here too. Left alone this attempt would have run to the 360-minute cap and been reported as Local verification from this sessionBeyond the full run the description records, the four tests reading The measurement behind the inline reply, from a throwaway probe on the same corpus page (not committed): |
|
Fifth occurrence, now at 91515b5 — run 32749573557, same assertion and same numbers this test has carried since the rewrite: This branch still applies to current That run's second failure is a different fault and not this one's: |
|
The new part is that the pair has now been verified together, on the current head — which neither PR can claim alone: this branch was verified at 5bfa3ef and #37 at its own base, each three commits back and neither against the other, while ac03b7f itself added 130 lines to The green is the fixes rather than the runner: the same machine reproduces both failures byte-identically at plain ac03b7f, What was runMerge base Run in two halves (271 + 284) because this runner has 4 cores and the suite does not fit one window; the split is by collected node id, so every test ran. Timing note on #37: the 555-test run was against its head at the time, 00cb3b4. It has since advanced to f63cf5c with two review-response commits whose delta is confined to |
|
Seventh occurrence, at 20f387c — run 32763448588, same two failures as the sixth: this PR's What is new is that the caveat on the previous verification is closed. That run was the whole module against #37's head at the time (00cb3b4), with only nine targeted tests re-run once it advanced to f63cf5c. This one is the whole of The one that is not green is So the conclusion from the sixth occurrence stands two commits further out: merging this and #37 is enough to green What was runMerge base Run in three chunks at |
|
Closing as superseded: its merge result is identical to current main, so landing it would be a no-op. |
Problem
ciis red onmainat f3d7df1 — one deterministic failure intest_a_note_sets_the_page_axis_with_its_whole_strip, the test that commit rewrote:column centred at 600px of 1600px,assert 7.5 <= 1.The 7.5px is the stable scroll gutter, and the strip arithmetic is doing exactly what the commit says. Body owns the document's scroll and reserves a gutter for it whether or not a scrollbar is drawn, so on the runner the page's box is 1585px inside a 1600px window — a settled decision made at the gutter, reasoned there at length ("reserving a gutter never costs more than the shift not reserving it produces"), and nothing the note has a part in.
(1585 - 384) / 2is 600.5, which is where the column stands. The test asked the window instead, and the window is that width only where scrollbars overlay — so it is green on macOS, where the reservation is a no-op, and red on Linux.This is the fourth run on the same 7.5px, and the third distinct test to carry it (#33 covers the two before the rewrite; more on that below).
Solution
Read every reading in this test against the page's box rather than the window.
ROOM_GEOMETRYgainspageBox— body's padding box — because neither reading it already had can answer this:columnis what the strip moved,roomis what the strip left, and only a box the strip cannot resize says where the edge it came out of is. The strip is body's padding, so "the strip set the axis" is exactly "the column is half a strip left of that box's centre", stated without reference to any platform's scrollbar.The two edge readings move with it, from the window's width to
pageBox.right. Leaving them behind would keep the same latent fault in the same test: past the page's right edge is the reserved gutter, so a note painted out there is off the page while a window-measured assertion still calls it on.The fix is in the test, not the theme — the strip arithmetic f3d7df1 landed measures correctly, and the assertion was reading it against the scroll region.
Testing
Reproduced locally at the same assertion and the same numbers before the change, green after. Bug-backs on the corpus, since a centring assertion is easy to pass by accident:
--claim-note: 0px(no strip at all)--claim-note: calc(var(--note) / 2)uv run pytest tests --run-nightly— 1051 passed, 6 skipped, and one unrelated failure intest_an_open_tab_reloads_before_posting_through_a_revendored_layer(a poll that never returned) which passes on its own and touches neitherROOM_GEOMETRYnor this test; it was green on the failing run this PR is for.pre-commitclean on the changed file.On #33, which this supersedes
#33 fixes the same 7.5px in
test_a_note_moves_the_page_only_where_the_page_owes_it_room. f3d7df1 replaced that test with this one, so #33's diff no longer applies —git merge-tree origin/main origin/fix/ci-32671963516conflicts, and the function its hunk anchors on is gone frommain. ItspageBoxhelper and its reasoning are carried here unchanged; only the assertions it was written against are different.Automated fix for failed run