webviews test: the minimap preview's delay is read from when the card first shows (base flake)

Merged
TE
15d ago
+13-10

CI (head a75ef8f): PASS test/hover-intent-cards.test.tsx. The other reds are base: settings/categories.test.ts and agent-pane-scrollbar-full-height (untouched), and the browser-lanes guard on gallery-agent-pane-entries.test.ts (fixed by #23325). The independent review passed.

The flake: in test/hover-intent-cards.test.tsx, "the minimap's turn preview waits its delay, then follows the pointer at once until the rail cools" failed in 2 of the 16 feat-cmux-next runs that ran the webview shards (2026-10-21), at its first check: await wait(200); expect(visible()).toBe(false) received true.

Cause (test, not the rail): the card's delay is 250 ms (CARD_DELAY, threadMinimap/model.ts). It was up only because a loaded runner woke the 200 ms real-timer wait late. Timers only ever fire late, so the check measured the runner, not the delay.

Fix: the case reads when the card first shows, in 10 ms steps. Each step is its own act, so React draws between them; a single long act defers the DOM update to its end. It asserts that this is at least 200 ms after the pointer came, and that the card shows by 850 ms (the old 200 + 650). A step can only end late, so a slow runner can't fail it.

It still catches the bug (mutation check, local):

CARD_DELAYresult
0 msfails (seen at 17 ms)
110 ms (the old delay)fails (seen at 126 ms)
180 msfails (seen at 190 ms)
250 ms (shipped)passes, 5 of 5 runs

The warm and cool checks between the two delayed shows are unchanged. #23092's owner confirmed this file is mine to fix and that #23092 doesn't touch it.

Agent session: cmux16

🤖 Generated with Claude Code