You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tests: file-loading layout polls lazy file viewer content on a cold chunk within the default 1000 ms #3285
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.
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.
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):
The failing-first receipt with a temporary Playwright route holding the viewer or tree module for more than 1 s was not produced.
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.
Activity
schlessera commentedon Nov 10, 2026
2026-11-10, test-health audit
th-20261110201439-289b16(push #3855):packages/ui-react/tests/browser/keyboard-hints.pointer.tsxdoes have this shape. After opening Files it waits withexpect.element(page.getByRole("treeitem", …)).toBeVisible(), and the treeitem is rendered by the lazyFileTreechunk, 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 branchtest-health/e3855-ui-react-03now awaits../../src/components/files/file-tree.jsbefore 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, andfile-loading.layout.tsxis untouched, so this issue stays open.schlessera commentedon Nov 10, 2026
Test-health push #3855, batch
e3855-ui-react-02(runth-20261110200243-f078e2, cluster 11).Verdict: test fault. The product behaves as documented; the case gave the cold lazy
FileViewer/FileTreechunks 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.jsand../../src/components/files/file-tree.jsbefore its first poll, the same shape asdestination-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, notCloses):FilePanelusers was not repeated beyond what tests: ArtifactTheme Layout Phone story can stay on Storybook's preparing loader #3267 recorded.schlessera commentedon Nov 15, 2026
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
test(ui-react): say why keyboard hints' lazy tree wait has no 1000 ms…
schlessera commentedon Nov 16, 2026
Merged in #4055 as
aa8c6e29bthrough 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.