Skip to content

refactor(ui): migrate chat leaf elements to Solid - #168762

Merged
steipete merged 18 commits into
mainfrom
solid2/w-chat-2
Oct 11, 2026
Merged

steipete merged 18 commits into
mainfrom
solid2/w-chat-2

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat leaf elements still use Lit rendering and lifecycle hooks during the Control UI's Solid 2 migration. This ports 24 registered leaves to Solid while preserving custom-element tags, CSS classes, selectors, media controls, questions, comments, and embedded panels. Remaining Lit callers use the shared bridge; stateless Lit helpers remain for their unported callers. Domain owners stay plain TypeScript.

The bridge mounts Solid-owned children without a nested top-level render/flush, preserving inherited contexts. Teardown releases resources without publishing into retiring views. File selection and runtime facts are prepared together before rendering; editor initialization follows the retained Lit DOM commit. Question resource previews use the lazy Solid component entry point so they inherit the application provider.

Regression repairs preserve typed-input focus, inactive file identity, scoped media requests, comment editor lifetime, and progress-menu clicks inside the retained Lit summary. Tests now exercise public bridge properties and observable DOM instead of removed Lit methods. Custom-element declarations live with their element owners so core test-type stripes see them without pulling chat renderers into the shared SDK type entry point.

Evidence

Check Result
Current repair: file editor browser behavior 20/20; 10.59s command wall time after the final merge
Current repair: text preview browser behavior 6/6; 7.26s
Current repair: Details browser actions 5/5; 5.73s after explicit dependency pre-optimization
Current repair: camera attachment inputs 6/6; 4.52s
Current repair: steer ordering / async questions 2/2 and 6/6; 7.35s and 10.01s
Current repair: sidebar behavior 30/30; 6.75s
MCP preview context regression 1/1; 5.72s after the final merge. Old source fails with the missing-context error; fixed source reaches the real view request and presents its controlled error.
Earlier focused owner proof, retained source Questions 21/21; bridge 18/18; camera 20/20; browser cards 44/44; audio 17/17; media source 12/12; text 38/38; Details 4/4; automations 8/8; files 26/26; MCP teardown 4/4; comments 9/9
Focused formatting, syntax lint, whitespace Passing
Independent review Full candidate and subsequent focused change reviewed; no accepted/actionable P0/P1 findings
Required CI Passed on c7c674c8c9e485b0bc72472f199157a528ef5f45: production/test types, lint, baseline ratchets, all 3 UI unit shards and all selected UI E2E shards. Aggregate gate is red only for the inherited duplicate-scan coverage failure below.
Hosted visual proof Baseline a17bd679979e1dc69bba795222c5dce5da750815 and rendered candidate 3970de999f9120c824f6a73fbfce515bd1aa1e10 passed; the final type/callback and adapter-option merges preserve the captured appearance

Previous CI exposed assertion allowances, direct Lit imports, type-only import cycles, JSX contracts, lifecycle errors, and obsolete fixtures. Those failures were repaired. The latest repair also addresses all four concrete findings in the existing ClawSweeper review. Local Vite runs exposed cold dependency discovery reloads in the testing library and editor language packages. Explicit pre-optimization removes those reloads; the resulting five Details and twenty editor tests pass. The MCP context regression preloads the real view module before the timed interaction so it measures context forwarding, independently of cold dev transforms.

One Testbox attempt admitted but failed before parity rendering because its temporary baseline checkout lacked the Workboard dependency link. Lease tbx_01m4kw59c09mk3876q4mf03hve is stopped. No local Docker, whole-suite, typecheck, build, or E2E run was used; hosted CI supplies the heavier checks. The per-PR ci:no-fail-fast label collects all selected results without relaxing any check.

Prior CI on 3970de999f9120c824f6a73fbfce515bd1aa1e10 passed production types, baseline ratchets, and both selected UI E2E shards. Its remaining lane-owned failures were the detail-panel host declaration and unbound invalidation callback; both are fixed. The dashboard route mismatch reproduced on the exact merge base under Node and Bun (expected compact, owner used dashboard) and is fixed by the newly integrated main commit 11a1569887f43. Four unhandled wa-tooltip popup errors occurred after all 7,084 assertions in UI shard 2 passed. The unchanged tooltip test/helper/owner pass 8/8 alone on base and branch under Node/Bun, so that earlier failure is recorded as unreproduced, not claimed fixed or inherited. Current exact-head UI/type/lint CI is green, with no repeat of those tooltip errors.

The sole current source-check failure is inherited from CI's actual merge base 0690a2ef175fc73d69d73105638b69a90af35fe6. CI checked merge commit 31721ce6 (that base plus this PR): check-guards reports worker-heap-flag.mjs outside duplicate-scan coverage. The file exists on that base, and the scanner is byte-identical to this branch. Running the owning failure path, node scripts/check-duplicates.mjs --coverage, on the exact base reproduces the identical failure in 0.32s. No scan baseline, threshold, or ignore was weakened. Aggressive landing per Peter uses the inherited-failure exception for check-guards and its aggregate gate.

Screenshots

Visual proof: baseline a17bd679979e1dc69bba795222c5dce5da750815 → candidate 3970de999f9120c824f6a73fbfce515bd1aa1e10.

Both hosted runs passed; all captures were inspected and contain only synthetic data. The later host-type declaration and bound callback preserve this appearance. Details, welcome controls, side-chat placement, and composer geometry remain intact. Spinner wording and caret timing vary between captures.

State Before After
chat Before chat After chat
side-chat Before side-chat After side-chat
side-chat-closed Before side-chat-closed After side-chat-closed
welcome Before welcome After welcome

Hosted runs: https://github.com/openclaw/openclaw/actions/runs/38135560665 and https://github.com/openclaw/openclaw/actions/runs/38136249346.

Size

Production files in this diff: 17,701 → 18,580 LOC (+879). Tests/support: 17,471 → 17,782 LOC (+311). Counts include both sides of renamed files. Growth is primarily explicit bridge property contracts and render/disposal boundaries. The port removes 24 Lit registrations, 154 templates, 115 property decorators, and four leaf shadow-style templates, with no pending-conversion markers.

Replace 24 Lit element owners with Solid bridges while preserving existing tags, class names, callers, and domain owners. Keep stateless Lit helpers for the remaining rendering consumers and use the shared Solid commit lifecycle for editor and MCP retirement.\n\nWork in progress: depends on the shared Solid bridge/icon prerequisite landing; runtime and visual proof remain pending. Focused lint, stylesheet lint, and independent review completed.
Use keyed request scopes, explicit imperative snapshots, direct Solid bridge components, and shared application-context fixtures. Keep media recovery state across presentation updates and dispose replaced player nodes and observers with their rendering scope.

Question and audio suites pass. The final Details fixture awaits CI after a local worker exit before assertions. Independent review and focused lint pass.
@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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR migrates 24 chat leaf elements from Lit to Solid while retaining their tags, controls, and domain owners.

Example: Open a chat and its Ask OpenClaw side chat.

  • Before: Lit-backed leaves display the conversation controls and composer.
  • After: Solid-backed leaves preserve the inspected layout and controls.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent, maintainer-directed migration with inspected visual evidence and no remaining concrete finding; unresolved CI still prevents landing.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected synthetic Control UI chat and side-chat before/after captures demonstrate preserved visible rendering; subsequent adapter changes retain the captured host shape, while editor and resource-preview interaction coverage remains test-based.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-authored direction matches the approved Solid migration and retains existing user behavior through one shared interop boundary.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it advances the approved Solid migration, preserves existing component ownership, and resolves the previously identified repairs; no additional concrete code defect was found.

Priority: P2
Reviewed head: c7c674c8c9e485b0bc72472f199157a528ef5f45

Before merge

  • Complete next step - Inspect the failed check-guards job diagnostic and establish whether it requires a PR repair or has verified outside-cause evidence.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied browser captures do not exercise file editing or MCP resource-preview interaction; extending the comparison would strengthen coverage beyond the reported tests.
Agent review details

How this fits together

Chat leaves consume pane properties and application capabilities, render browser DOM, and send actions back to existing controllers and Gateway owners.

flowchart TD
  A[Chat pane properties] --> B[Shared element bridge]
  C[Application capabilities] --> B
  B --> D[Solid chat leaves]
  D --> E[Browser DOM]
  D --> F[Existing action owners]
Loading

Technical review

Best possible solution:

Finish the shared-bridge migration while preserving existing chat interactions, resource lifetimes, and domain authority.

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

This is a renderer migration rather than a new bug report; review used source comparisons and supplied browser evidence without executing target code.

Is this the best way to solve the issue?

The existing bridge provides a coherent migration path: replaced Lit classes are removed, remaining callers share the Solid implementation, and plain TypeScript owners retain their responsibilities.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared custom-element bridge keeps the original intent (eca633a: Allow Solid presentation components and remaining Lit callers to share one registered implementation while preserving tags, properties, contexts, and lifecycle.)
  • Chat side-panel rendering keeps the original intent (029f6c1: Separate side-panel responsibilities along cohesive seams while preserving their existing behavior.)
  • MCP app retirement keeps the original intent (7d62a27: Keep outgoing app DOM connected until bounded teardown completes, then restart only surviving views.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned migration and current main: The introduced comparison replaces Lit registrations with Solid implementations; fetched main still contains the corresponding Lit owners and the shared bridge prerequisite. (ui/src/lit/solid-bridge.ts:49, c7c674c8c9e4)
  • Prior lifecycle repairs retained: The detail panel initializes its editor after the Lit adapter commits, disposes its controllers, and resource previews load the Solid MCP component entry point. (ui/src/pages/chat/components/chat-detail-panel.tsx:712, c7c674c8c9e4)
  • Inspected visual evidence: Downloaded before/after chat and side-chat screenshots preserve visible layout, controls, and composer geometry. The supplied captures compare baseline a17bd67 with candidate 3970de9; subsequent adapter changes preserve the default host shape. (3970de999f91)
  • Earlier conflict resolved: GitHub reports mergeable=true for the reviewed head, so the previous review's conflict request no longer applies. (c7c674c8c9e4)
  • Required CI remains unresolved: The check-guards job failed in Run independent checks, while several UI and test-type checks remained running. Its annotation supplies only exit code 1; the log redirect to productionresultssa4.blob.core.windows.net was blocked by the host allowlist, preventing attribution. (c7c674c8c9e4)
  • Intent and related work: The shared bridge prerequisite at refactor(ui): share presentation primitives across Solid and Lit #168576 establishes one implementation per registered tag. The separate transcript migration at refactor(ui): migrate chat transcript rows to Solid 2 #168887 owns rows and streaming rather than replacing this leaf migration. (ui/src/lit/solid-bridge.md:3, c7c674c8c9e4)

Likely related people:

  • Peter Steinberger: Raw commit eca633a adds ui/src/lit/solid-bridge.ts:41 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: eca633a8801b; files: ui/src/lit/solid-bridge.ts)
  • Jason (Json): Raw commit 7d62a27 adds ui/src/components/mcp-app-unmount.ts:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 7d62a277fffe; files: ui/src/components/mcp-app-unmount.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: An approved internal UI migration with meaningful lifecycle coverage warrants normal priority.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • 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.

Rank-up moves

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

  • Extend the existing browser comparison to file-editor and MCP resource-preview interactions.

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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-11T04:25:22.409Z sha 36d8a0c :: needs changes before merge. :: [P2] Migrate the remaining camera attachment-input fixtures | [P2] Replace the retired detail-panel update call in the browser fixture
  • reviewed 2026-10-11T04:34:54.373Z sha 36d8a0c :: needs changes before merge. :: [P2] Migrate the remaining camera attachment-input fixtures | [P2] Replace the retired detail-panel update call in the browser fixture
  • reviewed 2026-10-11T05:00:38.986Z sha 9545bfb :: needs changes before merge. :: [P2] Migrate the remaining camera attachment-input fixtures | [P2] Replace the retired detail-panel update call in the browser fixture
  • reviewed 2026-10-11T09:22:54.894Z sha 4ccbcab :: needs changes before merge. :: [P2] Migrate the remaining camera attachment-input fixtures | [P2] Replace the retired detail-panel update call in the browser fixture
  • reviewed 2026-10-11T10:22:54.946Z sha 41518dc :: needs changes before merge. :: [P2] Migrate the remaining camera attachment-input fixtures | [P2] Migrate detail-panel fixtures away from requestUpdate | [P2] Initialize the file editor after the Lit adapter commits | [P2] Render MCP previews through their Solid component entry point
  • reviewed 2026-10-11T11:26:57.088Z sha c66a77f :: needs changes before merge. :: none
  • reviewed 2026-10-11T11:43:07.012Z sha 3970de9 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-11T12:11:09.656Z sha 8b116d2 :: needs changes before merge. :: none

Reviewed October 11, 2026, 8:36 AM ET / 12:36 UTC (Revision 13).

@steipete

Copy link
Copy Markdown
Contributor Author

Inspected synthetic chat captures: before at merge base 6b8e69e47076, after at 7d9b384274d5. The later b076fde5936 follow-up replaces initializer casts with explicit types and preserves rendering behavior. Layout is preserved; the rotating working phrase and caret differ between captures.

Hosted browser flows passed for both captures: before, after. The remaining component and retention proof is running in the PR's UI CI shards.

Before — synthetic chat at the merge base

After — synthetic chat with Solid leaf elements

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 11, 2026
@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Oct 11, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 11, 2026
@steipete steipete added the ci:no-fail-fast Keep all selected CI matrix jobs running after failures on the next PR run. label Oct 11, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 11, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 11, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
Migrate 24 registered chat leaf elements from Lit to Solid while preserving custom-element tags, classes, selectors, and the existing question, media, comment, and panel behavior. Keep domain state owners unchanged and retain stateless Lit helpers behind the shared adapter.

Preserve nested Solid ownership in the custom-element bridge, initialize file editors after retained Lit content commits, retain inactive file identity and input focus, and render MCP previews through the Solid component entry point. Keep custom-element types with their owners and preserve in-place child adoption from main.

Validation: focused boundary regressions and independent review pass; all three UI unit shards, all selected UI E2E shards, production/test types, lint, architecture checks, and baseline ratchets pass on c7c674c. Inspected synthetic before/after screenshots are embedded in the PR. The duplicate-scan coverage failure reproduces on CI's exact base because worker-heap-flag.mjs is missing from its scan targets; landed under the authorized inherited-failure exception.
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 19, 2026
First-parent upstream 5ed6a30..cb1b6cd (21 commits, including
openclaw#168999 state query reduction and worker moves, openclaw#169075, af03aa0 ACP
owner settlement, openclaw#168837 plugin metadata/reload ownership, openclaw#168776,
openclaw#168951, openclaw#169039 runtime-only server builds, openclaw#169092 test batch d050,
openclaw#168860 memory index publication writes into workers, openclaw#168991 session
read lifetimes and reconciliation scheduling, openclaw#169091 tool/replay prompt
prefixes, openclaw#168762 Solid chat leaf elements, openclaw#168941).

Conflicts:
- test/vitest/vitest.unit-fast-paths.mjs: upstream stopped forcing the
  two ACP translator files into the fast lane; kept that and our
  reply-turn-admission module-identity entry.
- worker-access inventory: regenerated (634 files, 2429 calls).

openclaw-state-worker-contract.ts auto-merged: upstream's GitHub
publication-source operations next to our continuation custody operations.

Refs #1475

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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:no-fail-fast Keep all selected CI matrix jobs running after failures on the next PR run. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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