Skip to content

test(ui): share browser page cleanup across layout fixtures - #146805

Merged
steipete merged 3 commits into
mainfrom
codex/test-browser-page-lifetimes
Sep 13, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/test-browser-page-lifetimes

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The browser layout tests repeat the same page cleanup around dozens of otherwise distinct scenarios.

User Impact

Internal-only test maintenance; there is no user-visible or visual change.

Why This Change Was Made

Use one narrow helper for the existing page acquisition, awaited test body, and awaited cleanup in 81 source blocks. Keep shared browser/context ownership, setup-failure cleanup, mobile fixtures, and borrowed app-window pages with their existing owners. The helper preserves the existing handling of close errors; it adds a promise continuation before cleanup, with no runtime speedup claim.

This removes 194 net test/support lines, including the new helper and 32 lines of formatter growth. Production code is unchanged.

Evidence

All 148 cases in the four complete browser files passed before and after the change on Node 24.19.0 and Chrome 152.0.7977.83, with identical per-file names, ordering, and outcomes and no skipped cases. Source comparison preserves every factory expression and test body and reconstructs each original file exactly. Six controls against the actual helper and unchanged close owner cover acquisition/body failures, cleanup error handling, page identity, ordering, and awaited completion. Independent P2 review found no actionable findings. The mapped changed gate passed, including core test and UI types, formatting, lint, i18n, and dead-export checks.

Earlier hosted runs exposed unrelated mainline workflow-fixture and file-tab selector failures. The branch includes both canonical repairs; its five-file cleanup patch is unchanged. Original failure evidence is retained, and validation is running on the new head.

@clawsweeper

clawsweeper Bot commented Sep 13, 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.

@steipete
steipete marked this pull request as ready for review September 13, 2026 06:37
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Sep 13, 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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 6:04 AM ET / 10:04 UTC (Revision 3).

ClawSweeper review

What this changes

This PR shares browser-page cleanup across UI layout tests while retaining their scenarios, assertions, and existing browser ownership.

Merge readiness

✅ Ready for maintainer review

The cleanup remains useful and has no actionable correctness findings. It preserves fixture ownership and belongs to the active maintainer-requested test audit; current main still uses the repeated cleanup pattern.

Priority: P3
Reviewed head: 7f681425ac47571496673a7030f7eeeff7539594

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with relevant reported validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies maintainer-authored, internal test cleanup, so the external contributor proof gate does not apply; reported Chromium before/after runs exercise the affected fixtures, and production behavior is unchanged.
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 maintainer-authored, internal test cleanup, so the external contributor proof gate does not apply; reported Chromium before/after runs exercise the affected fixtures, and production behavior is unchanged.
Evidence reviewed 7 items Cleanup semantics: The helper awaits page acquisition before entering try/finally, awaits the callback, and awaits the existing close operation with close errors suppressed. Acquisition failures remain the factory's responsibility.
Fixture ownership remains intact: Page factories retain setup-failure cleanup; shared app pages retain their suite-level lifetime. All introduced chat hunks were inspected using the complete whitespace-insensitive diff, including the formatter-only assertion wrapping.
Existing broader helper has a different contract: The E2E suite's withPage creates and closes a context and captures failure diagnostics. It cannot replace this page-only helper without changing the layout fixtures' shared-context ownership.
Findings None None.
Security None None.

How this fits together

Control UI layout tests load fixtures into Chromium and inspect rendering and interaction behavior. The shared helper awaits each test body and closes its page while existing fixtures continue to own browsers and contexts.

flowchart TD
  A[Layout test scenario] --> B[Existing page factory]
  B --> C[Shared page helper]
  C --> D[Run and await assertions]
  D --> E[Close page on success or failure]
  E --> F[Preserve test result]
  G[Suite teardown] --> H[Close shared contexts and browser]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -194. Total -194 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 5 677 871 -194
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 677 871 -194

Review metrics

None.

Technical review

Best possible solution:

Keep page cleanup centralized while leaving page creation, shared contexts, and borrowed app-page lifetimes with their existing fixture owners.

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

Not applicable: this consolidates existing test cleanup rather than repairing a reported product defect; tests were not executed during this read-only review.

Is this the best way to solve the issue?

Yes. The narrow page helper preserves existing failure handling and ownership without introducing the broader E2E harness's context lifecycle.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is internal test-maintenance cleanup with no production or user-visible 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 maintainer-authored, internal test cleanup, so the external contributor proof gate does not apply; reported Chromium before/after runs exercise the affected fixtures, and production behavior is unchanged.

Evidence

What I checked:

  • Cleanup semantics: The helper awaits page acquisition before entering try/finally, awaits the callback, and awaits the existing close operation with close errors suppressed. Acquisition failures remain the factory's responsibility. (ui/src/test-helpers/browser-page.ts:3, 7f681425ac47)
  • Fixture ownership remains intact: Page factories retain setup-failure cleanup; shared app pages retain their suite-level lifetime. All introduced chat hunks were inspected using the complete whitespace-insensitive diff, including the formatter-only assertion wrapping. (ui/src/pages/chat/chat-responsive.browser.test.ts:840, 7f681425ac47)
  • Existing broader helper has a different contract: The E2E suite's withPage creates and closes a context and captures failure diagnostics. It cannot replace this page-only helper without changing the layout fixtures' shared-context ownership. (ui/src/e2e/control-ui-e2e-suite.test-support.ts:479, 7f681425ac47)
  • Still distinct from main and release: Fetched main retains the local closeBrowserPage function and has no withBrowserPage use under ui. The latest supplied release tag has no browser-page helper at the proposed path; no merged replacement was established. (ui/src/pages/chat/chat-responsive.browser.test.ts:899, b938f093b1e4)
  • Re-review continuity: All five cleanup files are byte-identical to the previous reviewed head. The supplied completed review lists no findings or published rank-up moves. (7f681425ac47)
  • Campaign context and reported validation: The captured PR body reports 148 before/after cases with matching names, order, and outcomes, plus six lifecycle controls. The supplied discussion for Test audit: reduce redundant test code and full-suite runtime #139428 explicitly tracks this cleanup as an open campaign batch. These are contributor-reported results; this read-only review did not execute tests. (7f681425ac47)

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-13T06:44:56.401Z sha c8c4bec :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T09:45:45.492Z sha 19218ac :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 08c1d30 into main Sep 13, 2026
130 of 131 checks passed
@steipete
steipete deleted the codex/test-browser-page-lifetimes branch September 13, 2026 10:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* refs/heads/temp/pr-146883: (159 commits)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  fix(ui): let slow dashboard downloads finish before recovery (#146881)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* refs/heads/temp/pr-146833: (43 commits)
  fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-146802: (51 commits)
  improve: reduce worktree filesystem stalls and archive syncs (#146906)
  fix(ui): avoid extra chat rail work while replies stream (#146883)
  improve(ui): speed up populated Usage timelines (#146947)
  test(gateway): retain auth recovery failure diagnostics (#146925)
  fix(tests): create private temporary home directories (#146931)
  fix(backup): preserve discovery under concurrent state writes (#146912)
  fix: keep queued deliveries in their original state directory (#146917)
  fix(discord): settle voice waveform work before releasing input (#146885)
  fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
…ssion-list-roster-batch-20260913

* commit 'f513c0f345f7f2514c49ccfbc00adc3f78b9a755': (46 commits)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  fix(ui): let slow dashboard downloads finish before recovery (#146881)
  fix: share Doctor lifecycle coordination with SQLite workers (#146714)
  fix: retain native session model provenance (#146801)
  fix: settle embedded transcript repairs before session cleanup (#146842)
  feat(macos): improve agent navigation and chat layout (#146531)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
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: XL 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