Skip to content

refactor(ui): render the chat sidebar region with Solid - #169394

Merged
steipete merged 13 commits into
mainfrom
solid2/w-chat-7a
Oct 12, 2026
Merged

steipete merged 13 commits into
mainfrom
solid2/w-chat-7a

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Ports the chat sidebar region, detail content, file view, and editor menu from Lit rendering to Solid 2.

User Impact

No intended visual or behavioral change. Existing tags, classes, routes, keyboard controls, file drafts, and retained panel lifetimes remain intact. No dependency or configuration change.

Why This Change Was Made

The Solid region preserves the existing sibling outlet and the bridge used by the Lit chat pane. Keyed panel roots survive hiding and reordering; editor mounts and preview iframes retain their lifecycle boundaries. The header consumes the owned Solid tab strip, icons, and shortcut primitives, and Markdown uses the landed Solid renderer. Narrow legacy-content adapters remain for pane-supplied definitions and the HTML-preview controller. The region registration remains behind its existing lazy loader. Geometry reads and publication use the shared layout-frame scheduler from main.

The directly coupled checks now recognize the Solid divider owner and remove obsolete assertion/mock allowances.

Evidence

Proof Result
Codemod dry run Inspected each renderer; resolved lifecycle and keyed conversions
Region / hosted tabs 17 + 8 pass; 126.18 s / 36.73 s wall
Sidebar content / GitHub references 30 + 3 pass; 21.30 s / 15.99 s
File view / editor menu browser tests 20 + 3 pass; 34.99 s / 26.83 s
Scroll / RTL browser tests 4 + 4 pass; 19.33 s / 25.73 s
Pane / thread / snapshot retention suites 2 + 1 + 19 pass; 57.65 s / 11.81 s / 9.92 s
Layout owner / lazy failure / divider ownership 14 + 1 + 3 pass; 26.45 s / 25.22 s / 4.32 s
Integrated MCP unmount / view checks 4 + 27 pass; 11.06 s / 11.95 s
Final UI typecheck and base/head builds Pass
Final sidebar presentation / panel-contract E2E 6 + 11 pass; 37.49 s / 50.57 s
Final visual parity HTML preview and session diff, desktop light: 0 differing pixels
Targeted lint, i18n, whitespace, ownership ratchets Pass; Madge reports zero cycles
Independent review Clean after resolving reactive divider geometry

Times above are command wall times on the busy shared Mac; test execution itself remains short. Final same-machine startup comparison on merge base dc1c91230908f and the candidate: 410,610 → 410,620 B gzip (+10 B), with 2 startup CSS requests on both sides. Both strict checks report the identical inherited 36 chat boot requests against a 35-request limit; startup bytes stay below the authorized 450,000 B transition budget. Earlier Testbox proof passed; the last lease did not admit within ten minutes, so the final bounded checks ran locally under the migration fallback.

Sidebar production LOC, including shared types: 1,885 → 2,084 (+199). The increase covers explicit JSX, typed props, and the sibling-render lifecycle; the header is split to stay within the file-size limit.

Full CI passed for the exact published head: https://github.com/openclaw/openclaw/actions/runs/38204039735. The current head passed all required checks after integrating the shared layout scheduler and resolving concurrent test/type declarations.

Inspected synthetic before/after screenshots follow.

Before: HTML file preview

After: HTML file preview

Before: session diff

After: session diff

Preserve retained panel, editor and iframe lifetimes and the lazy region boundary. Remaining Lit pane definitions and HTML preview templates use narrow content adapters. Keep dock resize geometry reactive when the layout changes.
@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 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. 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. 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 moves chat sidebar, detail-content, file-preview, and editor-menu rendering from Lit to Solid.

Example: Open preview.html in the chat Files panel.

  • Before: Lit renders the file toolbar and HTML preview.
  • After: Solid renders the same interface using the existing preview controller.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Strong visual parity evidence supports the migration, but the unresolved download-feedback defect blocks correctness.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected Control UI screenshots show the converted sidebar rendering synthetic preview.html and session-diff content with matching desktop-light before/after presentation.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: The chat sidebar remains on the legacy renderer during the approved Control UI migration.
Reason: The maintainer-authored port preserves the existing controllers, retained-panel architecture, lazy boundary, and presentation contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this approved Solid migration remains useful, but the previously reported attachment-download feedback regression still blocks merge.

Priority: P2
Reviewed head: 162a948840d9c3c012ca8316676dad6605123a3a

Before merge

  • Project mutable download state before passing it through Show (P2) - For a download-only attachment such as archive.zip, DetailPanel supplies the same AttachmentDownloadController on every invalidation. Show memoizes that unchanged object, while these children read pending and error only through download(). A delayed transfer therefore leaves the button enabled, and rejection produces no visible alert. The previous Lit renderer reread both fields on every invalidation. Publish fresh pending/error values from DetailPanel, retain onDownload, and cover pending, rejection, and retry through the detail panel. This previously reported finding remains unresolved.

Findings

  • [P2] Project mutable download state before passing it through Show — ui/src/pages/chat/components/chat-sidebar-content.tsx:135-138

Tests

  • Missing end-to-end proof: Existing evidence does not exercise a delayed or rejected archive.zip download and retry through the detail panel.
Agent review details

How this fits together

The Control UI sidebar consumes pane-owned layout and controller-owned content, renders retained panels, and routes user actions back to those owners.

flowchart LR
Pane[Chat pane] --> Bridge[Solid bridge]
Bridge --> Region[Sidebar region]
Region --> Panels[Retained panels]
Controllers[File and attachment controllers] --> Projection[Detail panel projection]
Projection --> Content[Solid sidebar content]
Content --> Controllers
Loading

Technical review

Best possible solution:

Keep the existing download controller and publish fresh pending/error values to the Solid view on each invalidation.

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

The detail-panel producer, mutable download controller, Solid consumer, and pinned Show implementation establish the delayed/rejected download failure path without executing target code.

Is this the best way to solve the issue?

The renderer cutover follows the existing ownership and bridge architecture; projecting the controller's mutable fields fixes the regression without adding another state owner.

Full review comments:

  • [P2] Project mutable download state before passing it through Show — ui/src/pages/chat/components/chat-sidebar-content.tsx:135-138
    For a download-only attachment such as archive.zip, DetailPanel supplies the same AttachmentDownloadController on every invalidation. Show memoizes that unchanged object, while these children read pending and error only through download(). A delayed transfer therefore leaves the button enabled, and rejection produces no visible alert. The previous Lit renderer reread both fields on every invalidation. Publish fresh pending/error values from DetailPanel, retain onDownload, and cover pending, rejection, and retry through the detail panel. This previously reported finding remains unresolved.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared sidebar layout and retained panel roots keeps the original intent (aed4510: Unify lateral surfaces into one tabbed panel while preserving panel state and per-session layout.)
  • File preview, editor, and iframe lifetime keeps the original intent (65c8b06: Keep named file previews and editor state across tab switches while retaining isolated HTML previews.)
  • Explicit attachment downloads keeps the original intent (97dd4d2: Download binary artifacts using fresh scoped authority and cancel stale saves when their context changes.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/chat/components/chat-sidebar.test.ts --maxWorkers=1
  • pnpm --dir ui test src/pages/chat/components/chat-sidebar-file-view.browser.test.ts --maxWorkers=1
  • git diff --check

What I checked:

PR surface

Source +240, Tests +22, Other -3. Total +259 across 33 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 19 1931 1691 +240
Tests 11 73 51 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 1 4 -3
Total 33 2005 1746 +259

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The renderer migration has a concrete, limited attachment-download feedback regression without demonstrated data loss or service disruption.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • 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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-11T23:45:25.816Z sha ed68d5e :: needs changes before merge. :: [P2] Project mutable download state before passing it through Show | [P2] Restore the detail-panel line-cap ratchet
  • reviewed 2026-10-12T00:14:41.910Z sha 779841d :: needs changes before merge. :: [P2] Project mutable download state before passing it through Show | [P2] Restore the DetailPanel line-cap ratchet
  • reviewed 2026-10-12T00:36:13.699Z sha 779841d :: needs changes before merge. :: [P2] Project mutable download state before passing it through Show | [P2] Restore the DetailPanel line-cap ratchet
  • reviewed 2026-10-12T01:22:13.891Z sha 558922f :: needs changes before merge. :: [P2] Project mutable download state before passing it through Show
  • reviewed 2026-10-12T01:54:53.902Z sha 558922f :: needs changes before merge. :: [P2] Project mutable download state before passing it through Show
  • reviewed 2026-10-12T02:55:58.446Z sha 33b9e95 :: needs changes before merge. :: [P2] Project mutable download state before passing it through Show
  • reviewed 2026-10-12T03:47:43.862Z sha 0e084fa :: needs changes before merge. :: [P2] Project mutable download state before passing it through Show
  • reviewed 2026-10-12T04:36:09.717Z sha 162a948 :: needs changes before merge. :: [P2] Project mutable download state before passing it through Show

Reviewed October 12, 2026, 1:01 AM ET / 05:01 UTC (Revision 12).

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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
@steipete steipete closed this Oct 12, 2026
@steipete steipete reopened this Oct 12, 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 12, 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 12, 2026
@steipete
steipete merged commit 5ef9e1a into main Oct 12, 2026
122 checks passed
@steipete
steipete deleted the solid2/w-chat-7a branch October 12, 2026 05:04
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
)

* refactor(ui): render the chat sidebar region with Solid

Preserve retained panel, editor and iframe lifetimes and the lazy region boundary. Remaining Lit pane definitions and HTML preview templates use narrow content adapters. Keep dock resize geometry reactive when the layout changes.

* chore(ui): refresh the sidebar menu copy inventory

* fix(ui): align sidebar migration ownership checks

* test(ui): explain the sidebar lazy import failure mock

* chore(ui): prune the explained sidebar mock allowance

* test(ui): preserve reactive MCP test harness contracts

* test(ui): bind the MCP gateway request fixture

* fix(ui): keep the MCP catalog JSX contract with its component
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts 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