Skip to content

test(ui-react): record the held-module receipt for the lazy file panel waits - #4055

Merged
schlessera merged 2 commits into
mainfrom
test/3285-lazy-file-panel-receipt
Nov 16, 2026
Merged

schlessera merged 2 commits into
mainfrom
test/3285-lazy-file-panel-receipt

Conversation

@schlessera

@schlessera schlessera commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Closes #3285

What changed

This PR completes #3285's verification and corrects one wrong test comment. The fix itself, awaiting the real file-viewer.js and file-tree.js imports before file-loading.layout.tsx polls, reached main through the test-health epic (cfcb104). This PR adds the held-module failing-first receipt that the issue asks for, and records the scope check. The one code change is to a comment in keyboard-hints.pointer.tsx. It said the lazy treeitem wait had expect.poll's 1000 ms budget, which is false. In Vitest 4.1.11, expect.element without a timeout gets the test's remaining time (Tr in @vitest/browser/dist/index-D8jtZoIM.js), and the receipt below shows the unchanged wait surviving a 5 s hold. The awaited import stays as a stated dependency.

Why this shape

The issue's approach, a temporary Playwright route that holds the lazy module request, was used for both files. It was not committed: the issue asks for a receipt, not a permanent hold, and the precedent route command (codeHighlightFailure) aborts a module rather than delaying it. Removing the keyboard-hints import was considered and not taken. It costs nothing, and it states which module the next wait depends on.

Proof

Temporary harness (reverted before commit): a holdLazyFileChunks(ms = 1500) command in packages/ui-kit/tests/visual/form-browser.ts that page.routes **/components/files/file-viewer.tsx* and **/components/files/file-tree.tsx*, waits ms and then continues the request. It is registered in the ui-react-layout and rail-* commands and called just before createRoot(host). All runs were in the pinned image, via node scripts/visual.mjs, on base eb3c53ac2.

file-loading.layout.tsx, 1500 ms hold, --project=ui-react-layout --filter=file-loading.layout:

  • Unchanged (the two awaited imports removed, so the shape before cfcb104): 1 failed | 3 passed. The first case, light 320, fails at file-loading.layout.tsx:55, the [aria-label="Loading file"] poll: AssertionError: expected null not to be null, caused by Matcher did not succeed in time. (1092 ms). The later cases find the module warm.
  • With the change (main): 4 passed, and the first case takes 2103 ms, so the hold was in effect.

Scope check of the other ui-react browser tests that render FilePanel, FileViewer or the Files destination:

File Result
destination-press.pointer.tsx Already awaits both imports before its expect.poll (#3267).
keyboard-hints.pointer.tsx Clean. The wait is expect.element(treeitem).toBeVisible(), which has no 1000 ms budget. With the import removed and a 5000 ms hold on --project=rail-fine --project=rail-coarse, all 6 tests pass. The 320 case takes 5352 ms, and a timing probe showed the expect.element call alone waiting 5057 ms and succeeding. Only the comment was wrong.
remaining-buttons.cases.tsx Clean. Only the panel chrome (Show tree, Close file, Close Files) and store state are checked, and they are not lazy.
renderer-dispatch.layout.tsx, mermaid-content-renderer.layout.tsx Clean. They import FileViewer statically, so no lazy chunk is involved.
desktop-navigation, phone-navigation, overlay-stacking (pointer), navigation-reach-fixture, maintenance-disclosure, hygiene-review, policy-review (layout) Clean. They assert filePanelOpen, currentPath or request URLs, never lazy viewer or tree content.
bun run check:pr --base origin/main
{"version":1,"kind":"brain-check-pr-receipt","head":"7c2104d37d1cdb60a763de802e54b620cfac8dd8","base":"origin/main","mode":"focused","startedAt":"2026-11-15T21:10:17.680Z","finishedAt":"2026-11-15T21:10:49.852Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":18579.853553},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":185.38082000000577},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":125.57884999999806},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":18.19761699999799},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":13245.150734999996}]}

Collisions (bun scripts/collisions.ts --json --pr 4055, head 7c2104d37): no path or unknown collision. There is closure-only overlap in the ui-react workspace with #3054, #3056, #3059, #3069, #3437, #3581, #3806, #4002, #4018, #4024, #4028, #4034, #4035, #4036, #4037, #4038, #4040, #4042, #4046, #4050, #4052 and #4053.

Checklist

  • Focused local preflight/behavioral receipts and complete selected hosted proof passed; actual head/base/job checkout evidence is in Proof. (Local preflight and the pinned-image receipts. Hosted proof runs at confirmation.)
  • Acceptance criteria from the issue are all met, or the gap is named below.
  • The PR and completed/advanced issues have verified release milestones under docs/process/github.md.
  • A changeset is included, or this changes nothing a consumer can see.
  • No personal data anywhere in the diff — the leakage gate covers the whole tree.
  • The integration contract index or relevant component is updated in this same commit, or nothing in the machine surface moved.
  • Docs under docs/ reflect the change, or nothing documented moved.
  • A fail-closed guard added or changed answers the proportionate-containment checklist in this body, or no guard changed.
  • Provider history stays append-only: the provider-history guard passes, or nothing on a turn's path changed.

Anything left open

Nothing.

🤖 Generated with Claude Code

… budget

The comment claimed the treeitem wait had expect.poll's 1000 ms budget.
expect.element without a timeout gets the test's remaining time in
Vitest 4.1, and a tree module held for 5 s by a Playwright route still
passed without the awaited import. Keep the import as a stated
dependency and correct the reason (#3285).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera schlessera added this to the 0.45.0 milestone Nov 15, 2026
@schlessera schlessera added type: test Coverage, harness or proof work with no behaviour change. area: ui-react React chat/files/voice components, stores, WebSocket transport. labels Nov 15, 2026
@uploads-sh

uploads-sh Bot commented Nov 15, 2026

Copy link
Copy Markdown

No uploads on this PR yet

This PR changes UI files (packages/ui-react/tests/browser/keyboard-hints.pointer.tsx). Screenshots help reviewers see what changed.

  • From the CLI: uploads put before.png after.png --pr 4055
  • From an agent: ask it to attach screenshots with uploads.sh
  • By hand: drag images into the PR description and they're imported automatically
Tips for agents

Label each shot so reviewers know what they're seeing. Labels apply to every file in a call, so run one put per shot:

uploads put after.png --pr 4055 --meta path=/settings --state after --caption "Saved settings toast"
uploads put chat.png --pr 4055 --app ios --screen "Chat" --state after

No CLI? With the Uploads MCP, call sign_upload_url for files on disk (or put) with repo, pr: 4055 and the same screen, state and caption fields.

This comment updates with each upload, so you don't need to post the images yourself. A shot or two in the PR description is still welcome. Check what's attached with uploads list --pr 4055. More in the github-screenshots skill or the agent docs.

Workspace admins can turn this comment off in Settings → GitHub · docs

@schlessera
schlessera marked this pull request as ready for review November 16, 2026 07:43
@schlessera
schlessera merged commit aa8c6e2 into main Nov 16, 2026
50 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-react React chat/files/voice components, stores, WebSocket transport. type: test Coverage, harness or proof work with no behaviour change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant