Skip to content

refactor(ui): align page resources with Solid lifetimes - #176397

Merged
steipete merged 4 commits into
mainfrom
solid2/w-zero-pages
Oct 18, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-zero-pages

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Activity, agent previews, Debug, and Logs still retained duplicate resource lifetimes, tracking escapes, and DOM lookups after the Solid migration. Use mounted resource lifetimes, refs, and the existing stream-follow owner. Its reset operation preserves follow intent when the activity/log source changes; agent preview reopen resets fullscreen state and ARIA together.

Synchronous owners keep request authority, cancellation, and retained state. Tags, classes, routes, lazy imports, and appearance remain unchanged. Main independently landed the app/lib portion in #176420; this replacement adopts those nine files exactly from main and removes our competing proposal.

Evidence

Check Result
Focused behavior 36 Dashboard/activity-media/agent-preview cases passed on the original complete candidate. The retained page changes are unchanged; main now owns the Dashboard portion. Agent preview assertions include reopen fullscreen/ARIA.
Typecheck Refreshed replacement candidate passed
Independent review Earlier candidate and final smaller replacement candidate P0–P2 scoped-clean; source verification complete
Production Knip Final replacement and previous exact base report only reply-admission-ticket.ts and reply-turn-admission-owner.ts; no unused UI files. Knip exits 1 for those existing core findings.
Startup Historical same-host comparison: 336,284 → 336,306 B gzip, one CSS request. All authored startup/app changes are now superseded by main. Final CI: 337,265 B gzip / one CSS request; chat 1,487,494 → 1,487,512 B (+18), New 1,048,138 → 1,048,157 B (+19), all budgets pass.
Broad proof Final ci:full run 39173437510 passes all UI units, browser, real-Gateway, lint/type/performance/security jobs. Sole failing test: src/gateway/server.session-row-deltas.integration.test.ts > capable and legacy sockets produce identical session payloads and consumer state; the exact name also times out on completed scheduled main 39172446197. Its timeout leaves a downstream temporary namespace claim. Native inherited-failure route is requested for that core failure and its aggregate only; CI is not described as green.

Refactor checklist

Sixteen production files against integrated main 2eccba0e7b6cd25170aad9df916da0580dcbdf40; two coupled test files are separate.

Pattern Before After
Production LOC 5,368 5,320
createEffect 10 6
createRenderEffect 0 0
untrack 8 1
Raw listeners 9 0
DOM queries 6 0

The retained snapshot is activity/session-activity-view.tsx:126, named initialContext. Effects remain at Activity presence expiry (activity-page-view.tsx:207), media integration (session-activity-media.tsx:344), live catalog selection (agents-home/claws-catalog-dialog.tsx:575), agent route admission (agents-page.tsx:11), and Debug source/dialog synchronization (debug-overlay-content.tsx:148, debug-overlay.tsx:104). These are explicit follow-ups, not a claim that the lane-wide effect target is complete. No feature render effect, own-DOM query, or raw DOM listener remains in this touched scope.

No remote leases were created. External proof/checkouts remain for coordinator cleanup under the campaign's metadata-I/O rule.

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

clawsweeper Bot commented Oct 18, 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 18, 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-18T22:46:48.943960Z 907dcaf 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR aligns Control UI resources with Solid lifetimes, replaces DOM lookups with refs, and shares stream-follow behavior.

Example: Expand the main agent's AGENTS.md preview, close it, and reopen it.

  • Before: Imperative helpers reset fullscreen classes, button state, and accessibility attributes.
  • After: One presentation signal drives fullscreen classes and accessibility state while preserving the collapsed reopen behavior.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful simplification with no actionable source finding; harness-centered evidence limits behavioral confidence, and failed CI remains unresolved.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied validation consists of browser harnesses, typechecking, and a startup comparison.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Duplicated rendering lifetimes make it harder to preserve cleanup, focus, and retained state consistently.
Reason: The maintainer-authored direction is established, and the patch removes duplicated machinery without adding configuration, public APIs, or persistent state.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-directed refactor open: the pinned diff provides useful simplification, and source review found no actionable introduced defect; failing CI still needs attribution.

Priority: P3
Reviewed head: 847e51f1113d4e6ee261b885a32651bb629e51b9

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied browser harnesses cover preview and media behavior, but no shipped-page trace exercises the changed Activity/Logs follow integration, and base-versus-head regression results are not supplied.
Agent review details

How this fits together

Control UI components consume synchronous Gateway owners and plugin registrations, then manage rendered DOM, subscriptions, media, and browser listeners within their mounted lifetimes.

flowchart TD
  A[Gateway owners] --> B[Reactive projections]
  B --> C[Solid page lifetimes]
  D[Plugin registrations] --> C
  C --> E[Rendered DOM and refs]
  C --> F[Subscriptions and browser resources]
  C --> G[Owned cleanup]
Loading

Technical review

Best possible solution:

Keep resource cleanup with each Solid lifetime while preserving existing synchronous domain owners and user behavior.

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

This is a refactor rather than a bug report; review used the pinned source and supplied validation without executing target code.

Is this the best way to solve the issue?

The approach fits the existing ownership model: keyed scopes retire resources, refs replace owned-DOM searches, and the shared follow owner replaces duplicate scheduling.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction reviewed: Reviewed the complete merge-base-to-head diff, including the deleted preview helper, both changed test files, and the resource-lifetime changes; base movement was excluded from PR ownership. (847e51f1113d)
  • Existing owners retained: Activity Git retains the shared pull-request store and pairs its watch with keyed cleanup; media retains its connection cache and request checks; stream following reuses the existing shared owner. (ui/src/pages/activity/session-activity-git.tsx:100, 847e51f1113d)
  • Discussion and supplied validation: The full PR body and all discussion comments were read. The body reports UI typechecking, browser-harness coverage, and a startup comparison; discussion adds no changed-behavior media or live trace. No target code was executed during this review. (847e51f1113d)
  • CI remains unresolved: Run https://github.com/openclaw/openclaw/actions/runs/39161962988 fails lint, UI shard 3, both real-Gateway shards, and the aggregate gate. Annotations identify video-ticket renewal, speech supplements, managed-image ordering, and attachment replay failures. Log downloads were blocked by the host allowlist, so these failures cannot responsibly be classified as introduced or inherited. Successful main runs do not establish matching coverage. (847e51f1113d)
  • Policy and history applied: Read the complete root and UI AGENTS.md files; UI has no deeper scoped AGENTS.md, and the maintainer-notes directory is absent. History across current and earlier marquee, Activity, and shell paths establishes sustained ownership by steipete. Some older-object reads failed at the local history boundary; no unsupported introduction claim relies on them. (ui/AGENTS.md:1, 847e51f1113d)
  • Solid contract checked: The patch imports Solid and depends on keyed flow, asynchronous computations, and onSettled cleanup semantics. The installed cheatsheet is unavailable, so the upstream cheatsheet at the revision referenced by the repository's rc.14 guidance was inspected as supporting contract evidence. (packages/solid/CHEATSHEET.md, 8d23a5a13b23)

PR surface

Source -88, Tests +56. Total -32 across 27 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 25 484 572 -88
Tests 2 56 0 +56
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 27 540 572 -32

Labels

Label changes:

  • add P3: This is behavior-preserving UI cleanup without an established urgent user-facing defect.
  • 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 is behavior-preserving UI cleanup without an established urgent user-facing defect.
  • 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.

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 18, 2026, 4:27 PM ET / 20:27 UTC.

@steipete
steipete merged commit a4182c6 into main Oct 18, 2026
104 of 110 checks passed
@steipete
steipete deleted the solid2/w-zero-pages branch October 18, 2026 23:23
@steipete

Copy link
Copy Markdown
Contributor Author

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

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. 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