Repository navigation
test(ui): fix stale toast and racing handoff browser tests - #204004
Conversation
- Expect the current "live" occlusion state in the native-tab toast test. - Grow the composer menu through its height owner instead of writing the owned panel height from the test. Fixes #203988 Co-authored-by: obviyus <[email protected]>
|
🦞👀 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. What this changesThis PR updates the toast expectation and makes the attachment resize test grow the menu through its existing height owner. Example: The browser test selects File while the composer menu grows after Web search becomes available.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this focused test repair addresses confirmed inherited browser failures while preserving the product assertions; no actionable defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherControl UI browser tests exercise toast occlusion and composer attachment activation using real DOM layout, menu components, and CSS transitions. flowchart TD
A[Browser test] --> B[Composer menu props]
B --> C[Menu content]
C --> D[Menu frame measurement]
D --> E[CSS height transition]
E --> F[File selection]
F --> G[Retained attachment input]
Technical reviewBest possible solution: Retain this focused repair so browser checks follow the established occlusion contract and exercise resizing through the existing menu frame. Do we have a high-confidence way to reproduce the issue? The toast mismatch is deterministic from current source and matches CI annotations; the attachment failure trace matches the test's competing height write, with CPU-throttled reproduction reported by the author. Is this the best way to solve the issue? The patch uses the existing height owner, loads the real transition stylesheet, and preserves the original behavioral assertions without changing production code. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 84cab039664a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +13. Total +13 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 23, 2026, 3:38 AM ET / 08:38 UTC. |
|
Landed in 8d69930. The toast test now expects the current "live" occlusion state, and the handoff resize test grows the menu through its height owner. checks-ui (3/3) passed 7 of 7 and (1/3) 3 of 3 runs on this head. |
…204004) `checks-ui (1/3)` and `checks-ui (3/3)` pass again on unrelated PRs. Two Control UI browser tests failed for reasons not caused by the PRs that ran them: one was stale against a change on `main`, one raced the code that owns the menu height. Fixes openclaw#203988 ## Cause 1. **`ui/src/lib/toast.browser.test.ts` (shard 1/3): stale test, fails every time on `main`.** - openclaw#203661 (merged 01:08 UTC, 6b2749c) changed `subscribeNativeOverlayOcclusion` listeners from `boolean` to `"live" | "hidden" | "backdrop" | "hidden-backdrop"` and updated the tests that existed then. - openclaw#203675 (merged 04:30 UTC, 9868d85) added a test that expects `[[false]]`. Its last CI run was at 21:09 UTC on 2026-11-22, before openclaw#203661 merged, so its own run did not include the new listener type. - Every merge ref that contains both commits fails with `expected [ [ 'live' ] ] to deeply equal [ [ false ] ]`. That is the error in all 40 failing shard-1 logs. 2. **`ui/src/pages/chat/components/chat-attachment-handoff.browser.test.tsx` "resizing" (shard 3/3): timing race in the test.** This test was added in openclaw#203669 (merged 04:35 UTC). - The test set `surface.style.height` itself with a 10 s transition. `ChatComposerPlusMenuFrame` owns that height and measures it one layout frame after the menu opens. - On a loaded runner, that measurement comes after the test's write and puts the old height back. The browser then cancels the running transition (`transitioncancel height` was recorded), so no animation is running at `pointerdown`. All 21 failing shard-3 logs fail at line 62, `expect(animatingAtPointerDown).toBe(true)`. 3. `board-view.browser.test.ts` never failed. A triage script matched the `×` in its test name "480×634". All 73 failed-job logs show this file passing. ## Fix - Toast test: expect `[["live"]]`. This is the current listener contract, the same value its sibling test in `native-overlay-occlusion.test.ts` expects. - Handoff test, "resizing" case: the menu grows the way it does in the product, when capabilities arrive while the menu is open. - The test waits until the menu frame has written its height in pixels, then adds a root toggle. - The frame writes the new height, and the panel's own `[data-phase="open"]` height transition runs. The test only makes that transition 10 s long. - The test loads `styles/chat/composer.css` so the real transition rule applies, and polls for the running animation instead of asserting it once. - No product code changes. ## Evidence | | `main` 6cc2ee8 | this PR | |---|---|---| | Toast test, local | fails 1/1 (same assertion as CI) | passes | | Handoff "resizing", local, idle | 15/15 pass | passes | | Handoff "resizing", local, CDP CPU throttle ×20 | fails 6/6 (same assertion as CI) | 30/30 pass | | Handoff "resizing" with the product's `transition-property` suppression removed | | fails (`activations` 0, expected 1), so the test still guards the product | CI failure rate per shard, from PR runs of `ci.yml`: | | before 05:00 UTC 2026-11-23 | 05:00–07:52 UTC (41 runs) | this PR | |---|---|---|---| | `checks-ui (1/3)` | 9/86 | 39/41 (95%) | 0/3 | | `checks-ui (3/3)` | 2/87 | 22/41 (54%) | 0/7 | Rerun proof on head 8148681, run 45138279133 (initial run plus `gh run rerun --job` attempts 2-9): `checks-ui (3/3)` passed 7 of 7 times and `checks-ui (1/3)` 3 of 3 times. At the old rates, the chance of these passes would be 0.46^7 ≈ 0.5% for shard 3 and 0.05^3 ≈ 0.01% for shard 1. ## Why `main` did not stop it Hourly `main` CI runs `checks-ui`, and it went red on the first hourly run after the merge (05:29 UTC, run 45118053016), then again at 06:45 and 07:29. Ordinary `main` pushes run only `security-fast` by design (`OPENCLAW_CI_ON_PUSH`). `checks-ui` was selected on both source PRs by its path rules. So the defect was detected on `main` within an hour; the red hourly run had no follow-up action. This PR changes no workflow file. Co-authored-by: Ayaan Zaidi <[email protected]>
checks-ui (1/3)andchecks-ui (3/3)pass again on unrelated PRs. Two Control UI browser tests failed for reasons not caused by the PRs that ran them: one was stale against a change onmain, one raced the code that owns the menu height.Fixes #203988
Cause
ui/src/lib/toast.browser.test.ts(shard 1/3): stale test, fails every time onmain.subscribeNativeOverlayOcclusionlisteners frombooleanto"live" | "hidden" | "backdrop" | "hidden-backdrop"and updated the tests that existed then.[[false]]. Its last CI run was at 21:09 UTC on 2026-11-22, before fix: keep Mac Browser tabs visible behind the command palette #203661 merged, so its own run did not include the new listener type.expected [ [ 'live' ] ] to deeply equal [ [ false ] ]. That is the error in all 40 failing shard-1 logs.ui/src/pages/chat/components/chat-attachment-handoff.browser.test.tsx"resizing" (shard 3/3): timing race in the test. This test was added in improve: make common Chat controls quicker to open #203669 (merged 04:35 UTC).surface.style.heightitself with a 10 s transition.ChatComposerPlusMenuFrameowns that height and measures it one layout frame after the menu opens.transitioncancel heightwas recorded), so no animation is running atpointerdown. All 21 failing shard-3 logs fail at line 62,expect(animatingAtPointerDown).toBe(true).board-view.browser.test.tsnever failed. A triage script matched the×in its test name "480×634". All 73 failed-job logs show this file passing.Fix
[["live"]]. This is the current listener contract, the same value its sibling test innative-overlay-occlusion.test.tsexpects.[data-phase="open"]height transition runs. The test only makes that transition 10 s long.styles/chat/composer.cssso the real transition rule applies, and polls for the running animation instead of asserting it once.Evidence
mainb917ed7transition-propertysuppression removedactivations0, expected 1), so the test still guards the productCI failure rate per shard, from PR runs of
ci.yml:checks-ui (1/3)checks-ui (3/3)Rerun proof on head 8148681, run 45138279133 (initial run plus
gh run rerun --jobattempts 2-9):checks-ui (3/3)passed 7 of 7 times andchecks-ui (1/3)3 of 3 times. At the old rates, the chance of these passes would be 0.46^7 ≈ 0.5% for shard 3 and 0.05^3 ≈ 0.01% for shard 1.Why
maindid not stop itHourly
mainCI runschecks-ui, and it went red on the first hourly run after the merge (05:29 UTC, run 45118053016), then again at 06:45 and 07:29. Ordinarymainpushes run onlysecurity-fastby design (OPENCLAW_CI_ON_PUSH).checks-uiwas selected on both source PRs by its path rules. So the defect was detected onmainwithin an hour; the red hourly run had no follow-up action. This PR changes no workflow file.Rerun proof (distinct executions, head 8148681)
Run 45138279133 had 9 attempts. Each
gh run rerun --jobattempt re-ran only the selected shard, and the other shard's result was carried over. Distinct executions, by job start time:checks-ui (1/3)checks-ui (3/3)No execution failed.