test(webviews): B4 waits for conditions, not fixed times (97 waits)

Merged
TE
16d ago
+411-206

Fourth browser batch of the fixed-wait sweep. It removes 97 fixed waits in 16 test files, and none are kept with a marker. The batch started with 17 files; base's #23489 already rewrote composer-draft-wrap's waits, so this PR takes base's version of that file.

  • Settling: composer-caret-focus, composer-quiet-chips, composer-menu-dismiss, hover-row-sweep, newtab-quiet-focus, popup-reduce-motion, transcript-follow, transcript-spacing and markdown-wide-table-scroll wait for a painted frame, for the animations that the input started to finish, and for the state the test checks (:hover, aria-expanded, the open chips).
  • Absence checks: a later action that goes over the same socket is the signal. A later Delete shows that a saved-unchanged edit sent nothing, in agent-pane-queue. A later Approve shows that Cancel sent nothing, in permission-deny-feedback. The review broke both on purpose and both went red.
  • In-process dev servers: settings-scroll and settings-search-results start vite in-process on port 0 and close it in afterAll, the way agent-pane-attach-typing does, instead of polling a spawned server.
  • Stand-ins: permission-queue's answer wait resolves when the stand-in daemon receives the response. queue-steer's caughtUp() streams a chunk and waits for it to be drawn.
  • Known base failure: one composer-location-strip test, "at 340 px … a folder name cuts in the middle", fails every run on unchanged base too.
  • Review: the independent review returned SHIP. It ran 7 of the files and found two nits that are not fixed here. Four frame waits have no frame cap of their own, so only the test timeout stops them. settings-scroll adds a wheel listener on every open().
  • Process note: one of the batch's helper agents cleaned up its own test run with pkill -f. It matched only that agent's own shell.

Files:

  • webviews/test/agent-pane-permission-deny-feedback.test.ts
  • webviews/test/agent-pane-permission-queue.test.ts
  • webviews/test/agent-pane-queue-steer.test.ts
  • webviews/test/agent-pane-queue.test.ts
  • webviews/test/agent-pane-transcript-spacing.test.ts
  • webviews/test/composer-caret-focus.test.ts
  • webviews/test/composer-location-strip.test.ts
  • webviews/test/composer-menu-dismiss.test.ts
  • webviews/test/composer-quiet-chips.test.ts
  • webviews/test/hover-row-sweep.test.ts
  • webviews/test/markdown-wide-table-scroll.test.ts
  • webviews/test/newtab-quiet-focus.test.ts
  • webviews/test/popup-reduce-motion.test.ts
  • webviews/test/settings-scroll.test.ts
  • webviews/test/settings-search-results.test.ts
  • webviews/test/transcript-follow.test.ts

Checks: the baseline only goes down. Measured against base with the lane's row check, no row is raised or added, and every changed row belongs to a file this PR changes. check:fixed-waits, check:browser-lanes, bun run check and scripts/web-lint.sh pass on the merged head. Each changed file ran 3 times with CMUX_BROWSER_TESTS=1, one browser file at a time.

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

Replaces 97 fixed waits across 16 webviews browser tests with condition-based waits, so tests no longer rely on arbitrary timeouts.

  • Settling waits now use painted frames and wait for the element's animations/transitions to finish, or for the exact state the test asserts (:hover, aria-expanded, open chips).
  • Absence checks use a later action (a Delete, an Approve, a streamed chunk) as the signal that the earlier input was processed, then assert nothing was sent.
  • The settings dev servers (settings-scroll, settings-search-results) now start in-process on port 0 and close in afterAll instead of spawning and polling a server.
  • One composer-location-strip test fails on unchanged base too; four frame waits rely only on the test timeout; settings-scroll adds a wheel listener on every open().