test(webviews): composer grow-and-shrink cases sample their first frame at rest

Merged
TE
15d ago
+24-2

Summary

test/agent-pane-scrollbar-full-height.test.ts is red on feat-cmux-next: both "a composer that grows and shrinks ..." cases fail with Expected: <= 1, Received: 20 (base run 39591951769, react-apps-check (2), at 855674fd; also on #23325 and #23257).

The frame sampler starts on a requestAnimationFrame then a setTimeout, and the test typed before that first sample landed, so frame 0 sometimes read the two-line card (62 px) instead of the rest height (42 px). The cases now wait for the first sample before the first key, and after the last Backspace wait until the card is back at its rest height instead of a fixed 300 ms.

These are #23257's hunks for the two cases, copied verbatim so that PR merges over them cleanly; #23257 keeps its App.tsx glide and new cases.

The test is the fix, so there is no separate failing commit. The red/green evidence is the same command on base and head:
CMUX_BROWSER_TESTS=1 bun test ./test/agent-pane-scrollbar-full-height.test.ts (from webviews/)

  • Base 92c12bc5: 3 of 5 runs failed. Logging the heights showed frame 0 at 62 in the failing runs and 42 in the passing ones; the last frame was 42 every time.
  • Head: 6 of 6 runs passed (5 pass, 0 fail each).

Observed / Not run

  • Observed: the runs above, on huge-blue (Linux, Playwright chromium); scripts/web-lint.sh and prepush-gate.py passed.
  • Not run: macOS WebKit locally (CI covers it).

Changelog

none

Agent session: huge-blue

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes intermittent failures in the composer grow-and-shrink webview test cases. The frame sampler starts on a requestAnimationFrame then a setTimeout, but the test typed before that first sample landed, so frame 0 sometimes recorded the two-line card height (62 px) instead of the rest height (42 px). The cases now wait for the first sample before the first key, and after the last Backspace wait until the card returns to its rest height instead of a fixed 300 ms wait. These changes are taken verbatim from #23257 so that PR merges cleanly.