Skip to content

refactor(ui): port the chat composer to Solid - #168779

Merged
steipete merged 46 commits into
mainfrom
solid2/w-chat-5
Oct 12, 2026
Merged

steipete merged 46 commits into
mainfrom
solid2/w-chat-5

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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

Check Result
Final-head types, lint, ratchets, UI unit shards All passed on ba100ae3d2dfe0991aff094dbaf5c9382dcac63c, including all three UI unit shards
Final-head UI E2E Shards 1, 2, 3, 5, 6 passed in ordinary CI; shard 4 had one sidebar-roster failure (424 passed). Cancelled shards 7 and 8 passed in exact-source supplemental CI (439 and 373 tests)
Sidebar-roster comparison 3/3 passed on both the exact CI merge and its main parent; the ordinary CI failure did not reproduce
Final exact-head retention / IME / undo / context 48 passed across seven files
Final exact-head chat/transcript performance gates 29 passed across four E2E files
Home / pointer / queue / goal repair proof 39 E2E + 28 unit tests passed against the exact reviewed patch; 20 prior head-only failures resolved
Queued-edit regression Old renderer fails the new assertion; fixed renderer passes all 16 queue tests (1.44s Vitest / 2.24s wrapper); native input acknowledgement performs zero setter writes
Queue navigation/update/eviction recovery 13/13 pass, 62.36s; earlier pinned main 13/13 versus pre-fix head 3/13
Native input, IME, stale scope, pending dictation, permission retention 5 passed locally (4.81s runner)
Optional model lifecycle / effort previews 8 / 2 passed; both regressions reproduced before their fixes
Emoji / menus / attachment progress / mentions 22 / 2 / 7 / 67 passed locally
Three WeakRef suites plus native IME/undo 34 passed remotely (20s)
Composer/browser regressions 256 head and 256 base passed (19s each)
Chat/transcript/instant-thread gates 29 head and 29 base passed (80s / 71s)
Visual parity 16 base/head pairs, zero changed pixels; photo and queue-recovery pairs also inspected
Boot manifest Regenerated on the integrated source, then verified unchanged after the fix; SHA-256 462f19f2fbe732827cb45f032c71e843eb47ed39ac16e1e8bdac0ceddd3fabb3
Independent autoreview No actionable P0/P1 findings; repeated for fixes and merge resolutions

The ordinary final-head CI tested merge cc4a9fd12ddb9ad4bca7e0f42081ece03b82a681 with main parent d806e9258bcd0bfc5ac85f43eeffc3dabdd21e4b. 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.

State Before After
Conversation, desktop light Before After
Empty composer, desktop dark Before After
Long model list, desktop light Before After
Permission menu, mobile dark Before After
Native photo selection, opening menu Before After
Queued edit after navigation Before After
Home progress after asynchronous load Before After

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.

@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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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 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.

  • Before: The Lit composer preserves the native textarea and unfinished composition.
  • After: The Solid composer preserves the same input behavior through retained components.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong inspected visual proof supports a useful migration, but two verified P2 findings still block approval.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected browser captures show the migrated composer in desktop conversation and empty states; linked source-pinned retention, IME, undo, and chat gates support the interaction claims.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No intended appearance or interaction change; chat and New Session must retain drafts, focus, menus, and controls during the renderer migration.
Reason: The maintainer-authored migration follows explicit repository direction and shares the new renderers across both composers without replacing domain owners.

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
Reviewed head: ba100ae3d2dfe0991aff094dbaf5c9382dcac63c

Before merge

  • Use the reactive translator throughout migrated presentation (P2) - When locale publication occurs while the permission picker remains mounted, its heading and Learn more label stay in the previous language. The plain I18nManager translator registers no Solid dependency, and these expressions read no props, so even a parent refresh cannot invalidate them. Other migrated components use the same import. Use the existing translator from lib/reactive/i18n.ts in Solid presentation and cover locale publication while retaining draft, focus, and controls. This previously reported finding remains unresolved.
  • Complete the suggestion-renderer ownership cutover (P2) - Production suggestion menus now use this Solid renderer, but the overflow case in chat-composer-overflow.browser.test.tsx and the hover case in menu-surface.browser.test.ts still import the old Lit renderers from components/composer-menu.ts. Those checks can pass when the shipped Solid menu's overflow or hover behavior regresses, and they keep a second, test-only presentation implementation alive contrary to the required complete cutover. Move those cases to the Solid renderer, retain keyboard navigation as a shared plain TypeScript helper, and remove the obsolete Lit rendering functions. This previously reported finding remains unresolved.

Findings

  • [P2] Use the reactive translator throughout migrated presentation — ui/src/pages/chat/components/chat-permission-picker.tsx:4
  • [P2] Complete the suggestion-renderer ownership cutover — ui/src/pages/chat/components/chat-composer-menu.tsx:5-7
Agent review details

How this fits together

The 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
Loading

Technical review

Best 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:

  • [P2] Use the reactive translator throughout migrated presentation — ui/src/pages/chat/components/chat-permission-picker.tsx:4
    When locale publication occurs while the permission picker remains mounted, its heading and Learn more label stay in the previous language. The plain I18nManager translator registers no Solid dependency, and these expressions read no props, so even a parent refresh cannot invalidate them. Other migrated components use the same import. Use the existing translator from lib/reactive/i18n.ts in Solid presentation and cover locale publication while retaining draft, focus, and controls. This previously reported finding remains unresolved.
    Confidence: 0.99
  • [P2] Complete the suggestion-renderer ownership cutover — ui/src/pages/chat/components/chat-composer-menu.tsx:5-7
    Production suggestion menus now use this Solid renderer, but the overflow case in chat-composer-overflow.browser.test.tsx and the hover case in menu-surface.browser.test.ts still import the old Lit renderers from components/composer-menu.ts. Those checks can pass when the shipped Solid menu's overflow or hover behavior regresses, and they keep a second, test-only presentation implementation alive contrary to the required complete cutover. Move those cases to the Solid renderer, retain keyboard navigation as a shared plain TypeScript helper, and remove the obsolete Lit rendering functions. This previously reported finding remains unresolved.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1f8307fe90a9.

Provenance checked

  • Composer state and presentation keeps the original intent (049a178: The earlier composer split separated interaction state and presentation; this PR keeps synchronous owners while replacing rendering.)
  • Multiline composer and attached queue keeps the original intent (64853b1: The multiline restructure preserved composer interaction and permission contracts; the Solid port retains their existing callbacks and layout.)
  • Shared suggestion presentation keeps the original intent (caec9c8: One shared renderer was established for listbox presentation, navigation, and accessibility; production moves together, but obsolete test rendering remains.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/pages/chat/chat-composer-solid.test.tsx --maxWorkers=1
  • pnpm test ui/src/pages/chat/components/chat-composer-menu.test.tsx --maxWorkers=1
  • pnpm test ui/src/pages/chat/chat-composer-overflow.browser.test.tsx --maxWorkers=1
  • pnpm test ui/src/components/menu-surface.browser.test.ts --maxWorkers=1
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 049a178 adds ui/src/pages/chat/components/chat-composer.ts:37 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 049a17860c5b; files: ui/src/pages/chat/components/chat-composer.ts)
  • Vyctor H. Brzezowski: Raw commit 64853b1 adds ui/src/pages/chat/components/chat-composer.ts:88 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 64853b1a9d50; files: ui/src/pages/chat/components/chat-composer.ts)
  • Jason (Json): Raw commit d579e4f adds ui/src/pages/chat/components/chat-composer.ts:103 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: d579e4f0f301; files: ui/src/pages/chat/components/chat-composer.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This planned UI migration has localized translation and coverage defects, without evidence of an urgent production outage.
  • 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.

History

Review history (32 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-11T17:21:40.299Z sha eba4210 :: needs changes before merge. :: [P2] Use the reactive translator throughout migrated presentation | [P2] Complete the suggestion-renderer ownership cutover | [P2] Make nested adapter property commits safe in Solid renders
  • reviewed 2026-10-11T17:46:38.674Z sha c6b2458 :: needs changes before merge. :: [P2] Use the reactive translator throughout migrated presentation | [P2] Complete the suggestion-renderer ownership cutover
  • reviewed 2026-10-11T18:25:13.919Z sha 07ef3a5 :: blocked before merge. :: [P2] Use the reactive translator throughout migrated presentation | [P2] Complete the suggestion-renderer ownership cutover
  • reviewed 2026-10-11T19:34:24.520Z sha 1975f20 :: blocked before merge. :: [P2] Use the reactive translator throughout migrated presentation | [P2] Complete the suggestion-renderer ownership cutover
  • reviewed 2026-10-11T20:10:18.384Z sha 7f9567a :: needs changes before merge. :: [P2] Use the reactive translator throughout migrated presentation | [P2] Complete the suggestion-renderer ownership cutover
  • reviewed 2026-10-11T23:23:10.465Z sha b56b879 :: needs changes before merge. :: [P2] Use the reactive translator throughout migrated presentation | [P2] Complete the suggestion-renderer ownership cutover
  • reviewed 2026-10-11T23:48:16.932Z sha d103e26 :: needs changes before merge. :: [P2] Use the reactive translator throughout migrated presentation | [P2] Complete the suggestion-renderer ownership cutover
  • reviewed 2026-10-12T00:27:40.899Z sha d103e26 :: needs changes before merge. :: [P2] Use the reactive translator throughout migrated presentation | [P2] Complete the suggestion-renderer ownership cutover

Reviewed October 11, 2026, 9:51 PM ET / October 12, 2026, 01:51 UTC (Revision 33).

@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
@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 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
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
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.
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 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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