Skip to content

improve(ui): defer native plugin rendering until activation - #138447

Merged
steipete merged 2 commits into
mainfrom
codex/pgprep2-ui-budget
Sep 4, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/pgprep2-ui-budget

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Native plugin contribution rendering was bundled into startup alongside the Customize UI recovery control, even when no native plugins were loaded. Load that unchanged renderer through the existing plugin activation runtime, while keeping recovery available for catalog, authentication, and asset-loading failures. Preserve empty contribution hosts as display: contents before their custom element upgrades.

This reduces measured startup JavaScript from 350,378 to 348,491 bytes gzip, with the same eight startup requests and no budget increase. The current ceiling is 350,141 bytes. Regenerate the boot manifest through its ready /new and /chat browser captures, including the source moves those captures now observe.

Validation: the original budget check fails on the clean base and passes with this change. All seven bundled Chromium plugin lifecycle/recovery cases and 24 owner tests pass. The held-catalog regression proves contribution rendering stays deferred while recovery remains defined, and that navigation appears after activation; it also checks the host layout before definition. Existing coverage exercises failed initialization, reload recovery, hung peers, retained actions, session scoping, and chat admission. The full changed-file gate passes (core/UI types, i18n, lint, styles, dead exports, and policy checks), and independent review found no actionable P0–P2 findings. The renderer class body is unchanged. Production delta is +3 lines after moving the class, including the five-line eager layout rule; tests add 14 lines plus one test-support import, and generated manifest changes are separate.

Before and after use synthetic fixtures and show the same ready plugin page:

Before: plugin page ready

After: plugin page ready

The pinned-navigation sidebar fixture injects active registrations directly, so it now explicitly loads the real view runtime. Its assertions are unchanged. All 333 sidebar tests pass under both CI configurations; the first hosted attempt exposed this missing fixture dependency in two jobs. Production and the browser captures remain unchanged. The final changed-file gate and independent P0–P2 review pass.

@clawsweeper

clawsweeper Bot commented Sep 4, 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: M maintainer Maintainer-authored PR labels Sep 4, 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 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 2:45 PM ET / 18:45 UTC.

ClawSweeper review

What this changes

This PR defers native plugin contribution rendering until plugin activation while retaining the eager recovery control and adding browser and fixture coverage.

Merge readiness

✅ Ready for maintainer review

Keep open. The active maintainer-owned PR cleanly relocates native contribution rendering to the existing activation boundary; current main still defines it eagerly, and the reviewed browser regression covers deferred definition, preserved layout, and post-activation navigation.

Priority: P3
Reviewed head: 9660a6115d0bb4a402ed96b3dcd552ef407473ba

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving loading-boundary refactor with targeted browser coverage and no blocking defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply. The body supplies before/after screenshots and browser-test results; the hosted images could not be retrieved because this reviewer environment could not resolve GitHub, which is not contributor action.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply. The body supplies before/after screenshots and browser-test results; the hosted images could not be retrieved because this reviewer environment could not resolve GitHub, which is not contributor action.
Evidence reviewed 5 items Activation owner: The plugin runtime dynamically imports the loader only while activating a catalog entry; the loader then defines native views and contributions before the plugin can publish registrations.
Deferred-layout regression coverage: The browser scenario holds the plugin catalog, verifies that contributions are still undefined while the eager manager remains defined, confirms the host computes to display: contents, then waits for the plugin navigation link after activation.
Current-main comparison: Current main still registers openclaw-plugin-contributions from the eager contributions module, whereas the PR moves that registration into the runtime module; the central optimization is therefore not already implemented.
Findings None None.
Security None None.

How this fits together

Control UI starts with recovery controls and contribution host elements, then its plugin runtime fetches the Gateway catalog and activates native plugin modules. Activated plugins register navigation, actions, and accessory content that the contribution elements render.

flowchart LR
  A[Control UI startup] --> B[Recovery controls]
  A --> C[Contribution hosts]
  D[Gateway plugin catalog] --> E[Plugin activation]
  E --> F[Native UI runtime]
  F --> G[Plugin navigation and actions]
  C --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +7, Tests +15. Total +22 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 5 224 217 +7
Tests 3 15 0 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 239 217 +22

Review metrics

Metric Value Why it matters
Production versus test delta production +217/-214 (net +3); tests +14; test support +1; generated manifest +7/-3 The production change is predominantly a class relocation; the small net growth is the pre-upgrade display rule that preserves host layout.

Technical review

Best possible solution:

Retain the eager recovery manager and the CSS layout invariant, while loading the unchanged contribution renderer only through native plugin activation.

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

Not applicable: this is a loading-boundary optimization rather than a report of broken existing behavior. The supplied browser regression directly exercises the relevant pre- and post-activation states.

Is this the best way to solve the issue?

Yes. The existing activation loader is the owner of native renderer registration; keeping the contribution element eager would defeat the stated startup-size objective, while the recovery manager remains eager.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 26f87a37009b.

Labels

Label justifications:

  • P3: This is a bounded Control UI startup-size improvement with no demonstrated regression in the reviewed behavior.
  • 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: Repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply. The body supplies before/after screenshots and browser-test results; the hosted images could not be retrieved because this reviewer environment could not resolve GitHub, which is not contributor action.

Evidence

What I checked:

  • Activation owner: The plugin runtime dynamically imports the loader only while activating a catalog entry; the loader then defines native views and contributions before the plugin can publish registrations. (ui/src/plugins/control-ui-runtime.ts:291, 9660a6115d0b)
  • Deferred-layout regression coverage: The browser scenario holds the plugin catalog, verifies that contributions are still undefined while the eager manager remains defined, confirms the host computes to display: contents, then waits for the plugin navigation link after activation. (ui/src/e2e/native-plugin-ui.e2e.test.ts:469, 9660a6115d0b)
  • Current-main comparison: Current main still registers openclaw-plugin-contributions from the eager contributions module, whereas the PR moves that registration into the runtime module; the central optimization is therefore not already implemented. (ui/src/plugins/control-ui-contributions.ts:294, 26f87a37009b)
  • Feature provenance: The native-plugin customization feature, including the original runtime module, was introduced by the merged feature commit; this PR preserves the renderer body and changes its loading boundary. (ui/src/plugins/control-ui-view.runtime.ts:27, 6a97159ececb)
  • Introduced patch identity: The exact PR-head delta moves ControlUiPluginContributions and its custom-element registration from the eager module into the activation runtime; the follow-up commit imports that runtime in the isolated sidebar fixture. (ui/src/plugins/control-ui-view.runtime.ts:268, 9660a6115d0b)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (1 earlier review cycle)
  • reviewed 2026-09-04T17:54:26.305Z sha ba13561 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 3a180c4 into main Sep 4, 2026
133 checks passed
@steipete
steipete deleted the codex/pgprep2-ui-budget branch September 4, 2026 18:48
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…#138447)

* perf(ui): defer native plugin contribution rendering

* test(ui): load the active plugin renderer in sidebar fixtures
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: M 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