Skip to content

fix: re-place a walk's card after the walk scrolls the box that holds its line - #7601

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-7528-long-document-walk
Nov 29, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-7528-long-document-walk

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A thread walk opens its card before its landing scrolls the card's words into view. commentPlacement's choose reopened the card only for moves Leaf started in the boundary's scroller, which is the page. In a long text document the walk scrolls the document's own <pre>, so the card never reopened. It kept the spot it took while line 840 was clipped (held.top = -35438 from the line), and limitShift stood it at −35,067 px. A second t in the same frame found focus out of sight, and the walk returned to line 840 instead of moving on to 880. #7442's taller card exposed the defect: with the card 20 px shorter, limitShift's lower bound happened to win, so the card landed in view by luck.

choose now counts moves Leaf started in every box that carries the subject, out to the boundary's scroller (startsUnder, built on scrollersOf). When the walk's landing reopens the card, the card drops its held spot and is placed again where the landing left its words. It keeps the side it chose, as the module header already said it should. A scroll from makeRoom still resets the count through scrolled(), so the card's own room-making never reopens it.

Verification, by node id on Linux:

  • tests/journeys/widgets/test_code_and_documents.py::test_a_long_text_document_draws_the_lines_in_view_and_keeps_the_rest_whole[browser] and [firefox_browser] fail on 6e1977ac0 (assert 1 == 2 on steps) and pass on this branch.
  • The placement sweep tests/journeys/margin/test_card_placement.py, the thread-walk and pane-walk browser tests, test_a_thread_walk_card_leaves_and_returns_with_its_anchor, and tests/runtime/{comment,floating,margin,scroll}-placement.test.mjs pass.
  • The browser/types type check and eslint are clean.

This was the last of the eight journeys #7528 tracks. #7535, #7536 and #7537 fixed the other seven.

Closes #7528 — automated triage

… its line

A thread walk opens its card before its landing scrolls the card's words into
view. The card counted only moves Leaf started in the boundary's scroller (the
page), so a walk that scrolled a long document's own `<pre>` never reopened the
card. The card kept the spot it took while its line was clipped, 35,000 px
from where the line now stood, and stood out of sight. A second `t` then found
focus out of view and walked back to the same line.

A card now counts moves Leaf starts in every box that carries its subject, out
to the boundary's scroller. When the walk's landing reopens it, it drops the
held spot, so it is placed again where the landing leaves its words, on the
side it chose.

Behavior protected: `test_a_long_text_document_draws_the_lines_in_view_and_keeps_the_rest_whole`
(both engines), which fails on 6e1977a and passes here. #7442's 20 px taller
card exposed the defect; on the shorter card, limitShift's lower bound happened
to win.

Refs #7528
@leaf-agent
leaf-agent merged commit 1026a74 into main Nov 29, 2026
8 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7528-long-document-walk branch November 29, 2026 07:05
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.

Eight margin and document journeys fail since #7442 headed a margin card with its thread's title

1 participant