Repository navigation
fix(ci): board widget e2e clicks are silently swallowed before the frame accepts input - #139635
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 1:04 AM ET / 05:04 UTC. ClawSweeper reviewWhat this changesThe Control UI browser-test harness retries pointer entry into dashboard widgets before clicking once, preserving the existing interaction assertions. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main retains the single-hover approach that the supplied Linux comparison still found unreliable. No actionable patch defect was found, and the earlier review recorded no code findings. Priority: P2 Review scores
Verification
How this fits togetherControl UI browser tests load real sandboxed widgets with synthetic Gateway responses. The shared interaction helper synchronizes Chromium input before tests verify widget events and visible results. flowchart TD
A[Browser test scenario] --> B[Control UI and sandboxed widget]
B --> C[Move pointer out and into control]
C --> D{Widget observes hover?}
D -->|No, within deadline| C
D -->|Deadline reached| E[Fail test]
D -->|Yes| F[Click once]
F --> G[Verify widget result and Gateway event]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +27. Total +27 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep browser readiness synchronization in the shared test helper while preserving native input, production sandbox behavior, and single-event assertions. Do we have a high-confidence way to reproduce the issue? Yes: the supplied Linux Chromium comparison describes the failing single-hover path still present on fetched main. This review verified the source boundary but did not rerun the browser scenario. Is this the best way to solve the issue? Yes: waiting for observed pointer entry in the test harness directly addresses the documented browser race while retaining one native click and the existing outcome checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 883d4d65bad1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
eaf6f78 to
8fdda74
Compare
`board-a2ui.e2e.test.ts` flaked in `checks-ui-e2e` with `expected +0 to be 1` polling for the `board.event` request after clicking the widget's button. Since #139076 a board widget's outer iframe stays `inert` and transparent until the sandbox reports the document rendered, and the test polled only for the renderer's custom element, which is defined before that reveal. On the CI Chromium (Linux system browser), the parent document hit-tests the inert iframe element as the target, so Playwright's actionability checks pass while the real click is dispatched to the iframe element and never enters the widget; Playwright reports a click that reached no frame as delivered. Even after the reveal, Linux keeps routing pointer events to the outer element until the compositor catches up. macOS Chromium skips inert nodes in `elementsFromPoint`, so the race never reproduced locally. Add `clickBoardWidgetControl` to the Control UI e2e harness: hover, verify the widget document reports `:hover`, retry with a leave/re-enter move until it does, then click, failing loudly at the wait deadline. Use it for the A2UI click and the sibling board widget click in the chat widget sandbox test. Blacksmith Testbox (Linux, Chromium 151, 40 repeats per variant): 9/80 silent-click failures before, 0/80 after; a minimal cross-origin frame script lost 300/300 immediate post-reveal clicks and 0/300 hover-verified.
8fdda74 to
7ce5ddc
Compare
|
Merged via squash.
|
…enclaw#139635) `board-a2ui.e2e.test.ts` flaked in `checks-ui-e2e` with `expected +0 to be 1` polling for the `board.event` request after clicking the widget's button. Since openclaw#139076 a board widget's outer iframe stays `inert` and transparent until the sandbox reports the document rendered, and the test polled only for the renderer's custom element, which is defined before that reveal. On the CI Chromium (Linux system browser), the parent document hit-tests the inert iframe element as the target, so Playwright's actionability checks pass while the real click is dispatched to the iframe element and never enters the widget; Playwright reports a click that reached no frame as delivered. Even after the reveal, Linux keeps routing pointer events to the outer element until the compositor catches up. macOS Chromium skips inert nodes in `elementsFromPoint`, so the race never reproduced locally. Add `clickBoardWidgetControl` to the Control UI e2e harness: hover, verify the widget document reports `:hover`, retry with a leave/re-enter move until it does, then click, failing loudly at the wait deadline. Use it for the A2UI click and the sibling board widget click in the chat widget sandbox test. Blacksmith Testbox (Linux, Chromium 151, 40 repeats per variant): 9/80 silent-click failures before, 0/80 after; a minimal cross-origin frame script lost 300/300 immediate post-reveal clicks and 0/300 hover-verified.
What Problem This Solves
Resolves a flake where the Control UI dashboard A2UI e2e test failed in
checks-ui-e2eon unrelated PRs and passed on rerun. Seen 2026-09-05 on #139371, #139355 (run 33993524339), and #139384 (run 33996683994):expected +0 to be 1polling for theboard.eventrequest after clicking the widget's "Refresh data" button, with the failing variant alternating between dark and light. Each failing test was as fast as its passing sibling (~0.6–1.1 s before the poll), so it is an ordering race, not a slow-runner timeout.Why This Change Was Made
Since #139076 (landed the same morning) a board widget's outer iframe stays
inertwithopacity: 0behind a skeleton until the sandbox proxy reportssandbox-resource-loaded, and the frame is revealed two animation frames later. The test polled only for the renderer's custom element inside the widget document, which is defined by the bundle script before the inner document'sloadevent fires, so the click routinely runs while the outer frame is still inert.On the CI Chromium (the runner image's
/usr/bin/chromium-browser, Chromium 151, selected because the Playwright browser cache restores only ~2 MB) the parent document hit-tests the inert iframe element as the target:elementsFromPointreturns the iframe, so Playwright's actionability checks pass, and the realpointerdown/mousedown/clickare dispatched to the iframe element in the top document and never enter the widget. Playwright's hit-target interceptor reports "done" when no event reaches the target frame, so the click is a silent no-op and noboard.eventis ever sent. Even afterinert/opacity are cleared, Linux keeps routing pointer events to the outer element until the compositor catches up. macOS Chromium skips inert nodes inelementsFromPoint, so Playwright waits there instead, which is why this never reproduces locally.#139506 (landed while this was in flight) already waits for the outer frame's reveal and performs one hover with a
:hoverpoll before the click. That converts the silent no-op into a loud failure, but a single hover cannot recover: when the first pointer move is routed to the outer iframe element, nothing re-dispatches it, so the widget document never reports:hoverand the poll times out (its own evidence notes a hover-only candidate still failed pointer entry).This PR moves that wait into the shared harness as
clickBoardWidgetControl(page, control): hover, verify the widget document reports:hover, and retry with a leave/re-enter pointer move (which forces fresh hit testing) until it does, bounded bycontrolUiE2eWaitTimeoutMs, then click. It keeps #139506's reveal assertions in the A2UI test and applies the helper to the sibling board widget click inchat-widget-sandbox.e2e.test.ts, which takes the same reveal path. No timeouts were raised and no assertions weakened.User Impact
No product change. The Control UI e2e harness gains
clickBoardWidgetControl, which every test that clicks into a board widget frame should use; on the CI browser a click that never reaches the widget now retries until the widget observes the pointer and fails loudly at the wait deadline instead of passing the click and timing out on a later assertion.Evidence
Reproduction and proof ran on a Blacksmith Testbox through
scripts/crabbox-wrapper.mjs(Linux, system Chromium 151, the CI browser), using a scratch copy of the test withrepeats: 40per variant and failure diagnostics.Before, pre-#139506 test (Testbox run 34003022453): 9 silent-click failures across 80 iterations. Every failure recorded
inert:true, opacity:0on the outer frame at click time, with the top document receivingpointerdown/mousedown/clicktargeted atIFRAME.board-widget__frameand the proxy frame receiving nothing. A minimal cross-origin-frame script on the same box lost 300/300 clicks issued immediately after clearinginert/opacity:0(DOM check already reported the iframe as the hit target), and 99/100 on fresh pages.After, helper on the pre-#139506 test (Testbox run 34005414551): 0 failures across the same 80 iterations (40 dark + 40 light, ~0.8 s each), and the hover-verified variant of the minimal script lost 0/300 clicks on the same browser.
Local (macOS, Chrome for Testing): 0 failures in 250 iterations before or after, matching the platform difference above.
Head-to-head on one Testbox (run 34005936572), 40 repeats per variant each: current
main(#139506's single hover) failed the light variant once withexpected false to be trueon its:hoverpoll, the loud form of the same routing race; this branch's helper passed 80/80.Locally on the rebased tree:
pnpm tsgo:core:test,board-a2ui.e2e.test.ts, andchat-widget-sandbox.e2e.test.tspass;node scripts/check-changed.mjspasses; Codex autoreview (P0–P2) reported no actionable findings.