Skip to content

refactor(ui): let Solid load embedded board apps - #181369

Merged
steipete merged 5 commits into
mainfrom
solid2/w-zero-board-mcp
Oct 23, 2026
Merged

steipete merged 5 commits into
mainfrom
solid2/w-zero-board-mcp

Conversation

@steipete

@steipete steipete commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Embedded MCP board apps still load through a cell-owned custom-element import callback instead of a Solid component boundary.

User Impact

Embedded apps keep their existing appearance, native host identity, live lease updates, and acknowledged teardown. A failed renderer has a local Reload or Retry action without replacing the surrounding board.

Why This Change Was Made

Use one named lazy() component with local Loading and Errored boundaries. Preload still starts when the content owner settles, before a lease is ready and even while inactive. The cell no longer owns module registration. The existing generation/acknowledgement owner still waits for native teardown before retiring the view. Manual Retry checks the current component lifetime and activity; the document-level preload listener continues to own automatic stale-chunk recovery, as it did for the previous MCP import path.

Evidence

Proof Result
UI typecheck Passed again after integrating the landed core-widget boundary
Focused MCP widget suite 23 passed again after core integration; delayed import, disposal before readiness, retry, retained host, live props, lease renewal, and teardown acknowledgement
Core-widget integration 7 plugin/widget tests passed after resolving the shared cell boundary
Changed lease/native-handler fixtures 2 passed after strengthening the renewal to a different view ID and forwarding live handlers
Focused lint, formatting, controller guard Passed; no new allowances
Production Knip Exact base and head have the same pre-existing unused Telegram test-support file; no new finding
Independent review Original candidate, fixture-only CI repair and final integrated four-file candidate are clean through P2
Hosted core test-types leaf Passed after explicitly typing the forwarded native event
Mock export guard Passed; the controlled host and deferred import retain intentional isolation
Production build + strict asset comparison Base/head passed with zero violations; every JS delta inside the 64 B variance allowance
Built-browser capture Synthetic sandbox app at 1440×960; before/after ready PNGs byte-identical, zero page errors
Real chunk failure Aborted the hashed renderer JS request; local Reload recovered to the ready app, zero page errors

The first capture setup needed the repository's existing Vitest alias resolver to serve the sandbox fixture package. The corrected capture uses that resolver with the real fixture server. Broad proof runs in PR CI with ci:full; no local full E2E suite, Docker, live Gateway, or remote lease was used.

The initial full CI run exposed two fixture issues: the forwarded native event was not part of the inferred bridge props type, and the deliberately isolated mock needed its rationale recorded. Both are repaired without changing production code. That run also hit a lightbox request-cardinality assertion; current main's landed correction (b9689588648, #181190) is included through the conflict-only main integration, and this PR leaves that test verbatim. Runtime failures are compared by exact test name with completed scheduled main and the final full PR run.

Final integrated CI

Full CI 39914573933 tested fdf2fe22868652c34ce03c1eae073230868a83fd. All UI unit shards, production/test types, lint, architecture guards, security-fast and strict Control UI performance passed. Three browser jobs failed with ten cases that match latest completed scheduled main 39913763515 by exact name and assertion, with the previous completed main run 39906351041 providing the same result. The actual CI checkout b987bf402a9bc99985fe06ed36b65758a74f5200, its ordered parents and tree were verified; the three failing test files are unchanged from its baseline. The native inherited-failure route retains CI as failed.

Exact inherited test names

checks-ui-e2e-real-gateway (1/2)

  • ui/src/e2e/provider-browser-login.real-gateway.e2e.test.ts > Provider browser login through real HTTPS Gateway > rejects cancelled and stale callbacks, then saves a fresh sign-in and serves an existing session

checks-ui-e2e (7/9)

  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps dark child rows stable through loading and refresh at 1440 px with a fine pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps light child rows stable through loading and refresh at 1440 px with a fine pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps dark child rows stable through loading and refresh at 390 px with a fine pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps light child rows stable through loading and refresh at 390 px with a fine pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps dark child rows stable through loading and refresh at 390 px with a coarse pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps light child rows stable through loading and refresh at 390 px with a coarse pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps dark child rows stable through loading and refresh at 1440 px with a fine pointer and 140% text

checks-ui-e2e (1/9)

  • ui/src/e2e/mobile-sidebar-session-menu.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps mobile sidebar titles and menus usable with a coarse pointer
  • ui/src/e2e/mobile-sidebar-session-menu.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps mobile sidebar titles and menus usable with a fine pointer

Recorded same-machine asset comparison

Measured base: 753005052a9483deaa0bfc62342f1c43d5636912. Both builds use fixed identical metadata. These are the recorded pre-integration measurements. The MCP renderer and fixture remain byte-identical after integrating main; the shared cell additionally includes the landed core lazy boundary from #181314 (021bdf1d30767f3122c332703b9bff72f4012bca). The combined cell passed UI typechecking, all 23 MCP lifecycle cases and all 7 core/plugin widget cases. Final-head CI supplies integrated asset and broad runtime proof. Gzip bytes:

Surface Base JS Head JS Delta JS / CSS requests CSS bytes, unchanged
Startup 315,621 315,646 +25 7 / 1 41,143
Chat 1,347,423 1,347,467 +44 23 / 8 145,976
New Session 822,522 822,575 +53 17 / 6 106,486

Responsibility and size

Count in the affected files Before After
Manual component loader 1 0
Named lazy component 0 1
Effects 3 3
Component cleanup registrations 2 2
Owner APIs / production flush 0 0
Production LOC 816 848
Tests + isolation config LOC 537 641

The 32-line production increase gives the renderer a local loading/error/retry boundary. Teardown generation and acknowledgement logic is unchanged. The syntactic manual-import census misses the removed stored callback, so its global count is unchanged.

Visual proof

Inspected synthetic-only before/after ready captures and the failed-chunk/recovered states are attached below.

Before: synthetic embedded board app

After: same embedded board app

Failed renderer chunk: local recovery

Recovered embedded board app

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T07:00:45.393090Z fdf2fe2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR replaces cell-owned MCP renderer loading with a Solid lazy component and local loading, error, and recovery boundaries.

Example: The embedded Release checklist app’s renderer chunk fails to load.

  • Before: The cell swallows the import failure without offering renderer recovery.
  • After: The app region shows a Reload action and can recover to the checklist.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong browser evidence supports the focused refactor, but the introduced validation failure prevents a clean patch verdict.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The built Control UI exercises the changed board renderer with a synthetic sandbox app at 1440×960; inspected ready, failed-chunk, and recovered captures support the recorded aborted renderer request and Reload recovery, while focused fixtures support retained-host and teardown behavior.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: An embedded board app renderer can fail to load without offering a local recovery action.
Reason: The maintainer-authored direction follows the existing Solid migration contract and adds recovery while retaining host identity, lease behavior, and acknowledged teardown.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the maintainer-directed refactor is useful, but its new renderer mock introduces a concrete CI blocker.

Priority: P3
Reviewed head: e6b28bc2b066a51a163a2a8c81865378de675527

Before merge

  • Declare the deferred renderer mock’s isolation contract (P2) - This new first-party factory returns a closed replacement without importOriginal/vi.importActual pass-through or the required adjacent mock-isolation annotation. The mock-export scanner therefore adds a forbidden new entry, blocking baseline-ratchets; the exact-head job reports mock-exports failed. Add a specific // mock-isolation: ... reason immediately above this call explaining that real custom-element initialization must remain excluded from the held-import fixture, as the fixture guide permits. Do not expand the baseline or initialize the real renderer merely to satisfy the scanner.

Findings

  • [P2] Declare the deferred renderer mock’s isolation contract — ui/src/components/board/board-widget-cell-mcp-app.test.tsx:24
Agent review details

How this fits together

Board cells receive widget and lease snapshots, render the existing native MCP host, and retain it until its teardown acknowledgement completes.

flowchart LR
  A[Board widget and lease snapshot] --> B[Board cell]
  B --> C[Board MCP content]
  C --> D[Solid lazy loading boundary]
  D --> E[Native MCP app host]
  E --> F[Existing app lifecycle owner]
  D --> G[Local recovery action]
Loading

Technical review

Best possible solution:

Keep the focused lazy-component cutover and add the supported isolation explanation above its deferred renderer mock.

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

The mock-export failure follows directly from the new factory and scanner rules, and the exact-head CI annotation reports that check failing; no target code was executed.

Is this the best way to solve the issue?

The existing Solid bridge and recovery components provide the smallest coherent cutover, with no competing renderer or lifecycle owner; the fixture needs only its supported isolation annotation.

Full review comments:

  • [P2] Declare the deferred renderer mock’s isolation contract — ui/src/components/board/board-widget-cell-mcp-app.test.tsx:24
    This new first-party factory returns a closed replacement without importOriginal/vi.importActual pass-through or the required adjacent mock-isolation annotation. The mock-export scanner therefore adds a forbidden new entry, blocking baseline-ratchets; the exact-head job reports mock-exports failed. Add a specific // mock-isolation: ... reason immediately above this call explaining that real custom-element initialization must remain excluded from the held-import fixture, as the fixture guide permits. Do not expand the baseline or initialize the real renderer merely to satisfy the scanner.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:test-mock-exports --base 7530050
  • pnpm test ui/src/components/board/board-widget-cell-mcp-app.test.tsx --maxWorkers=1
  • git diff --check

What I checked:

PR surface

Source +32, Tests +99. Total +131 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 66 34 +32
Tests 2 100 1 +99
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 166 35 +131

Review metrics

Metric Value Why it matters
Production versus test growth Production +66/-34; tests and isolation configuration +100/-1 The production increase supplies local loading and recovery boundaries while removing the manual loader; added tests cover delayed loading, disposal, recovery, and retained-host updates.

Labels

Label changes:

  • add P3: This is a scoped UI ownership refactor with improved renderer recovery; the identified blocker affects validation rather than an established urgent user regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is a scoped UI ownership refactor with improved renderer recovery; the identified blocker affects validation rather than an established urgent user regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 23, 2026, 1:38 AM ET / 05:38 UTC.

@steipete
steipete enabled auto-merge (squash) October 23, 2026 07:05
@steipete
steipete disabled auto-merge October 23, 2026 07:19
@steipete
steipete merged commit b5ae1a4 into main Oct 23, 2026
128 of 135 checks passed
@steipete
steipete deleted the solid2/w-zero-board-mcp branch October 23, 2026 07:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
* refactor(ui): let Solid load embedded board apps

* test(ui): type the isolated MCP renderer event contract

* test(ui): assert gallery reuse above the native HTTP cache
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant