Skip to content

ci-fix: returning to an earlier comment draft sometimes leaves its passage offscreen #2523

Closed

Description

@leaf-agent

The main CI run failed test_comment_follows_a_thread_standing_instead_of_an_earlier_draft[This thread already holds a reply.]: after g i refocused the earlier comment draft, its passage #p3 stayed outside the viewport for the assertion's 120-second wait. The test protects a reader's return to the passage they were commenting on.

The same case passed in the three preceding main runs I checked, four focused local runs, and all 18 concurrent copies from leaf-dev flake. The failure is therefore unresolved, not established as an infrastructure incident or fixed by a passing retry. I could not produce a failing ordering to distinguish a test arrangement race from a navigation defect, so I did not weaken the viewport assertion or change the runtime without a reproduction.

The other failures in that run were addressed by #2489 and the merged #2513. The next useful step is to hold the return-navigation edge in the browser test and record where the draft, #p3, and scroll position stand when g i completes, then fix the owner that loses the passage.

Activity

  1. leaf-agent commented on Oct 12, 2026

    @leaf-agent
    CollaboratorAuthor

    The failure remains unresolved. On this checkout (0cc6805b), the focused browser case passed (1 passed in 9.55s); that passing run does not explain the CI failure or justify changing the passage visibility assertion.

    The return route runs from writing.resume in drafts.js through arriveEditor in anchor-travel.js. The composer supplies its resolved anchor as the destination, then the arrival opens and focuses the saved editor. A failing capture at that boundary needs the resolved destination, the editor and #p3 rectangles, and the page scroll position after arrival; those readings would distinguish a missed landing from a later move. I found no reproducible failure to fix in this triage run.

  2. leaf-agent commented on Oct 14, 2026

    @leaf-agent
    CollaboratorAuthor

    The return failure now reproduces on current main: uv run leaf-dev flake 'tests/browser/test_render_drafts.py::test_comment_follows_a_thread_standing_instead_of_an_earlier_draft[]' failed 2 of 18 parallel copies with the same #p3 viewport assertion as run 38502296525. In temporary diagnostic captures after g i, the editor was visible at y=26–58 or y=10–42, while #p3 ended above the viewport at y=-27 or y=-43; page scrollY was 446 or 462. The draft had focus, so this is a placement failure after the return reached its editor.

    I tried completing the editor's preparatory scroll immediately in arriveEditor before its passage-visibility decision. The same 18-copy check still failed in 3 copies, including two where the editor itself ended offscreen. I removed that change. The existing assertion remains the reproduction; the unresolved boundary is the ordering of editor presentation, passage landing, and later placement during Resume writing.

  3. leaf-agent commented on Oct 15, 2026

    @leaf-agent
    CollaboratorAuthor

    The same return failure recurred in the main CI run: after g i, the draft regained focus but #p3 stayed outside the viewport for the 120-second assertion. This time it was the [] variant, the same variant reproduced 2 of 18 times in the prior diagnostic comment. A focused run on current main passed, so this adds another occurrence without changing the unresolved editor-presentation and passage-landing ordering.

  4. leaf-agent commented on Oct 15, 2026

    @leaf-agent
    CollaboratorAuthor

    The failure reproduced again on current main: 2 of 18 baseline copies failed, and a diagnostic run captured the move after g i. A smooth scrollBy toward the thread was still in progress when the return sent an instant scrollBy toward the draft passage. The return briefly put #p3 onscreen; subsequent scroll events moved the page back toward the thread without another Leaf scrollBy call. In one capture, the page moved from scrollY=0 after the return to scrollY=460, leaving #p3 at y=-95..-41 while the editor was at y=12..44. The return also writes a history entry through prepareEntry, whose two instant window.scrollTo calls occur amid the same motion.

    I tried evaluating all arrival scroll conditions before any move (1/18 still failed), assigning scrollTop before the instant landing (1/18 still failed), and starting the draft's preparatory landing smoothly (17/18 failed). I reverted each attempt. The next fix needs to make a new navigation take ownership of a still-running smooth landing, including the history write, without relying on an instant scroll alone to stop that motion. The browser test's viewport assertion remains valid.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions