Skip to content

refactor(ui): use Solid lifetimes, actions, and stores in chat - #179115

Merged
steipete merged 8 commits into
mainfrom
solid2/w-s2-chat-d
Oct 21, 2026
Merged

steipete merged 8 commits into
mainfrom
solid2/w-s2-chat-d

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Related: #168114

Problem and solution

Chat components still separate teardown from setup, copy local presentation records, maintain mutation pending flags manually, and construct or load renderers imperatively.

Pair teardown with settled lifetimes; use draft stores for disclosure choices and failed images; use actions with optimistic pending indicators for compaction, goal editing, worker stopping, and learned-skill Undo. YouTube uses lazy/Loading/Errored at its existing boundary. The recovery-dialog launcher is consolidated with its JSX renderer, and the subagent-activity lazy wrapper now uses JSX.

Existing owners retain request admission, target and connection identity, cancellation, and durable outcomes. Worker-stop and goal-submit callbacks run outside the held dialog action so synchronous owner publications remain free to advance navigation while requests are pending. Synchronous duplicate-admission guards remain separate from optimistic presentation. Browser-card failures remain latched across screenshot refreshes and unavailable targets; a new valid page target permits retry.

Tags, CSS classes, routes, selectors, focus ownership, playback identity, and lazy boundaries remain intact. No intended appearance change, dependency change, or budget/baseline exception. The native-update E2E now records bounded scalar dialog facts only on failure; its assertions and waits are unchanged.

Proof

Check Result
Current head 43b5473 ci:full run 39576241570 completed: UI 3/3, mocked E2E 8/9, real-Gateway 1/2; two exact failing names below
UI typecheck Passed on the action repair and diagnostic follow-up
Worker stop / goal editing 1/1 and 4/4 passed; duplicate admission, dismissal/retry, error/focus, and scope retirement. 15.47s and 12.33s wall.
Placement navigation Existing exact E2E failed on ff148aa and passed with callback isolation; 104.95s wall including build, 5.3s test. Also passes in replacement CI.
Widget cards / source previews / download retirement 15/15, 2/2, and 3/3 passed; playback retention, independent favicon failures, and unmount/session/connection retirement
Current CI details Performance, lint, applicable types, and all UI unit shards passed. Named chat pane/thread/Canvas retention suites and chat-loading-performance.real-gateway.e2e.test.ts passed.
Native-update investigation Exact case passed on actual main parent c13eaee and in one instrumented run of tested merge 2786c2677689 (127.55s runner duration, 7.05s test). No product fix or inherited claim inferred from these passes.
Production Knip Passed in 8m8.1s on c54eff5; production source unchanged by diagnostic follow-up
Targeted lint / formatting Passed; two diagnostic callback shadow names corrected before review
Independent review Earlier component/lifecycle and final action-isolation reviews scoped-clean at P0–P2. Diagnostic follow-up review is also scoped-clean with complete source verification.
Paired startup builds and strict checks 330,958 → 330,962 B gzip (+4 B); 989,994 raw bytes and 8 JS requests unchanged. CSS 40,439 B, 1 request, unchanged.
Paired route budgets Chat boot 1,499,835 → 1,499,858 B (+23), under 1,500,000 B. New-session boot 1,017,106 → 1,017,131 B (+25), under 1,035,000 B. Requests and CSS unchanged.
Visual proof Inspected synthetic desktop Details captures below are byte-identical; later changes preserve markup/styles

The paired builds use actual current-CI main parent 0f737e5c89e5 and tested merge 4cfd26bdbe7f, whose other parent is 43b5473357a5. Both ran in the same checkout on the same machine with identical installed Solid rc.16 dependencies and fixed build metadata. Both strict checks report the existing 325,476 B startup-cap violation; the PR's +4 B is within the 64 B build-variance allowance. The older campaign ceiling is not used to qualify growth.

CI investigation and limits

Current run 39576241570 attempt 1 has two inherited failing names. Both match scheduled main 39578067192 attempt 1 at 94e1fbf31a137. The native inherited-failure recovery route is used; these checks are not represented as green:

  • Control UI Markdown table interactions > contains content-sized tables after restoring a percentage reading width: the same false-containment assertion at line 214 also fails on latest completed scheduled main 39578067192, confirmed by exact check annotation title and assertion. Shard numbers differ; attribution uses test names.
  • Control UI cross-channel automation management with a real Gateway > configured owners and admin chat manage a Telegram-created job while a non-owner cannot: timeout awaiting the initial Telegram create: response at line 308, before browser navigation. The exact name, 60-second timeout, bus-event kinds, and source line also fail on latest completed scheduled main 39578067192. The targeted local base attempt was stopped during private-QA setup once this matching evidence became available; it supplies no test verdict. Its standard Playwright/real-Gateway config used OPENCLAW_VITEST_RUNTIME=node.

The prior native-update timeout did not recur in current CI. Its exact case also passed on actual prior main parent c13eaeedc6c1 and in one instrumented run of tested merge 2786c2677689. No product fix or inherited claim is inferred from those passes; bounded failure diagnostics remain in the test.

The earlier placement failure was ours: an imperative owner callback synchronously published shared state inside a held dialog action, allowing the URL to change while the visible pane remained held. The existing browser case reproduces that defect before callback isolation and passes afterward. Goal submission received the same correction; state-based waits replace fixed-microtask assumptions in its test.

Earlier local Details waits remain recorded: uses the current PR renderer and preserves CI session identity and branch dismissal and projects direct active children through the live observer with stable rounded-avatar seeds. Their exact-name base attempt timed out without assertions, so no inherited claim was made. Mobile-menu and learned-skill local watchdog limits also remain in native review evidence. Subsequent complete UI unit shards passed; passing replays are not claimed as fixes for those local observations.

Solid 2 checklist, counts, and deliberate survivors
Checklist item in touched production files Before → after
Conditional native-handler binding defects 0 → 0
Direct cleanup calls 17 → 1
Async read slots Existing accepted-result pipelines retained; reasons below
Solid actions / optimistic flags 0 → 4 each
Manual renderer loaders 1 → 0; lazy renderers 6 → 7
Copied local records / stores 3 → 0 / 0 → 3
Manual createComponent calls 3 → 0
Missing-provider wrappers / sibling-loading candidates 0 → 0
createRoot / getOwner / runWithOwner 0 → 0

Settled setups: 19 → 30. Ordinary signals: 58 → 52. Effects: 3 → 3. Intentional initial snapshots (untrack): 3 → 3. Counts include generic calls; Solid action counts exclude the existing branch accessor named action.

Production LOC: 9,240 → 9,226 (-14). Tests: 2,833 → 3,085 (+252). Scope: 38 files; the added E2E file contributes existing lines to both counts. The generated boot manifest adds the shared runtime entries, removes the retired launcher, retains a currently reached Markdown module, and renames the lazy-wrapper entry.

The remaining favicon cleanup retires work begun synchronously during rendering. Across the lane, cleanup tied to reactive runs, primitives, synchronous media/ref registration, keyed DOM handoff, and foreign-DOM adapters remains justified; FrameBody retains its intentional owner APIs.

The diff panel retains accepted raw sources, progress, and error slots. Persistent mobile chrome reads data and progress outside the result region; native async reads there would hold the changed scope and suppress its loading fallback. Moving the boundary around the panel would alter the persistent rail. Raw source/fold identity, accepted-result publication, and stale-gap result reuse stay intact.

Tool output retains one combined state slot so the same visible native input disclosure and raw-output controls survive loading, errors, and retries. A fallback renderer would expose independent disclosure state; preserving continuity would require a broader boundary design and another accepted-value bridge.

Clipboard feedback retains its primitive-owned signal: reset participates synchronously in the retained foreign-DOM renderer, and installed store options do not support that signal's ownedWrite integration contract. No adapter or dependency change was added to force this conversion.

Before: synthetic desktop Details panel

After: synthetic desktop Details panel

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T09:41:44.687321Z 43b5473 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67b5b27078

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,4 +1,4 @@
import { For, Loading, Show, createMemo, createSignal, lazy } from "solid-js";
import { For, Loading, Show, action, createMemo, createOptimistic, lazy } from "solid-js";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep chat-only actions out of the shared boot graph

This first action import is used only by the lazy Chat Details panel, but it pulls core/action.js and core/lanes.js into the manifest's shared set, so even New Session now downloads an additional request and roughly 2.6 KB gzip before the panel is opened. Preserve the previous local signal/finally implementation or isolate the action runtime behind the chat interaction boundary so this refactor does not increase every Control UI startup.

AGENTS.md reference: ui/AGENTS.md:L76-L79

Useful? React with 👍 / 👎.

@steipete steipete changed the title refactor(ui): adopt Solid lifetimes and actions in chat panels refactor(ui): adopt Solid lifetimes and actions in chat components Oct 21, 2026
@steipete steipete changed the title refactor(ui): adopt Solid lifetimes and actions in chat components refactor(ui): use Solid lifetimes, actions, and stores in chat Oct 21, 2026
@steipete
steipete enabled auto-merge (squash) October 21, 2026 07:51
@steipete
steipete disabled auto-merge October 21, 2026 08:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c54eff5d65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +80 to +85
const [failedImages, setFailedImages] = createStore<Record<string, boolean>>((draft) => {
if (pageTarget()) {
for (const url of Object.keys(draft)) {
delete draft[url];
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve failed images after store writes

When an image emits error while pageTarget() is available, setFailedImages writes the URL and this writable createStore derivation immediately reruns with that mutated draft; because the condition remains truthy, it deletes the URL that was just recorded. The failure therefore never stays latched, so broken thumbnails and favicons remain or reappear instead of falling back; clear the store only when the page-target identity actually changes. .agents/skills/solid/references/lessons.mdL21-L23

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves chat presentation state, mutation indicators, renderer loading, and cleanup into existing Solid primitives.

Example: A user confirms Stop worker twice while the first request is pending.

  • Before: A manually managed pending signal controls the dialog.
  • After: A synchronous guard admits one request while Solid manages the pending indicator and permits retry after failure.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is coherent and has no confirmed finding; dynamic behavior evidence is primarily test-based, and broad current-head CI remains unfinished.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer-authored classification exempts this PR from the ordinary contributor proof gate; inspected screenshots establish original Details appearance parity, while reported focused and browser tests cover action isolation and retained state.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Chat behavior depends on manually coordinated presentation state, renderer loading, and teardown that can drift during the Solid migration.
Reason: The maintainer-directed change removes redundant machinery while preserving established controls, request owners, identity checks, and presentation contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a maintainer-directed refactor with no confirmed introduced defect; neither existing review finding remains supported by the current evidence.

Priority: P3
Reviewed head: c54eff5d652ae851d9ac7a5bedb93535610cf14a

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control UI chat components consume session and Gateway owner snapshots, render controls and previews, and delegate mutations to existing domain owners.

flowchart LR
  A[Gateway and session owners] --> B[Reactive projections]
  B --> C[Chat components]
  C --> D[Solid stores and lifetimes]
  C --> E[User actions]
  E --> A
  C --> F[Lazy preview renderers]
Loading

Technical review

Best possible solution:

Retain this focused conversion with synchronous mutation admission, existing domain owners, and the justified retained async-result pipelines.

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

This is a behavior-preserving refactor; source inspection found no confirmed introduced failure, and no target code was executed during this read-only review.

Is this the best way to solve the issue?

The change follows the existing Solid ownership model, removes superseded renderer paths, and preserves synchronous admission separately from optimistic presentation.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Browser preview failure retention keeps the original intent (c5bd467: Optional preview resources follow source lifetimes while failed-image suppression survives screenshot refreshes and resets for a new page target.)
  • Goal editing and worker confirmation keeps the original intent (feat(ui): add mobile Goal details and recovery #176519: Goal editing preserves failed drafts and scope retirement; the sibling worker-confirmation implementation in feat(ui): add machine details and worker stop confirmation #176445 preserves captured targets, duplicate admission guards, and retry.)
  • Session-panel input admission keeps the original intent (1396911: Native notifications retire stale authority synchronously while existing domain owners retain request batching, result guards, and disposal.)
  • Shared lifecycle and local presentation state keeps the original intent (refactor(ui): derive chat panel state and own DOM references #176370: Earlier refactors removed imperative copies while preserving tags, cancellation, media custody, and justified owner-managed pipelines.)
  • Lazy subagent and video rendering keeps the original intent (53fbcbb: Subagent activity stays outside idle boot; the earlier widget migration retained lazy YouTube loading and playback identity.)
  • File-draft recovery keeps the original intent (a05ccb5: One Solid modal owner preserves clipboard/download actions, stale-draft checks, cancellation, and focus.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vyctor H. Brzezowski: Raw commit f750012 adds ui/src/pages/chat/components/chat-details-goal.tsx:46 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f7500122b023; files: ui/src/pages/chat/components/chat-details-goal.tsx)

PR surface

Source -12, Tests +229. Total +217 across 37 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 29 229 241 -12
Tests 8 243 14 +229
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 37 472 255 +217

Review metrics

Metric Value Why it matters
Production versus test LOC Production +225/-239; tests +243/-14 Production shrinks by 14 lines; test growth covers distinct image-failure, pending-action, notice-retirement, focus, and playback-retention contracts.

Labels

Label changes:

  • add P3: This preserves user-facing behavior while simplifying existing UI implementation patterns, with no confirmed urgent regression.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This preserves user-facing behavior while simplifying existing UI implementation patterns, with no confirmed urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • 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.

Reviewed October 21, 2026, 4:34 AM ET / 08:34 UTC.

@steipete
steipete merged commit 24ff459 into main Oct 21, 2026
104 of 113 checks passed
@steipete
steipete deleted the solid2/w-s2-chat-d branch October 21, 2026 10:16
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
…law#179115)

* refactor(ui): adopt Solid lifetimes and actions in chat panels

* build(ui): refresh chat boot module manifest

* test(ui): return void from widget cleanup

* refactor(ui): complete chat actions and lazy JSX renderers

* fix(ui): isolate dialog actions from chat owner writes

* test(ui): capture native update dialog failure state
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:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant