Skip to content

test: scroll the open contents outline with the wheel, and drop its opaque-background check - #5731

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5705
Nov 9, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5705

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_a_route_taller_than_the_map_returns_to_an_open_outline has failed on main since #5637 drew the contents map as a block in its sidebar track rather than a fixed overlay. Two of its readings still assumed the overlay. This PR updates the test and changes no product code. #5637's intent and the outline's behavior both stay as they are.

  • Scroll position. The "measuring keeps the place the reader scrolled to" subtest scrolled the outline by writing scrollTop = 0 from a script. Leaf doesn't count a script's write as the reader's gesture, so the page's recorded reading place still named the focused last link. On resize, restorePlace (browser/runtime/reading-place.js) scrolled that link back into view inside the nav (1727px). The fixed map used to escape this because stuckBox treated it as a stuck box; the in-track map, standing in an unstuck sticky track, doesn't. The subtest now scrolls with the mouse wheel, as a reader would, and the position holds at 0 across the 900px and 700px resizes. It still guards lf-toc: with #fitLabels's "focused link was visible" condition removed, it fails with the same 1727 == 0.
  • Opaque background. Draw the contents map inside its sidebar track #5637 deliberately removed the open outline's background: var(--paper), since the outline no longer lies over the document. The assertion just before it, that the outline ends 16px left of the column at a 1188px window, still covers that guarantee.

Verification: the test fails on current main (assert 1727 == 0 at line 1205) and passed three of three runs locally with uv run pytest --run-main after the change.

Closes #5705 — automated triage

…er check

#5637 drew the contents map as a block in its sidebar track instead of a
fixed overlay. Two readings in
test_a_route_taller_than_the_map_returns_to_an_open_outline still assumed
the overlay.

The "measuring keeps the place the reader scrolled to" subtest wrote
scrollTop = 0 from a script. A script's write is no reader gesture, so the
page's recorded reading place still names the focused last link, and a
resize's restore brings it back into view (reading-place.js, restorePlace).
The fixed map used to escape that as a stuck box (geometry.js, stuckBox);
the in-track map doesn't. The subtest now scrolls the outline with the
wheel, as a reader does, and its scroll position holds across both
resizes. It still fails when lf-toc reveals a focused link that was out of
view.

The background assertion is removed. #5637 deliberately dropped the open
outline's opaque paper, since the outline no longer lies over the
document. The assertion before it, that the outline ends left of the
column, still holds that guarantee.

Closes #5705
@leaf-agent
leaf-agent merged commit f8d0b55 into main Nov 9, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5705 branch November 9, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_a_route_taller_than_the_map_returns_to_an_open_outline fails on main since #5637 drew the contents map in its sidebar track

1 participant