Skip to content

test(desktop): make prompt-rail tail mounting deterministic #3862

Description

@liugddx

Summary

The prompt-rail eviction Desktop e2e can set the transcript to the bottom without causing the turn virtualizer to observe a scroll event. The test then waits for the exact tail turn (turn-prompt-rail-120), but the mounted window remains stale and the assertion times out.

Evidence

An unrelated Windows-storage PR (#3789) failed on exact head b98f3b329 after all build, release-contract, workspace, Eval, Runtime Host, and Windows recovery checks passed:

  • Desktop e2e failure
  • scenario: evicting a turn-owned sibling interaction hands focus back to the transcript
  • expected [data-virtual-turn-id="turn-prompt-rail-120"]: 1
  • observed for 10 seconds: 0

#3789 has no Desktop/UI diff against main.

Cause boundary

scrollTranscriptTo only assigns scroller.scrollTop. The virtualized window is updated through the scroll observation path, but a programmatic assignment does not provide a deterministic event/paint barrier for the test. The same spec already has notifyTranscriptScrolled and waitForPaintedFrames helpers later in the eviction journey.

Expected closure

  • Make scrollTranscriptTo notify the virtualizer explicitly and wait for the resulting painted frames.
  • Preserve the test's exact tail mount, later eviction, focus-return, and selection-collapse assertions.
  • Run the focused prompt-rail spec and full hosted Desktop e2e suite.

Found while validating #3789; the fix must remain in a separate PR.

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