Skip to content

fix: stop a walk's glide when a click opens the thread on the passage it carries - #6074

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6072
Nov 15, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Clicking a commented passage during a t walk's glide opens that passage's thread but no longer keeps the page on it. The walk's glide keeps going and carries the clicked words out of the window. That breaks test_a_thread_trip_takes_over_an_outgoing_trip_before_its_first_frame[passage] on every run since #6030.

Cause. A click on a mark opens its thread with travel: false (surface.js). The only landing that arrival makes is the thread card's. The card is a fixed box anchored beside its passage, so scrollersOf yields no scroller for it, and scrollIntoView on it moves nothing. Before #6030, arrive called stopScroll, which stopped every Leaf glide, and that is what used to end the walk. #6030 replaced it with stopBrowserScroll so that t pressed mid-glide lands where the glide is headed. After that, nothing on the click route stopped the glide. An instrumented run showed the card's landing reading alreadyShown as false (the glide would carry the card away) and then making no move.

Fix. The click handler now stops the glides in the boxes that carry the clicked words (carriersOf) before opening the thread. The press picked those words where they stood, the same reason z stops a glide. The change is limited to the pointer route. Keys keep #6030's rule that a landing aims from the glide's goal.

Verification.

  • The failing test fails on main (assert 0 <= -2158.921875) and passes with the change (3 of 3). Its [walk] variant still passes.
  • Land a walk pressed while a glide runs where the glide is headed #6030's mid-glide matrix (tests/journeys/navigation/test_reading_place.py::test_a_key_pressed_during_a_glide_acts_where_the_glide_lands, Chromium): 63 passed, 1 xfail (the t-then-Tab engine gap Land a walk pressed while a glide runs where the glide is headed #6030 recorded).
  • pnpm run test:runtime and pnpm run check:browser pass.
  • The click, press, mark and trip tests in test_comment_marks.py and test_threads.py pass, apart from test_color_cues_fade_to_the_live_surface[firefox_browser]. That test also fails on main with a Firefox color-serialization difference, so this change doesn't cause it.

Closes #6072 — automated triage

A click on a commented passage opens its thread without travel, and the
only landing that arrival makes is the thread card's. The card is anchored
beside its passage, so it has no scroller of its own and its landing moves
nothing. Before #6030 every arrival stopped Leaf's glides (`stopScroll`);
#6030 let them run so a walk pressed mid-glide lands where the glide is
headed. Nothing on the click route stopped the glide any longer, so a click
on a passage still in view during a `t` walk opened its card while the walk
carried the passage 2159 px above the window.

The click handler now stops the glides that carry the clicked words before
opening the thread, as `z` stops one: the press picked those words where
they stood. Keys keep #6030's behavior.

test_a_thread_trip_takes_over_an_outgoing_trip_before_its_first_frame[passage]
fails on main and passes after (3 of 3). #6030's mid-glide matrix in
Chromium: 63 passed, 1 xfail (the known `t` then Tab engine gap).

Closes #6072
@leaf-agent
leaf-agent merged commit a29fd54 into main Nov 15, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6072 branch November 15, 2026 20:50
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_thread_trip_takes_over_an_outgoing_trip_before_its_first_frame[passage]: clicking a passage no longer stops the walk away from it, since #6030

1 participant