Skip to content

Hold before-first-frame test interruptions at the trip's history entry, since landings no longer smooth-scroll - #5311

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-5188
Nov 4, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-5188

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#5285 replaced the browser's smooth scroll with Leaf's own glide for every landing, so nothing calls scrollTo({behavior: 'smooth'}) on the page any more. Four tests created their "interrupt before the first frame" moment by wrapping that call, so since #5285 their hook never fires:

  • test_primary_arrival_records_a_return_place_only_when_travelling[False-True-1000-False-True] fails on backRequestedAt is not defined.
  • test_a_thread_trip_takes_over_an_outgoing_trip_before_its_first_frame[walk|passage], test_a_visible_datum_takes_over_pending_thread_motion and test_comment_follows_a_thread_current_location_instead_of_an_earlier_draft[-True] time out waiting for the hook.

Each test now uses one shared helper, before_landing_frame in tests/render_harness.py, which wraps the pushState that adds the trip's return stop. arrive commits that entry and starts the landing in the same synchronous handoff (anchor-travel.js), and the glide writes nothing until its first frame. So the interruption still lands before the page moves, and it no longer depends on which mechanism scrolls the page. Each test protects the same behavior as before.

Verified locally on Linux: all five cases failed on origin/main and pass on this branch. Under leaf-dev flake (18 concurrent copies each) every case passed, and the primary-arrival test also passed every copy at --cpu-throttle 4.

This leaves the failure #5188 reports open. That failure was a missing history entry on macOS, intermittent across all four primary-arrival cases in the nightly runs before #5285, alongside scrollY reading 0 instead of 200. It does not reproduce on Linux even throttled, and the next nightly is the first test-macos run on the glide.

Refs #5188 — automated triage

…t its smooth scroll

#5285 moved every Leaf landing onto its own glide of instant writes, so a
script's `scrollTo({behavior: 'smooth'})` on the page no longer happens.
Four tests held their interruption there, and their hook never fired: the
primary-arrival Back case read an unset `backRequestedAt`, and the
thread-trip, datum and Resume cases waited out their timeout. Each now
holds it at the `pushState` that adds the trip's return stop, which comes
in the task that starts the landing, before its first frame
(`before_landing_frame` in render_harness). The behavior each test
protects is unchanged.

Refs #5188
# Conflicts:
#	tests/browser/navigation/test_threads.py
#	tests/render_harness.py
@leaf-agent
leaf-agent merged commit 9a350aa into main Nov 4, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5188 branch November 4, 2026 08:08
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.

1 participant