Skip to content

refactor(ui): own activity and logbook state in Solid - #173771

Merged
steipete merged 2 commits into
mainfrom
solid2/w-idiom-pages-activity
Oct 16, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-idiom-pages-activity

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Activity still routes navigation and live-subscription reconciliation through generic controller invalidation. Logbook keeps its view and polling lifetime in a host-keyed WeakMap with a separate stop adapter.

User Impact

No intended behavior change. Activity routes, query ordering, inspector cancellation and recovery, presence expiry, and stream following remain intact. Logbook polling, day changes, expanded cards, question drafts, and reconnect resets keep their existing lifetime.

Why This Change Was Made

Replace Activity's page/query classes with scoped factories. Keep RPC admission synchronous, derive live entries from their owner, and put filters, expansion, and scrolling state in Solid. A stream ref replaces the DOM search. Logbook owns its polling cleanup; keyed card owners hold expansion, and connection epochs remount the bundled view instead of calling through the host map. The bundled import stays lazy.

Across touched production files: 3,452 → 3,284 LOC (-168). Tests: 3,029 → 2,980 (-49). Controller-pattern references: 37 → 0; createEffect: 11 → 10; untrack: 5 → 4. Textual addEventListener references increase 7 → 9 because existing computed registrations become explicit; actual visibility/pagehide/pageshow registrations are unchanged and paired with cleanup. Counts include imports and exclude AbortController.

Evidence

Proof Result
UI typecheck Passed after correcting the keyed Show callback's required parameter
Activity page 18 cases passed initially; a fixture spy assertion was corrected and its one failing case passed alone
Logbook owner 9 tests passed once, covering polling and stale day/client work
Scoped lint / formatting Passed
Production Knip Passed
Independent review Scoped-clean P0–P2
Production builds Base and candidate passed on the same Mac
Strict startup check 347,717 → 347,685 B gzip (-32 B); 8 JS requests on both sides
Startup CSS 1 request, 38,844 B gzip on both sides
Synthetic captures Populated Activity sessions, expanded live tool result, and expanded Logbook card with question draft; no page errors

No Solid diagnostics appeared in the focused tests. No passing suite was repeated. Full UI coverage is requested with ci:full; no local E2E suite or parity run was used.

The inspected, synthetic 1280×900 dark captures preserve content and layout. The expanded live view is pixel-identical; the sessions and Logbook captures have 132 and 108 differing pixels respectively around small text/icons. Contact sheets are ordered Activity sessions, live activity, and Logbook.

CI fixture correction

Full CI run 38848698560 exposed an undefined today shorthand in the Logbook browser fixture. The four browser cases and UI-pages test typecheck failed on that same typo; this was caused by this PR. The fixture now uses its existing day value. All four browser cases and the UI-pages test typecheck pass locally. Production code, bundle measurements, and captures are unchanged.

Before: Activity sessions, live activity, and Logbook

After: Activity sessions, live activity, and Logbook

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

clawsweeper Bot commented Oct 16, 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 16, 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-16T04:08:08.612327Z 9b41506 PR opened
ℹ️ 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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

Moves Activity coordination and Logbook lifetimes to scoped factories with Solid-owned presentation state.

Example: Expand a Logbook card and enter “What should I work on next?”

  • Before: Expansion and question text live in host-keyed controller state.
  • After: Solid component owners retain the same visible expansion and question text.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Inspected before/after browser captures support visual parity, but the introduced fixture error prevents the browser checks from passing.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; inspected browser captures show matching Activity and Logbook content, expansion, and question-draft presentation.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Activity and Logbook carry presentation and cleanup bookkeeping outside their Solid view lifetimes.
Reason: The maintainer-approved direction reduces production code, preserves synchronous domain ownership, and consolidates cleanup without adding settings or public contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR is a useful, maintainer-directed refactor, but an introduced fixture error breaks all four Logbook browser layout cases.

Priority: P3
Reviewed head: 9b41506bc0de4e35c3e26a7d074eb1e99d5fb941

Before merge

  • Initialize the fixture's today field from day (P2) - The fixture declares day, but this shorthand references an undeclared today. Every parameterized case throws while constructing status, before Logbook mounts or any timestamp-layout assertion runs. Exact-head checks-ui annotations confirm all four failures. Replace this with today: day to restore the browser coverage.

Findings

  • [P2] Initialize the fixture's today field from day — ui/src/pages/plugin/logbook-view.browser.test.tsx:45
Agent review details

How this fits together

Control UI owners consume Gateway session, presence, audit, and Logbook RPCs, then expose synchronous snapshots through reactive projections to Solid views.

flowchart LR
  U[User controls] --> V[Solid views]
  V --> O[Scoped request owners]
  O --> G[Gateway RPCs and events]
  G --> O
  O --> P[Reactive projections]
  P --> V
  L[View lifetime cleanup] --> O
Loading

Technical review

Best possible solution:

Keep the scoped-owner refactor and repair the browser fixture to use today: day.

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

The changed source contains the undefined binding, and exact-head CI independently records the resulting four ReferenceErrors; no local tests were run.

Is this the best way to solve the issue?

The owner cutover keeps request admission synchronous, preserves existing reconciliation and lazy loading, and removes superseded controller paths; the fixture typo needs a focused correction.

Full review comments:

  • [P2] Initialize the fixture's today field from day — ui/src/pages/plugin/logbook-view.browser.test.tsx:45
    The fixture declares day, but this shorthand references an undeclared today. Every parameterized case throws while constructing status, before Logbook mounts or any timestamp-layout assertion runs. Exact-head checks-ui annotations confirm all four failures. Replace this with today: day to restore the browser coverage.
    Confidence: 1

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

Provenance checked

  • Activity page lifecycle keeps the original intent (e33b7f6: The earlier Solid migration preserved plain TypeScript owners for Gateway requests and mutation authority while replacing Lit rendering.)
  • Session query reconciliation keeps the original intent (f8a5f87: Authoritative row deltas avoid repeated roster reads while retaining membership checks, event ordering, and a paced fallback refresh.)
  • Logbook background refresh keeps the original intent (ebb1e83: Slow polling must share one background refresh owner rather than accumulate request batches.)
  • Display refresh complexity keeps the original intent (224c0bc: Maintainer policy accepts recoverable overlapping display results while retaining actual client and private-context boundaries.)
  • Bundled plugin view retirement keeps the original intent (939f740: Solid plugin views preserve retained state and reject work from retired connection owners.)
  • Logbook control identity keeps the original intent (16cd282: Small Solid control components retain DOM identity and keyboard focus during owner refreshes.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test --project browser src/pages/plugin/logbook-view.browser.test.tsx
  • pnpm tsgo:test:ui
  • git diff --check

What I checked:

  • Introduced fixture defect: The patch replaces today: state.day with shorthand today, but declares only day = "2026-01-01"; no today binding exists. (ui/src/pages/plugin/logbook-view.browser.test.tsx:45, 9b41506bc0de)
  • Exact-head CI confirms the failure: The checks-ui browser job reports ReferenceError: today is not defined at line 45 for all four English/German timestamp-layout cases: https://github.com/openclaw/openclaw/actions/runs/38848698560/job/116805315539. (ui/src/pages/plugin/logbook-view.browser.test.tsx:45, 9b41506bc0de)
  • Other CI failure remains unattributed: The core typecheck annotation contains only exit code 2; the aggregate gate reports the two failed jobs. Log retrieval was blocked when GitHub redirected to productionresultssa19.blob.core.windows.net, so no separate typecheck defect or inherited-failure claim is made. (9b41506bc0de)
  • Visual evidence inspected: Both downloaded before/after contact sheets show populated Activity sessions, expanded live tool output, and an expanded Logbook card with a question draft; their visible content and layout match. (/home/runner/work/clawsweeper/clawsweeper/artifacts/event/codex/proof-scratch/173771/media-proof-manifest.json, 9b41506bc0de4e35c3e26a7d074eb1e99d5fb941)
  • Current-main context: The affected Activity, plugin-page, and session-volume paths have no changes between the pinned introduction base and fetched main; this owner cutover remains distinct work. (ui/src/pages/activity/activity-page-state.ts, 1b650393cea3)
  • Policy and ownership history: Read the complete root and UI AGENTS.md files; UI has no deeper scoped AGENTS.md, and .agents/maintainer-notes is absent. History identifies Peter Steinberger's original Logbook feature and subsequent Solid migrations, Alix-007's polling repair, and Shakker's Current Work implementation. Extended copy-following blame encountered an unavailable historical blob; no introduction claim relies on that failed lookup. (ui/AGENTS.md, 1b650393cea3)

PR surface

Source -168, Tests -49. Total -217 across 22 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 12 1099 1267 -168
Tests 10 352 401 -49
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 22 1451 1668 -217

Review metrics

Metric Value Why it matters
Production versus test LOC Production −168 LOC; tests −49 LOC Scoped factories replace controller and host-map machinery while the revised tests exercise rendered behavior and existing lifecycle contracts.

Labels

Label changes:

  • add P3: This is a behavior-preserving UI cleanup with a narrow test-fixture blocker and no established production regression.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is a behavior-preserving UI cleanup with a narrow test-fixture blocker and no established production regression.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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 16, 2026, 12:19 AM ET / 04:19 UTC.

@steipete
steipete merged commit 10c95d1 into main Oct 16, 2026
99 of 100 checks passed
@steipete
steipete deleted the solid2/w-idiom-pages-activity branch October 16, 2026 05:50
@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 17, 2026
* refactor(ui): own activity and logbook state in Solid

* test(ui): use the Logbook fixture date in browser status
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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