Repository navigation
refactor(ui): port the chat composer to Solid - #168779
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR ports the shared chat composer, suggestion menus, model controls, and recovery dialogs from Lit to Solid. Example: A user types “hello 日本語” while an assistant response updates.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: the approved Solid migration remains necessary, but both previously reported P2 findings remain unresolved. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherThe Control UI composer consumes session, draft, queue, and capability state from existing TypeScript owners and sends user actions through their existing callbacks. flowchart LR
A[Chat and New Session] --> B[Lit adapters]
B --> C[Solid composer]
D[TypeScript state owners] --> C
C --> E[Textarea menus and controls]
E --> F[Existing action callbacks]
F --> D
Technical reviewBest possible solution: Complete the Solid cutover with reactive translations and production-renderer coverage while preserving the existing TypeScript state owners. Do we have a high-confidence way to reproduce the issue? Source establishes the retained-component locale failure and obsolete-renderer test path at the reviewed head; no target code or tests were executed. Is this the best way to solve the issue? The renderer migration fits the approved UI direction and preserves domain ownership, but its translation dependency and suggestion-test cutover need the focused repairs listed below. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1f8307fe90a9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (32 earlier review cycles; latest 8 shown)
Reviewed October 11, 2026, 9:51 PM ET / October 12, 2026, 01:51 UTC (Revision 33). |
Scheduled main CI run 38197887998 failed six composer e2e tests: pasted text no longer became a chip, attached files never showed in the preview, and the Add MCP server dialog never opened. Solid 2.0.0-rc.14 (8d9dcf8) runs effect callbacks without an ambient owner and throws PRIMITIVE_IN_EFFECT_CALLBACK when one creates a root. That error halts the whole reactive system, so later composer updates are ignored. The composer port (openclaw#168779) landed afterwards with its own LitContent adapter, which re-renders opaque Lit content from a render effect callback. When that content holds a solidTemplate directive, the directive sees no owner, commits synchronously, and creates a root mid-effect. Restore the component owner around the effect-driven commit, as the shared adapter in ui/src/lit/solid-content.tsx already does. The directive then defers its mount to a microtask. The ref path stays unowned: it runs during render, and composer tests rely on its synchronous nested mount. Proof: the new LitContent regression fails without the fix with the production error and passes with it. 408 composer unit tests pass, and chat-pasted-text-show-in-text-field plus chat-composer-capability-menu e2e pass 20/20 (6 failed before). tsgo:ui, oxlint, and formatting pass. Codex autoreview (P2) is clean.
What Problem This Solves
Ports the Chat composer, invocation menus, model/effort/permission controls, and recovery dialog from Lit to Solid 2. Chat and New Session share the Solid renderers through the remaining Lit adapters; existing host tags, classes, selectors, and callbacks are preserved. Plain TypeScript owners retain draft, dictation, queue, and capability authority.
The textarea remains mounted, with equality-gated value updates preserving typing, IME, undo/redo, history recall, and native range previews. Home progress now owns its visibility and rendering in one component; pointer focus preservation runs at the native capture boundary, keyed queue moves retain their focused handle, and goal recovery uses snapshot-owned branches. Stable components retain permission controls, capability rows, emoji popup/anchor, mentions, and attachment tiles. Nested Lit commits schedule independent Solid roots outside component evaluation. Queued-edit recovery now consumes the owner's corrected draft after remount: diagnostics proved that the owner retained the text while the old seed-only renderer displayed the original.
Evidence
ba100ae3d2dfe0991aff094dbaf5c9382dcac63c, including all three UI unit shards462f19f2fbe732827cb45f032c71e843eb47ed39ac16e1e8bdac0ceddd3fabb3The ordinary final-head CI tested merge
cc4a9fd12ddb9ad4bca7e0f42081ece03b82a681with main parentd806e9258bcd0bfc5ac85f43eeffc3dabdd21e4b. The four-job closure tested these same source commits without product changes: the sidebar test passed on both head and base, and both cancelled E2E shards passed using the same 705-file selection, three workers, and eight shards. The aggregate CI gate remains red from the nonreproducing sidebar assertion; it is not reported as a green run.The final exact-head gates passed on
d103e26; the owner repair proof validated the exact seven-file patch before commit. The final focused recovery proof includes the failing old-renderer assertion, passing fixed tests, 13-case recovery suite, and manifest receipt. The original parity/gate proof completed all behavioral phases and 32 captures; its remaining failure was an unchanged base-only auxiliary gallery feedback test. Later main integrations supplied the reader, dashboard, and duplicate-scan repairs encountered during validation.Only single-file tests and focused lint ran locally. Heavy checks ran remotely; no local build, typecheck, E2E, Docker, or OrbStack. The sole Testbox lease is stopped; no replacement lease was created. The temporary proof workflow and ownership diagnostics are removed from the final diff. Separate evidence-only branch runs attribute inherited failures without changing this PR head.
Earlier main revisions exposed unrelated transcript, history, and provider-copy failures during paired validation. The current integrated head passes all UI unit shards. The sole remaining ordinary-CI failure is the sidebar-roster assertion documented above; both exact-source comparison runs pass. Security-sensitive review and security-fast also pass. Landing uses Peter's explicit aggressive-landing authority for the documented CI exception and advisory P2 review follow-ups.
Advisory P2 follow-ups from ClawSweeper are reactive translation reads in retained presentation and retirement of the old shared suggestion-rendering test helpers. The queue-loss, Home-progress, goal-lifetime, native-pointer, and merge-conflict findings are repaired in this head.
Screenshots
All images below were inspected and contain synthetic fixtures only. Initial pairs are pixel-identical. The photo pair verifies retained native selection focus; the queue pair verifies the corrected text after navigation.
Size and scope
Changed production TypeScript/TSX files under
ui/src, excluding tests and test helpers: 17,994 → 19,562 LOC (+1,568) across 91 files, comparing full old/new files with rename detection disabled. The growth is primarily temporary Lit adapters and explicit Solid input/component lifetimes. There is one composer implementation; the adapters disappear with the remaining Lit callers. No dependency, pin, configuration migration, or changelog changes are introduced by this lane.