Skip to content

refactor(ui): split browser panel into chrome renderers and a lifecycle controller - #113017

Merged
steipete merged 3 commits into
mainfrom
ui-split-browser-panel-2607
Jul 23, 2026
Merged

steipete merged 3 commits into
mainfrom
ui-split-browser-panel-2607

Conversation

@steipete

@steipete steipete commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The embedded browser panel had grown to 1,312 lines and mixed dock chrome/rendering with browser-session lifecycle, remote navigation, screenshot capture, devtools inspection, and annotation state. It therefore remained behind a grandfathered max-lines suppression and was difficult to review or change safely.

Why This Change Was Made

This behavior-neutral split keeps dock/open/resize ownership in the custom element, moves browser-session and embedded-surface lifecycle into one Lit ReactiveController with a narrow BrowserPanelControllerHost, and moves chrome/toolbar templates plus pure surface geometry/compositing into free sibling functions. The existing lazy-custom-element.ts -> import(browser-panel.ts) boundary is unchanged, so all new siblings remain in the existing lazy browser-panel chunk.

AI-assisted. I reviewed the complete original module, its direct importers, its importer suites, the browser client/annotation dependencies, and the sidebar-series controller/render precedents before cutting.

User Impact

None. This is a behavior-neutral ownership split; existing assertions and user-visible behavior are unchanged.

Evidence

  • Focused Vitest: 5 files, 51 tests passed (browser-panel.test.ts, app-host.test.ts, lazy-custom-element.test.ts, browser-client.test.ts, browser-annotation.test.ts). No assertions were edited.
  • UI test typecheck: node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json passed on Blacksmith Testbox.
  • Changed gate: node scripts/check-changed.mjs -- <five touched files> passed, including UI/core-test types, formatting, i18n, lint/guards, and the max-lines ratchet. After rebasing across the sibling suppression removals, the ratchet reports 1,133 grandfathered suppressions.
  • Production UI build and performance guard: pnpm ui:build passed. Startup JS is 323,394 bytes gzip versus the 323,435-byte baseline (-41 bytes), with 9 startup JS requests. The lazy browser-panel chunk is 10.13 KiB gzip. No [INEFFECTIVE_DYNAMIC_IMPORT] warning was emitted, and no static import of the lazy panel was introduced.
  • Hosted proof run: https://github.com/openclaw/openclaw/actions/runs/30003396817
  • Autoreview: final committed branch review against origin/main reported no accepted/actionable findings.
  • Suppression cleanup: removed the file-local max-lines disable and config/max-lines-baseline.txt entry; every resulting source file is at most 700 lines.
  • Resulting source sizes: browser-panel.ts 259, browser-panel-controller.ts 700, browser-panel-render.ts 348, browser-panel-surface.ts 147.
  • git diff --numstat origin/main...HEAD:
    • 0 1 config/max-lines-baseline.txt
    • 700 0 ui/src/components/browser/browser-panel-controller.ts
    • 348 0 ui/src/components/browser/browser-panel-render.ts
    • 147 0 ui/src/components/browser/browser-panel-surface.ts
    • 33 1086 ui/src/components/browser/browser-panel.ts

No screenshots are included because the refactor intentionally produces no visual change.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Jul 23, 2026
@steipete steipete self-assigned this Jul 23, 2026
@steipete
steipete marked this pull request as ready for review July 23, 2026 11:58
@clawsweeper

clawsweeper Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(ui): split browser panel into chrome renderers and a lifecycle controller This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@clawsweeper

clawsweeper Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(ui): split browser panel into chrome renderers and a lifecycle controller This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@clawsweeper

clawsweeper Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(ui): split browser panel into chrome renderers and a lifecycle controller This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 0051ed4be4dced987e276446c4123d295d414d89:

  • node scripts/run-vitest.mjs ui/src/components/browser/browser-panel.test.ts ui/src/app/app-host.test.ts ui/src/app/lazy-custom-element.test.ts ui/src/components/browser/browser-client.test.ts ui/src/components/browser/browser-annotation.test.ts — 5 files, 51 tests passed; no assertions changed.
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json — passed on Blacksmith Testbox.
  • node scripts/check-changed.mjs -- config/max-lines-baseline.txt ui/src/components/browser/browser-panel.ts ui/src/components/browser/browser-panel-controller.ts ui/src/components/browser/browser-panel-render.ts ui/src/components/browser/browser-panel-surface.ts — passed on Blacksmith Testbox.
  • pnpm ui:build — production UI build and startup guard passed; startup JS 323,394 bytes gzip vs 323,435-byte baseline (-41 bytes), browser-panel chunk 10.13 KiB gzip, no ineffective dynamic-import warning.
  • Final autoreview --mode branch --base origin/main — clean, no accepted/actionable findings.
  • Exact-head CI run https://github.com/openclaw/openclaw/actions/runs/30006207314 — passed; PR rollup had 97 contexts, zero pending/failing.
  • Repo-native review artifacts validated READY FOR /prepare-pr with zero findings; hosted OPENCLAW_TESTBOX=1 scripts/pr prepare-run 113017 passed and reused the exact green head.

The file-local max-lines suppression and baseline entry are removed. Resulting source files are 259, 700, 348, and 147 lines; the existing lazy browser-panel chunk boundary is preserved.

@steipete
steipete force-pushed the ui-split-browser-panel-2607 branch from 0051ed4 to ba5d64b Compare July 23, 2026 12:32
@steipete
steipete merged commit f3b4f9c into main Jul 23, 2026
97 checks passed
@steipete
steipete deleted the ui-split-browser-panel-2607 branch July 23, 2026 12:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 24, 2026
…le controller (openclaw#113017)

* refactor(ui): split browser panel into chrome renderers and a lifecycle controller

* fix(ui): keep browser panel mode internal

* refactor(ui): clarify normalized browser panel request
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 size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant