Skip to content

refactor(ui): load bundled Logbook with Solid boundaries - #179332

Merged
steipete merged 2 commits into
mainfrom
solid2/w-s2-logbook-loader
Oct 21, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-s2-logbook-loader

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

The bundled Logbook page used a manual import registry and idle/loading/error/ready state machine. A per-mounted native Solid lazy component now owns module readiness under Loading and Errored; the plain page owner still owns descriptor identity, Gateway epochs, and external-frame authentication/probe lifecycles.

Reconnect remounts the Logbook model without reloading its module. Retiring the descriptor retires import/error recovery. Stale-chunk handling remains attached to the current error and retries against current owner authority. The production test-only registry seam is removed, and no effect was added.

Proof

Check Result
UI typecheck, controller guard, focused boundary lint, format/diff Passed
PluginPage browser cases, pinned Bun / one worker Five bundled-loader cases passed after fixture correction; actual Logbook reconnect passed after initial-client snapshot correction. Eleven unchanged external frame/auth cases passed in the initial whole-file run.
Independent P0–P2 review Scoped-clean, final source verification complete
Production Knip Passed, no findings
Production build / bounded visual capture Both sides passed. Loading and ready PNG pairs byte-identical, synthetic-only inspected; zero page errors and one status/timeline request.
Broad local typed lint Plugin SDK declaration preparation timed out after 300,000 ms before linting; supported focused guard mode and UI tsrs passed. Replacement CI reports no remaining lint/type failure.

The old registry mock allowed two independently settling imports for one module URL, which real import() shares. Its replacement rejects the retired import while away, verifies no recovery and unchanged successor descriptor, then re-enters after settlement. A classifier stub interprets Vitest’s wrapped import error; native boundary/retry lifetimes remain real. No resetModules or replacement production test seam was added.

Paired production measurements

Both builds ran on the same machine. Raw startup/chat/New JavaScript bytes, CSS, and request counts are identical; gzip differences are within 64 B build variance. Both strict checks fail only the existing 325,476 B absolute startup ceiling. No budget/baseline or chunk boundary changed.

Surface Base Head Delta
Startup JS gzip 329,470 B 329,495 B +25 B
Startup JS requests 8 8 0
Startup CSS gzip / requests 40,439 B /1 40,439 B /1 0
Chat boot JS gzip 1,499,075 B 1,499,109 B +34 B
New boot JS gzip 1,016,116 B 1,016,153 B +37 B

Locale deltas range −2 to +4 B. Production LOC 765 → 718 (−47); tests 595 → 649 (+54). The removed manual loader/state machine accounts for the production reduction.

Solid 2 checklist

Item Before → after in touched production files
Conditional intrinsic handlers 0 → 0
Component lifecycle onCleanup 2 → 2 (separate lifecycle PR); onSettled 0 → 1 for error recovery
Async reads Manual bundled state machine 1 → 0; Loading 0 → 1; Errored 0 → 1
Mutations 0 → 0
Code splitting Manual renderer loader 1 → 0; lazy 0 → 1, same route chunk boundary
Object/array signals 0 → 0
Manual createComponent 0 → 0
Throw-only context wrappers 0 → 0
Independent sibling loading 0 → 0
Owner escape APIs 0 → 0

Effects 1 → 1; render effects/untrack/DOM queries/flush 0 → 0. One direct Gateway subscription remains for synchronous retirement of owner facts.

Inspected synthetic screenshots

State Before After
Loading Logbook loading before Logbook loading after
Ready Logbook ready before Logbook ready after

CI fixture correction

Run 39578248212 caught an unnecessary default type argument and missing isolation rationale in the controlled lazy-import fixture. The fixture now uses the helper's default type and documents why loading the real module would defeat its import-settlement/failure test. All 16 tests in the touched file, canonical UI-page test types, typed lint, formatting, the exact-base mock-export guard, and independent scoped review pass. Production code is unchanged, so the paired build, bundle, Knip and screenshot evidence above remains applicable. Test LOC is 595 → 649 (+54).

Replacement run 39584207681, attempt 1, tested head 04fd96dd59eb206cfb644be2e2651f8e0eba9bae. The fixture failures are gone. Exactly two non-aggregate jobs remain red, both matching scheduled main run 39585413125 by exact test name and assertion:

Failing test Matching evidence
Control UI Markdown table interactions > contains content-sized tables after restoring a percentage reading width chat-markdown-table-interactions.e2e.test.ts:214:38, expected false to be true; PR job 119169501333 and main job 119173206453
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 control-ui-automation-management.real-gateway.e2e.test.ts:308:7, first reply timed out after 60,000 ms with inbound-message/outbound-message events; PR job 119169500639 and main job 119173206448

The CI gate is downstream of those two jobs. The native inherited-failure route will retain the failed result and verify the recorded checkout, source equality, security, and review requirements; no failed CI is reported as green.

Replace manual bundled-view import state with a descriptor-scoped lazy component. Keep Gateway epochs as the model remount boundary and leave frame authentication authoritative in PluginPageOwner.

Preserve retry and stale-chunk recovery while retiring obsolete import outcomes. The native error boundary retains its current error until a retry commits.
@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:43:32.951816Z 3406743 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: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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 replaces Logbook’s manual import state machine with Solid lazy loading and error boundaries.

Example: A Logbook import fails with “Logbook chunk failed” and the user clicks Retry.

  • Before: The manual loader replaces the error with a loading state while retrying.
  • After: Solid retains the recovery alert until the retried import settles successfully.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused simplification supported by inspected browser proof and meaningful lifecycle tests; unresolved CI is not treated as a demonstrated patch defect.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The supplied production-build browser captures exercise the bundled Logbook loading and ready path, with inspected before/after screenshots; reported browser cases additionally cover retry, reconnect, and descriptor retirement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Logbook must retain visible loading and recovery states while retiring obsolete imports and connection-bound models.
Reason: The maintainer-authored direction removes redundant lifecycle machinery without adding configuration, public APIs, or another state owner.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a useful, maintainer-directed simplification with no actionable introduced defect found; CI still needs disposition.

Priority: P3
Reviewed head: 3406743ec8e5b35ba1e1e10d0aa46125afeb201d

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI plugin page receives route props and Gateway tab descriptors, selects native, bundled, or iframe rendering, and mounts Logbook with a client fixed to the current connection lifetime.

flowchart TD
  A[Plugin route] --> B[PluginPageOwner]
  C[Gateway descriptors and connection] --> B
  B --> D[PluginPage rendering]
  D --> E[Solid lazy loading and error boundary]
  E --> F[Logbook model]
  D --> G[Authenticated external iframe]
Loading

Technical review

Best possible solution:

Keep module readiness in Solid while the existing page owner retains descriptor, connection, and external-frame authority.

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

This is a behavior-preserving refactor; source inspection and supplied browser evidence establish the affected path without requiring a new bug reproduction.

Is this the best way to solve the issue?

The change uses Solid’s existing readiness and retry owners, removes the superseded loader completely, and preserves the separate connection and frame-auth responsibilities.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Bundled import failure recovery keeps the original intent (87b5036: Rejected imports previously left Logbook blank; the earlier repair added visible retry, stale-chunk recovery, and retirement checks.)
  • Connection-keyed Logbook model lifetime keeps the original intent (a792fa1: Each model receives a fixed initial client and is replaced on connection identity changes, including disconnection with a retained client object.)
  • Presentation during a retry changes intended behavior with a stated reason (87b5036: The manual retry previously published a loading state immediately; this PR explicitly adopts Solid’s retained-error behavior until retry settlement.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source -47, Tests +53. Total +6 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 88 135 -47
Tests 1 71 18 +53
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 159 153 +6

Review metrics

Metric Value Why it matters
Production versus test LOC Production −47; tests +53 Removing the manual loader reduces production machinery; test growth covers retry and retired-import lifetimes without retaining a production test seam.

Labels

Label changes:

  • add P3: This is a focused lifecycle refactor with preserved user-facing behavior and no demonstrated urgent regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 a focused lifecycle refactor with preserved user-facing behavior and no demonstrated urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • 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.

Reviewed October 21, 2026, 5:59 AM ET / 09:59 UTC.

@steipete
steipete merged commit e6f8be7 into main Oct 21, 2026
104 of 113 checks passed
@steipete
steipete deleted the solid2/w-s2-logbook-loader branch October 21, 2026 11:18
@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
…9332)

* refactor(ui): use native Solid loading for Logbook

Replace manual bundled-view import state with a descriptor-scoped lazy component. Keep Gateway epochs as the model remount boundary and leave frame authentication authoritative in PluginPageOwner.

Preserve retry and stale-chunk recovery while retiring obsolete import outcomes. The native error boundary retains its current error until a retry commits.

* test(ui): document Logbook loader fixture isolation
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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