Skip to content

refactor(ui): port board and system pages to Solid 2 - #168871

Merged
steipete merged 25 commits into
mainfrom
solid2/w-pg-5b
Oct 11, 2026
Merged

steipete merged 25 commits into
mainfrom
solid2/w-pg-5b

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Ports the board, dashboards, plugin host/pages, portals, and systems rendering from Lit to Solid 2 while preserving registered tags, routes, CSS classes, selectors, and the plugin SDK.

User Impact

The pages retain their appearance and interactions. Board reordering preserves DOM insertion order, iframe identity, and draft state. Removed MCP widgets remain connected until teardown completes. Retained portal and plugin views keep their state through presentation changes and reject work from retired owners.

Why This Change Was Made

Each ported tag has one Solid implementation registered through defineSolidBridge; its Lit class is deleted. Domain owners remain plain TypeScript and consumers use existing projections. Solid icons/settings helpers replace touched equivalents. Remaining Lit render helpers serve actual unported callers and can be deleted with those callers.

The shared bridge invokes setup through Solid's untracked component entry point, preventing provider memos from rebuilding a retained view on a property update. Native link/div rendering replaces a generic dynamic-tag helper, and the session summary subscribes directly to its fixed Gateway event owner; this avoids retaining unused generic code in the startup chunk. Dashboard pagination stays synchronous with the managed-list owner's completion notification. Plugin history retires its connection scope synchronously, including same-client reconnects. Shared custom-element types have one declaration owner. The current main Solid sparkline is retained, and its data/JSX contract remains in a plain type-only owner. Standalone chat fallbacks use the existing optional application-context helper. The frame uses its .tsx module directly: a redundant same-name .ts re-export shadowed the implementation in type-aware lint and is removed.

The port incorporates main's nested-bridge, lifecycle callback, Lit-content timing, and tooltip readiness fixes. The original plugin runtime path retains only a six-line stateless adapter for the unchanged SDK's opaque Lit templates. The Solid implementation lives in a separate module, so the adapter and renderer stay behind the plugin lazy boundary. A coupled terminal correction sets the native custom-element active property explicitly so the viewport becomes visible; its browser regression failed before the correction and passes afterward.

Evidence

Proof Result
Board unit / browser-unit 41/41 (5.87s wall), 27/27 (7.77s); loading, drag/drop, geometry, focus, retained state
Board retention / MCP lifecycle after main integration 6/6 (8.50s), 14/14 (5.54s)
Shared bridge / portals 20/20 (5.46s); portals 25/25 (3.15s), including raw-host iframe retention regression
Plugin page / summary / navigation 17/17, 9/9, 2/2; stale-owner and reconnect regressions included
Dashboards / dashboard route 4/4 (6.46s), 3/3 (2.59s)
Systems / logbook / board document / frame and resilience 12/12, 2/2, 4/4, 11/11 and 6/6 single-file runs
Terminal viewport / readiness 1/1 browser regression (failed before), 10/10 readiness
Settings editor browser 20/20 (5.36s wall); shared context fixture, no new cast
Tooltip lazy / sibling tests 9/9 and 49/49; deterministic pre-fix failure verified
Focused type-aware lint / frame regressions Three corrected files pass; frame 11/11 (4.93s), resilience 6/6 (3.41s), MCP 14/14 (4.28s)
Focused lint, formatting, i18n, Lit and assertion-safety ratchets Passed locally; test-timeout and test-mock-export ratchets passed
Isolated Codex autoreview Final implementation and CI corrections reviewed through P2; actionable findings resolved
Visual parity 40 before/after pairs, zero changed pixels or raster noise: 24 route/default states plus 16 populated board/plugin/portal/system states, desktop/mobile and light/dark
Chat interop regression proof Standalone identity browser2/2 (failed before), icons6/6, messages97/97, disclosure browser6/6; corrected the new caller's registration import and preserved fallback rendering without a provider
Local UI type check pnpm tsgo:ui passed under the updated post-Testbox worker rules; final JSX fix verified
Full types, UI suites, E2E Exact-head run 38173142445: all UI units, scheduled E2E, production/test types, and lint pass. Only an independently reproduced baseline Node inventory assertion fails; native inherited-failure landing evidence prepared.
Build / strict performance Same-machine base/head builds pass (13.24s/13.86s). Startup JS 421,365 → 421,364 gzip B (-1 B), 8 requests unchanged; CSS 50,124 B / 2 requests unchanged. Both strict runs fail only the inherited chat-boot request count (36 vs 35).
Testbox / host limits Initial lease stopped; frozen-source retry did not admit within 15 minutes. No task-owned lease remains. No local full suites, tsgo, Docker, or OrbStack. Local Bun could not collect with this Mac's runtime; pinned Linux CI owns Bun proof.

The 24 route pairs compare baseline 04647ea6 with the port. The 16 populated pairs compare f2e649da with candidate 5347f37f; later product changes retain board error feedback across unchanged recovery and restore terminal viewport activation; both have focused regression proof. Board capture checks actual loaded frames, reordered positions, iframe identity and retained input before taking the image. Iframe captures use explicit content/font/visibility/stable-bounds readiness because the general still-frame observer did not settle in the sandboxed frames. Every uploaded image is inspected and synthetic-only.

The activity browser test independently failed all four cases on pristine CI baseline ab6c07f5: it inspected a detached Retry button after the feedback branch replaced it. The live button was correctly disabled and the retry started. Main independently landed the same live-button repair, with direct completion promises; this PR takes main's exact test (4/4, 4.26s wall), retaining its loading/error/recovery checks. Baseline command: pnpm test ui/src/pages/activity/session-activity-view.browser.test.ts --maxWorkers=1, 3.76s wall (2.10s Vitest).

Size and accepted tradeoff

Physical lines across changed files against integrated baseline ed684fc7:

Category Before After Delta
Production UI 10,613 12,203 +1,590
Tests and test support 13,629 14,055 +426
Tooling and baselines 5,647 5,650 +3
Documentation 640 640 0

Production remains larger than the replaced Lit code. Growth is explicit typed bridge properties, JSX bindings, and retained-view/async teardown handling previously hidden in element lifecycle methods. Simplification removed duplicate plugin rendering, redundant board maps and preload state, and every replaced Lit class. The existing board interaction class moved into a sibling file to meet the line cap. No dependency, new store, or plugin SDK change.

As on main, rapidly switching targets A → B → A on one connection may briefly show an earlier display-read result; that refreshable display case is accepted instead of adding more request generations. Gateway replacement and detached-view authority remain guarded.

Before / after

Populated-state comparison sheets show the loaded board, native plugin, portal iframe, and selected-system details. Route/default-state sheets follow.

Dashboard before and after: desktop and mobile, light and dark

Dashboards before and after: desktop and mobile, light and dark

Workboard before and after: desktop and mobile, light and dark

Plugin route before and after: desktop and mobile, light and dark

Portals before and after: desktop and mobile, light and dark

Systems before and after: desktop and mobile, light and dark

Review disposition: the resolver-only frame finding was declined after the existing direct-element regression passed unchanged (1/1, 3.94s). Every bridge property observes the shared revision, so changing only the resolver wakes the frame update effect; the iframe is retained. No speculative dependency was added.

Final CI disposition: run 38173142445 tested head 337bea708f613301aaa9067c74978f4b4015e6e3 in merge a9d6e044f6a55fc3e765dec5c4300e7ec928e8db over baseline 4b7b100b48210ed5bd751b6bf83d5e81b7375761. The sole root failure is test/scripts/ci-node-test-plan.test.ts / “keeps host-owned database consumers in forks and out of their former projects”: its database-worker list still names deleted src/auto-reply/reply/get-reply.maintenance-conflict.test.ts. The exact case fails on that pristine baseline too (8.57s wall), and all eight relevant source inputs match the tested merge. No job was rerun. The CI aggregate fails only because of that root; all other jobs are terminal. Landing uses the native inherited-failure/admin route.

CI cost evidence: UI unit shards 947 runner-seconds total; scheduled UI E2E shards 971 runner-seconds total. These run in parallel; wall time from CI creation to completion was 587 seconds.

# Conflicts:
#	ui/src/app/shell-layout-traits.ts
#	ui/src/pages/plugin/plugin-page.test.ts
#	ui/src/plugins/control-ui-view.runtime.ts
@clawsweeper

clawsweeper Bot commented Oct 11, 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 docs Improvements or additions to documentation app: web-ui App: web-ui scripts Repository scripts size: XL labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR replaces Lit rendering for boards, dashboards, plugin views, Portals, and Systems with Solid 2.

Example: Reorder two loaded dashboard widgets containing an unsent draft.

  • Before: Lit renders the widgets and retains their iframe state.
  • After: Solid renders the widgets while preserving iframe identity and draft state.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful migration with inspected visual evidence, one unresolved P2 regression, and incomplete validation of the rewritten authority boundary.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Users should retain existing page appearance, widget drafts, iframe identity, and interactions throughout the Solid migration.
Reason: The maintainer-directed migration replaces the registered Lit implementations and preserves existing domain and SDK owners without new settings or storage.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep this PR open: the maintainer-directed migration remains distinct work, but the prior board translation regression is unresolved.

Priority: P2
Reviewed head: 337bea708f613301aaa9067c74978f4b4015e6e3

Before merge

  • Add real behavior proof - Authority-chain proof required: supply redacted browser logs or a diagnostic recording showing an active native-plugin request succeeding and retained handles rejected before Gateway I/O after session reassignment, view removal, and registration replacement, including delayed invocation after retirement; screenshots support visual parity, while the inspected retirement tests mock the request boundary. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Use reactive translations throughout the ported board renderers (P2) - This prior finding remains unresolved: changing the UI language while a pending widget is mounted leaves “Needs approval,” its action labels, and widget menu text in the previous language. These components import t from i18n/index.ts, which reads plain state without subscribing to locale changes; the replaced Lit parent supplied that subscription through I18nController. Use lib/reactive/i18n.ts in board-widget-capabilities.solid.tsx, board-widget-cell-render.solid.tsx, board-widget-cell.solid.tsx, board-mcp-app-content.tsx, board-document.tsx, and the frame's JSX translation expressions.
  • Resolve security review attention item - Native-plugin handle retirement needs final-effect validation; no concrete authorization bypass was established.
  • Resolve merge risk - The rewritten native-plugin lifecycle must preserve revocation of retained operator-authority handles across session reassignment, registration replacement, and view removal.
  • Explain or restore the original intent of Board locale refresh - unknown: The replaced Lit elements inherit automatic locale refresh from OpenClawLitElement; file history was inspected, but the original subscription's introduction was not established.

Findings

  • [P2] Use reactive translations throughout the ported board renderers — ui/src/components/board/board-widget-capabilities.solid.tsx:3

Provenance

  • Board locale refresh changes intended behavior without addressing why it exists (unknown: The replaced Lit elements inherit automatic locale refresh from OpenClawLitElement; file history was inspected, but the original subscription's introduction was not established.)

Tests

  • Missing end-to-end proof: Missing a browser/Gateway trace showing allowed native-plugin I/O and rejection of retained handles after reassignment, removal, and registration replacement.
Agent review details

How this fits together

The Control UI consumes Gateway state and plugin registrations, renders browser pages, and routes interactions through existing domain and SDK owners.

flowchart TD
  A[Gateway state] --> B[Domain owners]
  B --> C[Reactive projections]
  C --> D[Solid bridge and views]
  D --> E[Browser DOM and frames]
  E --> F[Scoped plugin host]
  F --> A
Loading

Technical review

Best possible solution:

Complete the existing Solid cutover while restoring reactive board translations and preserving the established plugin retirement boundary.

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

Source establishes the locale regression: mount a pending board widget in English, then change language; nonreactive translation expressions retain English labels despite the locale notification.

Is this the best way to solve the issue?

The bridge-based cutover follows the existing migration architecture, but the board renderers must consume the shared reactive translation adapter.

Full review comments:

  • [P2] Use reactive translations throughout the ported board renderers — ui/src/components/board/board-widget-capabilities.solid.tsx:3
    This prior finding remains unresolved: changing the UI language while a pending widget is mounted leaves “Needs approval,” its action labels, and widget menu text in the previous language. These components import t from i18n/index.ts, which reads plain state without subscribing to locale changes; the replaced Lit parent supplied that subscription through I18nController. Use lib/reactive/i18n.ts in board-widget-capabilities.solid.tsx, board-widget-cell-render.solid.tsx, board-widget-cell.solid.tsx, board-mcp-app-content.tsx, board-document.tsx, and the frame's JSX translation expressions.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Validate the retained-handle boundary (recommended)
    Demonstrate that current native-plugin operations succeed and retired handles cannot reach Gateway effects through the rewritten lifecycle.
  2. Pause the migration
    Keep the existing Lit implementation until the native-plugin retirement boundary can be validated.

Provenance checked

  • Board rendering and retained widgets keeps the original intent (8a66aa7: Provide the session-dashboard grid, tabs, widget cells, and interaction engine; later retention fixes preserve loaded documents across view changes.)
  • Native plugin views keeps the original intent (6a97159: Expose experimental native UI through a shared SDK while retaining core identity, send admission, and handle retirement.)
  • External plugin-frame authentication keeps the original intent (efa8075: Use scoped frame grants and a browser probe to render authenticated plugin tabs without exposing the shared bearer token.)

Testing

Proof path: shipped entry point.

Security

Needs attention: Native-plugin handle retirement needs final-effect validation; no concrete authorization bypass was established.

Evidence

What I checked:

  • Pinned change and current main: The introduced comparison contains the Solid migration; fetched main still implements the board view as a Lit element. Live REST confirms the reviewed head remains open and mergeable. (ui/src/components/board/board-view.ts:58, 072f977edd46)
  • Unresolved translation regression: The new capabilities renderer imports nonreactive t. Its replaced Lit parent inherited automatic locale refresh, whereas the Solid translation adapter explicitly subscribes to locale changes. (ui/src/components/board/board-widget-capabilities.solid.tsx:3, 337bea708f61)
  • Standalone fallback corrected: PluginViewContent now uses useOptionalApplication and renders the built-in fallback when no plugin registration exists, addressing the prior application-context finding. (ui/src/plugins/control-ui-view.solid.tsx:87, 337bea708f61)
  • Authority boundary: The port intercepts session and registration transitions synchronously, aborts mounted scopes, and checks connectivity before forwarding retained host requests; the inspected tests substitute a mocked request function. (ui/src/plugins/control-ui-view.solid.tsx:129, 337bea708f61)
  • Existing plugin trust contract: feat: add experimental plugin UI customization #134943 explicitly accepts trusted same-origin native modules sharing the operator's authority, while requiring retired view and connection handles to be revoked. (ui/src/plugins/control-ui-host.ts:136, 6a97159ececb)
  • Visual evidence inspected: Four prepared before/after sheets show matching desktop/mobile and light/dark route layouts. The populated-state comment supplies additional screenshots, but those attachments were unavailable through the browser reader with Cache miss; that inspection limit is not a contributor defect. (337bea708f61)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth Production UI net +1,590 LOC; tests/support net +426 LOC Verified against the pinned introduced diff; the body explains typed bridge bindings and retained-view teardown growth as an accepted migration tradeoff.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a substantial planned UI migration with a bounded language-switch regression.
  • merge-risk: 🚨 security-boundary: The port rewrites the lifetime machinery controlling retained native-plugin handles with operator-wide Gateway authority.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add final-effect proof showing current native-plugin requests succeed and retired handles are rejected before Gateway I/O; redact IPs, API keys, phone numbers, and non-public endpoints.

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.

History

Review history (16 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-11T14:12:13.136Z sha 7fa0c16 :: needs real behavior proof before merge. :: [P2] Use reactive translations in every ported board renderer
  • reviewed 2026-10-11T15:13:59.342Z sha 7f8b8ee :: needs real behavior proof before merge. :: [P2] Use reactive translations in every ported board renderer
  • reviewed 2026-10-11T15:36:48.634Z sha 601dd04 :: needs real behavior proof before merge. :: [P2] Use reactive translations in every ported board renderer
  • reviewed 2026-10-11T16:36:04.321Z sha 6310dca :: needs real behavior proof before merge. :: [P2] Use reactive translations throughout the ported board renderers
  • reviewed 2026-10-11T16:49:39.963Z sha abf4d18 :: needs real behavior proof before merge. :: [P2] Use reactive translations throughout the ported board renderers
  • reviewed 2026-10-11T17:55:53.063Z sha 7ee82b0 :: needs real behavior proof before merge. :: [P2] Use reactive translations throughout the ported board renderers
  • reviewed 2026-10-11T19:27:12.160Z sha 4917d29 :: needs real behavior proof before merge. :: [P2] Use reactive translations throughout the ported board renderers
  • reviewed 2026-10-11T20:06:55.911Z sha c0b7760 :: needs real behavior proof before merge. :: [P2] Use reactive translations throughout the ported board renderers | [P2] Preserve built-in plugin-view rendering without application context

Reviewed October 11, 2026, 4:53 PM ET / 20:53 UTC (Revision 17).

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 11, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Additional populated-state visual proof: 16 before/after pairs across desktop/mobile and light/dark, with zero changed or raster-noise pixels. The board capture verifies loaded widget content, reordered visual positions, stable iframe identity and retained draft text. Native plugin completion, the portal preview and selected-system details are also covered. All media is inspected synthetic data.

Baseline: f2e649d. Candidate: 5347f37. The subsequent merge at 1c00334 changed only a dashboard test in this port's product scope.

Loaded board before and after with retained iframe draft

Native plugin before and after

Loaded portal before and after

Selected system before and after

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 docs Improvements or additions to documentation merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant