Skip to content

fix(ui): wait for widget readiness in board layout tests - #152198

Merged
steipete merged 1 commit into
mainfrom
ci-burden/board-view-fullbleed-report
Sep 18, 2026
Merged

steipete merged 1 commit into
mainfrom
ci-burden/board-view-fullbleed-report

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes a board layout test race where the initial size-report check can expire before the iframe document starts its bridge. Main run 35394611976, checks-ui (3/3), failed the full-bleed grid case with zero reports.

Related: #150217 (earlier iframe readiness diagnostics), #149929 (browser interaction coverage).

User Impact

No user-visible change. This is a test-only correction; production code, timeout values, retries, and all size-report and geometry assertions remain unchanged.

Why This Change Was Made

Root cause category (b): test readiness. The test starts Vitest's default one-second size-report polling immediately after assigning srcdoc, although assignment does not establish that the widget document has bootstrapped. Wait for the existing, source-matched openclaw:widget-bridge-ready message before starting that same size-report check. Document startup remains bounded by the existing test timeout.

Both the product host and test listener subscribe before document startup. The size reporter already reports on load and initial observation, including when the body fills the viewport. There is no evidence for a lost initial report or a missing ResizeObserver notification. The test continues to exercise real openclaw:widget-size messages for all six presentation/surface combinations.

Evidence

  • Original file: 21/21 Chromium executions passed at 6× CPU throttling with 3 concurrent copies. The exact CI scheduling condition did not recur locally.
  • Controlled reproduction: a local-only 1.2-second parser stall before bridge bootstrap made the original full-bleed grid test fail with zero reports at 1,283ms; the iframe then emitted its valid 190px report. With the fix, the same controlled stall passed and delivered the real report at 1,273ms. The instrumentation is not committed.
  • Final file: 21/21 under the same 6×/3-copy pressure, 546 tests passed, no retries.
  • Board/widget siblings: 137 tests passed across 9 files. The unit-node inline MCP App browser cases also passed in Chromium and WebKit (2 selected cases).
  • node scripts/check-changed.mjs passed, including the UI test typecheck, repository guards, unused-export scans, and scoped lint. Line-cap ratchet against origin/main, type-aware Oxlint plus a failing canary, oxfmt --check, and git diff --check passed. Shipped CSS/JavaScript inputs are unchanged; no bundle budget rebuild was selected for this test-only diff.
  • Independent autoreview: scoped-clean, no P0–P2 findings.

The failed CI screenshot was not available and was not used. No CI reruns were requested. This maintainer-requested correction changes only test readiness; it does not claim a production sizing defect.

Wait for the source-matched widget bridge handshake before starting the
existing size-report assertion. Keep all geometry assertions and timeout
values unchanged; this is test readiness only.

Related: #150217 and main run 35394611976 (checks-ui 3/3).
The original file passed 21 pressure executions; a controlled pre-bridge
parser stall reproduced the zero-report assertion and passed with the fix.
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 18, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 6:14 PM ET / 22:14 UTC.

ClawSweeper review

What this changes

The board layout browser tests wait for the widget iframe’s readiness message before checking its size reports, preserving existing geometry assertions and timeout values.

Merge readiness

✅ Ready for maintainer review

Keep open: this focused test-readiness correction remains useful on current main. No actionable correctness or security findings were found; the related merged work does not supersede it.

Priority: P3
Reviewed head: 375c6a9050a63b582b50ffc3a98015309f6d3486

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable readiness correction with useful reported browser validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies this as maintainer-authored test-only work, so the external-contributor proof gate does not apply. The body reports controlled Chromium validation of the changed readiness path; inspected related-PR screenshots show unrelated annotation and Side chat behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies this as maintainer-authored test-only work, so the external-contributor proof gate does not apply. The body reports controlled Chromium validation of the changed readiness path; inspected related-PR screenshots show unrelated annotation and Side chat behavior.
Evidence reviewed 8 items Introduced change: The pinned merge-base-to-head diff adds a shared deferred promise, resolves it only for the tested iframe’s bridge-ready message, and awaits it before the existing size assertion. The listener is installed before srcdoc assignment; all geometry assertions remain intact.
Current main still needs the correction: Current main has the same test blob as the pinned merge base and starts polling immediately after assigning srcdoc, without waiting for bridge startup.
Existing production readiness signal: The generated widget document emits bridge-ready during bootstrap. Its size reporter independently registers load and ResizeObserver callbacks, so waiting for readiness does not replace the size-report assertion or fabricate its result.
Findings None None.
Security None None.

How this fits together

Control UI dashboards display widgets inside isolated iframes that report their content height to the board. These browser tests verify stable widget geometry across three presentations and two layout surfaces.

flowchart LR
  A[Board test fixture] --> B[Widget iframe document]
  B --> C[Bridge readiness message]
  C --> D[Start size-report check]
  B --> E[Content height reports]
  E --> D
  D --> F[Verify stable board geometry]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +11. Total +11 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 11 0 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 11 0 +11

Review metrics

None.

Technical review

Best possible solution:

Synchronize the existing browser test with document bootstrap while continuing to require real size messages and unchanged layout invariants.

Do we have a high-confidence way to reproduce the issue?

Yes for the controlled startup-delay mechanism: current source begins polling before iframe bootstrap, and the PR reports a failing-before/passing-after parser-stall experiment. The reviewer did not execute it, and the exact hosted timing remains unconfirmed.

Is this the best way to solve the issue?

Yes. Reusing the existing source-matched readiness signal addresses test startup ordering without changing production code, adding retries, or weakening geometry checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6d43ed90854e.

Labels

Label changes:

  • add P3: This is a narrow browser-test reliability correction with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies this as maintainer-authored test-only work, so the external-contributor proof gate does not apply. The body reports controlled Chromium validation of the changed readiness path; inspected related-PR screenshots show unrelated annotation and Side chat behavior.

Label justifications:

  • P3: This is a narrow browser-test reliability correction with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies this as maintainer-authored test-only work, so the external-contributor proof gate does not apply. The body reports controlled Chromium validation of the changed readiness path; inspected related-PR screenshots show unrelated annotation and Side chat behavior.

Evidence

What I checked:

  • Introduced change: The pinned merge-base-to-head diff adds a shared deferred promise, resolves it only for the tested iframe’s bridge-ready message, and awaits it before the existing size assertion. The listener is installed before srcdoc assignment; all geometry assertions remain intact. (ui/src/components/board/board-view.browser.test.ts:581, 375c6a9050a6)
  • Current main still needs the correction: Current main has the same test blob as the pinned merge base and starts polling immediately after assigning srcdoc, without waiting for bridge startup. (ui/src/components/board/board-view.browser.test.ts:588, 6d43ed90854e)
  • Existing production readiness signal: The generated widget document emits bridge-ready during bootstrap. Its size reporter independently registers load and ResizeObserver callbacks, so waiting for readiness does not replace the size-report assertion or fabricate its result. (src/canvas/wrap.ts:191, 375c6a9050a6)
  • Startup remains bounded: The shared UI test configuration retains a 60,000 ms test timeout. The patch changes neither that deadline nor the size-report polling timeout. (ui/vitest.config.ts:125, 375c6a9050a6)
  • Reported controlled browser validation: The captured PR body reports that a 1.2-second pre-bootstrap parser stall failed the original assertion before a valid 190px report arrived, while the corrected test passed under the same stall. It also reports 21 passing pressure executions and 137 sibling tests. These are author-reported results, not reviewer executions; the exact hosted scheduling failure did not recur locally. (375c6a9050a6)
  • Latest release comparison: The supplied latest release, v2026.9.4, also starts the size-report assertion immediately after srcdoc assignment. It does not contain this readiness correction. (ui/src/components/board/board-view.browser.test.ts:458, 3a9d69db306c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit a596d8d into main Sep 18, 2026
150 of 152 checks passed
@steipete
steipete deleted the ci-burden/board-view-fullbleed-report branch September 18, 2026 22:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 18, 2026
…pr-149099-main-20260918

* commit '795e460278d4f8f41545dc8b4a66da1d12defd90': (1902 commits)
  refactor(slack): share Markdown preparation (#149129)
  fix(tooling): release completed PR operations with exited loaders (#152209)
  fix(release): allow stable npm bootstrap under an operator soak waiver (#152206)
  fix(daemon): avoid false restart timeouts during slow startup (#151387)
  feat: read agent documents from a host-owned workspace (#150584)
  improve(startup): skip redundant single-agent directory checks (#152192)
  test(ui): await board widget readiness before size reports (#152198)
  perf(browser): move dashboard event discovery to SQLite worker (#151952)
  improve(auth): reduce pauses during concurrent credential reads (#152140)
  improve(ui): load older chat history in smaller pages (#152093)
  fix(release): reject incomplete legacy npm install trees (#152186)
  refactor: share current-conversation binding row serialization (#152134)
  test(tooling): preserve Node and terminal fixture ownership under Bun (#152187)
  fix(sqlite): service worker admission through retained path aliases (#152190)
  improve: reduce CPU work for long CLI reasoning streams (#152191)
  chore(ui): refresh control ui locales (#152196)
  test(subagents): align lifecycle retries with durable completion owners (#152184)
  perf(gateway): defer participant maps for owned sessions (#152097)
  refactor(stream): share auxiliary queue overflow handling (#149282)
  fix(test): execute CLI fixture preloads on Node and Bun (#152076)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…152198)

Wait for the source-matched widget bridge handshake before starting the
existing size-report assertion. Keep all geometry assertions and timeout
values unchanged; this is test readiness only.

Related: openclaw#150217 and main run 35394611976 (checks-ui 3/3).
The original file passed 21 pressure executions; a controlled pre-bridge
parser stall reproduced the zero-report assertion and passed with the fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant