Skip to content

test_a_drag_that_overshoots_the_layer_is_not_a_passage: overshot drag keeps the selection to the page's end since #6254 #6286

Closed

Description

@leaf-agent

tests/browser/test_render_anchors.py::test_a_drag_that_overshoots_the_layer_is_not_a_passage fails deterministically on main. It first failed in push run 44038409739 on 67d944fa0:

AssertionError: the drag out of the document stored 4384 characters as its passage
assert 4384 < (2 * 684)

The drag selects 684 characters (paragraphs 9–16) inside the document, then leaves sideways onto a thread card's .lf-thread-quote and releases. The composer's passage then runs from paragraph 9 to paragraph 59, the page's end, where the test expects the release to restore the 684 characters.

Diagnosis so far. The failure reproduces locally on every run at origin/main (66b3883a4). A git bisect run over this node id between 7a55b0bbe (good) and origin/main names #6254 (01bf742fd, "Give each thread message 24px of room after it, and the panel's reply field the same"). That commit changes only CSS: .lf-msg, .lf-thread-checkpoint and .lf-thread-working take a new --lf-msg-gap: 24px token (previously 16px), and the floating panel's thread view gains --lf-fp-transcript-end padding at the transcript's foot. It does not touch selection code. The likely mechanism is that the new geometry moves where the release point (into.x + 40, middle of the card's quote) lands. The release may now land on an element the overshoot guard doesn't treat as the layer, or on the page beyond the document. The selection then extends to the page's end and is kept as the passage instead of being restored. This is unverified. The next step is to check what elementFromPoint returns at the release point on 01bf742fd^ and on 01bf742fd. That shows whether the test's drag target or the guard's notion of "outside the document" is wrong. If a real user could make this overshoot, the fix belongs in the guard, not in the test.

Cause of a failure tracked in #3985.

Activity

  1. added
    tend-ci-cause
    on Nov 17, 2026
  2. leaf-agent commented on Nov 17, 2026

    @leaf-agent
    CollaboratorAuthor

    #6288 fixes the guard; its CI and landing are now with tend-land. #6254 isn't at fault. The test had been passing without exercising the guard: its first leg already ended on the panel's quote, so covered was itself the 4434-character runaway. #6254's 10px shift ended that leg on .lf-thread-content instead, which exposed the real bug. When the drag is released over the panel's quote, Chrome leaves the selection's far end on the page's last words (p59). leftThePage reads that as still inside the document, so the runaway range is both remembered and kept. The press now tracks whether the hand is over page words, and a release with the hand away restores what it held inside the document.

    The other half is filed as #6287. The root's scroll-padding-bottom, which the panel writes, makes Chromium autoscroll about 120px on each step of this "sideways" drag. With that padding forced to 0, the drag covers 8 characters and the fixed release restores exactly those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tend-ci-cause

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions