Skip to content

Deferred diff file rendering moves later headers after a tap #2389

Closed

Description

@leaf-agent

A collapsed lf-diff file opens its native disclosure before deferred file rendering completes. When that rendering arrives later, the file body pushes following headers down after the tap's settled input frame. The browser shift watcher reports this as an unprompted 49px movement. The #2373 CI run caught it in test_phone_diff_headers_keep_distinguishing_parent_folder_readable: the test's assertions passed, then teardown reported a 49px passive shift in later diff headers. This failure is separate from #2373's sample restoration change.

The focused test passes on current main in eight isolated attempts, so ordinary timing does not reproduce it reliably. I reproduced the same 49px shift by delaying lf-diff.prepareEntry by 700ms before tapping the first collapsed header: the focused test passed its assertions and failed the shift watch at teardown. That makes deferred content insertion after disclosure the likely cause, consistent with attachDisclosure calling asynchronous loadEntry, which eventually calls applyEntry to insert the rendered lines. The artificial delay establishes the timing path; it does not establish how often users encounter it without that delay.

Keep the diff-header test's taps and fix the presentation boundary so opening a file gives a stable result when preparation completes. The repair should preserve lazy rendering for large diffs and avoid moving following content after the input has settled. Run the focused browser test with delayed preparation to verify the fix, then the normal browser test and the landing gate. #2368 introduced this test to protect readable repeated basenames on a phone.

Activity

  1. leaf-agent commented on Oct 11, 2026

    @leaf-agent
    CollaboratorAuthor

    I reproduced the 49px passive shift with a controlled delay in file preparation. PR #2390 preserves both the normal passing case and the delayed failing case. It is a reproduction only: opening the native disclosure before prepareEntry finishes lets applyEntry move the later headers after the tap has settled. The remaining work is a presentation rule that keeps those headers stable while retaining lazy rendering; the PR deliberately stays unmerged while its test fails.

    The same test reported the same 49px passive shift in #2385's test run, while that PR's diff left the diff runtime and browser test unchanged. A focused run on its reviewed head reproduced the shift; a focused run on main passed. The author has since pushed a layout-shift fix to #2385, so its new head needs its own review and CI result.

    PR #2379's test run failed this same test with the same 49px passive shift on both the original attempt and its failed-job rerun (attempt 2). That PR changes only agent instructions, so this is another occurrence of the tracked rendering failure.

  2. leaf-agent commented on Oct 11, 2026

    @leaf-agent
    CollaboratorAuthor

    PR #2381's CI run reproduced the same 49 px passive shift in test_phone_diff_headers_keep_distinguishing_parent_folder_readable on both the original test job and its failed-job rerun. In each attempt, the test assertions passed and browser teardown reported later lf-diff headers moving without input. PR #2381 changes the response composer and does not change the diff runtime or this test, so these runs add evidence for the timing path tracked here.

    PR #2388's CI run hit the same test_phone_diff_headers_keep_distinguishing_parent_folder_readable teardown error on both attempts: later lf-diff headers moved 49 px without input. That PR changes gallery cancellation and a gallery browser test, so these attempts add another occurrence of the diff shift tracked here.

    PR #2318's CI run reproduced the same failure on both attempts: test_phone_diff_headers_keep_distinguishing_parent_folder_readable passed its assertions, then browser teardown reported later lf-diff headers moving 49 px without input. The PR changes instruction prose and an event-table contract test, not diff rendering or this browser test.

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