Skip to content

The file tree's landing test passes on a fast machine, as it does in CI #7045

Done

Description

@max-sixty

tests/journeys/test_render_diff_controls.py::test_file_tree_lands_at_the_file_start_after_reading_down[document] errors at teardown every time it runs alone on an Apple M5 Max: six runs of six across 3b19a33b93, a34788414e and 74008ae535. The scheduled CI runs pass it on the Ubuntu and macOS runners (runs 45159811021 and 45014446027). So an agent that runs the node id locally to prove a change to the file tree or the diff sees a failure CI doesn't show, and has to work out that it isn't theirs.

Reproduction, from a checkout's root:

uv run pytest "tests/journeys/test_render_diff_controls.py::test_file_tree_lands_at_the_file_start_after_reading_down" -n0 -q

It ends 2 passed, 1 error. The test's own steps pass. As the page closes, the suite's shift watch, which fails a test when a key that takes the user nowhere scrolls the page, fails the [document] case:

AssertionError: …/versions/v1.html#patch:["z-mode.sh","file"]: a scroll during the keydown ArrowDown on button … in lf-file-tree#files moved it by (0, 13)px; only a gesture that takes the user somewhere may, as its command's `travels` or the history entry it adds says
shift evidence: {"kind": "gesture", …, "input": "keydown ArrowDown", "before": {"left": 62, "top": 47, …}, "after": {"left": 62, "top": 60, …}, "scrolled": [0, 13]}

The distance differs from run to run, between 7 and 15 px in these six. The key is the test's second ArrowDown, third.press("ArrowDown"), sent once Enter has opened third.md and starts_below_header() has returned: a copy of the test that ends before that press passed twice.

Expected. The test passes wherever it runs, or the product stops moving the page under that key if that is what the watch has caught.

Ran on a34788414e, macOS 26.5, Playwright 1.65.2's Chromium.

Cause. Confirmed: the first failing commit is 74008ae535, #6009 ("Act on every key pressed during a glide where the glide lands"). At its parent 28c1812ddb the test passed twice and at 74008ae535 it failed twice (at those commits the test was tests/browser/test_render_diff_controls.py::…). Hypothesis: the glide that takes the page to third.md's start is still under way when the key arrives, #6009 has the key end it where it lands, and the watch reads the remainder as a scroll the key caused. A fast machine sends the key during the glide, and a CI runner after it. The varying distance fits that. Nobody has checked whether a user would see the page move.

Where it is tracked. No other issue tracks it. #7017 tracks the sixteen journeys failing since #6796, and this test isn't among them.

Where the build met it. The agent proving #6976, which removed the disclosure watch, found it failing on main and listed it in that pull request's description.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    bug
    dev-velocity
    on Nov 24, 2026
  2. leaf-agent commented on Nov 24, 2026

    @leaf-agent
    Collaborator

    #7054 fixes this in the product, not in the test. Your hypothesis about the glide was right, and the watch caught a real jump. The tree's rows are <button role="treeitem">, and scrollsFor matched them by their tag as plain buttons. A plain button leaves arrow keys to the browser to scroll for. So the keyboard controller landed the glide on ArrowDown (landForKey, #6009), though the tree takes the key itself. The rest of the glide jumped under the focused row.

    The fix makes the selectors behind scrollsFor count a native tag only where it has no role. A key a composite widget takes now leaves the glide running. On the Linux runner, a copy of the test that presses ArrowDown mid-glide failed with this error 2 times out of 2 before the fix and passed 3 times out of 3 after it. A new runtime test also fails on main and passes with the fix. The PR's CI and landing are pending.

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

    bugdev-velocity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions