Skip to content

tests: file-loading layout polls lazy file viewer content on a cold chunk within the default 1000 ms #3285

Closed

Description

@schlessera

Context

Found while fixing #3267. FilePanel loads FileViewer and FileTree as lazy chunks (lazyChunk, packages/ui-react/src/components/files/file-panel.tsx:34-35), so the first test in a page that opens the panel pays a cold Vite transform of the viewer module graph. #3267 showed that this cost, charged to a 1000 ms Testing Library wait, fails a story on a loaded CI shard. packages/ui-react/tests/browser/destination-press.pointer.tsx:461-465 and, after #3267, ArtifactTheme.stories.tsx await the real lazy imports before such waits.

packages/ui-react/tests/browser/file-loading.layout.tsx:50-52 renders FilePanel cold. Its first case then polls for [aria-label="Loading file"] (rendered by the lazy FileViewer) and [aria-label="Loading files"] (rendered by the lazy tree) with expect.poll's default 1000 ms timeout. It is the same latent shape. No failure has been observed yet.

Scope

After the render, await the same file-viewer.js and file-tree.js modules before the first poll, in the same way as destination-press.pointer.tsx. Check the other ui-react browser tests that render FilePanel with a file or tree open for the same shape (remaining-buttons.cases.tsx and keyboard-hints.pointer.tsx were checked during #3267 and only touch the non-lazy panel chrome).

Out of scope

Raising a timeout, adding retries or skips. Changing FilePanel's lazy loading.

Acceptance criteria

  • file-loading.layout.tsx waits for the real lazy viewer and tree imports before its first 1000 ms poll.
  • Failing-first receipt: with the file-viewer.tsx (or tree) module request held for more than 1 s by a temporary Playwright route, the unchanged first case fails on its poll, and with the change it passes. The ui-react-layout project is run in the pinned image.
  • Any other instance found by the scope check is fixed with the same receipt, or recorded here as clean.

Verification

node scripts/visual.mjs --project=ui-react-layout --filter=file-loading.layout in the pinned image, before and after, with the temporary hold.

Contract impact

None.

Activity

  1. added
    type: testCoverage, harness or proof work with no behaviour change.
    area: ui-reactReact chat/files/voice components, stores, WebSocket transport.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 2, 2026
  2. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    2026-11-10, test-health audit th-20261110201439-289b16 (push #3855): packages/ui-react/tests/browser/keyboard-hints.pointer.tsx does have this shape. After opening Files it waits with expect.element(page.getByRole("treeitem", …)).toBeVisible(), and the treeitem is rendered by the lazy FileTree chunk, so a cold transform is charged to the default 1000 ms. The body's note that the file only touches the non-lazy panel chrome is out of date. The batch branch test-health/e3855-ui-react-03 now awaits ../../src/components/files/file-tree.js before that poll; 10 runs after the change passed on a heavily loaded host. That is a deflake receipt, not the held-module failing-first receipt this issue asks for, and file-loading.layout.tsx is untouched, so this issue stays open.

  3. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Test-health push #3855, batch e3855-ui-react-02 (run th-20261110200243-f078e2, cluster 11).

    Verdict: test fault. The product behaves as documented; the case gave the cold lazy FileViewer/FileTree chunks only the default 1000 ms poll.

    Change (packages/ui-react/tests/browser/file-loading.layout.tsx): after the render, the case awaits ../../src/components/files/file-viewer.js and ../../src/components/files/file-tree.js before its first poll, the same shape as destination-press.pointer.tsx. No timeout, retry or skip changed.

    Measured locally (pinned visual runner, bun scripts/test-health.ts measure): baseline 2/2 green on the epic base; after the change 10/10 green. No failure was reproduced before the change, matching "no failure has been observed yet".

    What remains (so the batch PR says Refs, not Closes):

  4. added this to the 0.45.0 milestone on Nov 10, 2026
  5. self-assigned this
    on Nov 15, 2026
  6. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-3657b4d2. Branch: test/3285-lazy-file-panel-receipt.

    collisions: closure-only overlap in ui-react with open PRs, no path collision

  7. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Merged in #4055 as aa8c6e29b through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.

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

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: testCoverage, harness or proof work with no behaviour change.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions