Skip to content

refactor(ui): give core board widgets one Solid loading boundary - #181314

Merged
steipete merged 4 commits into
mainfrom
solid2/w-zero-board-widgets
Oct 23, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-zero-board-widgets

Conversation

@steipete

@steipete steipete commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Core board widgets still use a registration-request controller instead of the Solid component loading boundary.

User Impact

Reports, session progress, websites, and browser dashboards keep their existing hosts and appearance. Initially hidden widgets stay cold, and successfully loaded widgets retain their controls through hide/show.

Why This Change Was Made

Move the four built-in renderers to named lazy() components with local loading and error boundaries. The widget registry now contains only metadata, and the cell no longer maintains a second request controller or registration polling. Canvas/MCP leases, frame admission, and cancellation remain with their existing owners.

A failed widget keeps its visible Retry action after hide/show instead of automatically retrying merely because it became visible. Retry remains available after returning; an outstanding stale-chunk reload cannot complete from an inactive or disposed widget.

Evidence

Acceptance: compare production builds of the merge base and head on this machine with fixed build metadata. Startup, chat, and New Session bytes must not grow beyond the 64 B build-variance allowance; startup keeps one CSS request. Capture the same synthetic report state before and after. Run UI typechecking, the focused changed tests, the controller guard, and production Knip; broad UI proof comes from ci:full.

Proof Result
pnpm tsgo:ui Passed, including the final component extraction
Board widget plugin tests 7 passed: cold hidden import, delayed loading, visible error and Retry, hide/show identity, live props, and existing progress behavior
Widget registry tests 2 passed
Automatic stale-recovery retirement 2 passed: hide and disposal cancel an in-flight document reload; hide/show retains the error until explicit Retry
Focused lint and formatting Passed; git diff --check clean
pnpm check:control-ui-controllers --prune Passed; no baseline allowances added
pnpm deadcode:knip Same one unused file on exact base and head: extensions/telegram/src/telegram-ingress-worker.context.test-support.mjs; no new findings
Independent review Clean through P2, including the stale-recovery regression repair
Production builds and strict asset check Passed on base and head, zero violations; route/startup deltas within the 64 B variance band
Browser capture Same synthetic report, light theme, 1440×960; zero page errors; before/after PNGs are byte-identical

The registry test's first attempt stalled during Bun filesystem/cache setup before assertions; the recorded passing attempt used the same pinned Bun runtime with its transpiler cache disabled. No runtime fallback or full local E2E suite was used. PR CI uses ci:full for broader coverage. The stale-recovery regression drives the real global preload-error listener and a held document reachability request: the unfixed code navigated after hiding the widget, and the repaired code cancels on hide and disposal. The test explicitly supplies session storage so navigation is genuinely armed.

Same-machine asset comparison

Base: 279015b0578ee497695120b2c682a8154fc520ab after integrating current main, including the shared confirmation-dialog repair. Both builds use identical fixed release metadata. Values below are gzip bytes.

Surface Base JS Head JS Delta JS / CSS requests CSS bytes, unchanged
Startup 315,106 315,112 +6 7 / 1 41,216
Chat 1,346,925 1,346,907 -18 23 / 8 146,175
New Session 825,444 825,435 -9 17 / 6 106,661

All JS changes are inside the 64 B build-variance band. Every CSS surface and request count is unchanged.

Responsibility and size

Local count Before After
Manual core renderer descriptors 4 0
Registration request controller 1 0
Registration request loops 2 0
Native lazy components 0 4
Cell effects 2 2
Cell cleanup registrations 2 2
Production LOC 796 840
Tests and isolation config LOC 835 977

The 44-line production increase gives the four renderers one local activation/error/retry boundary while removing registry loader callbacks and request polling. The boundary is in a sibling component so the cell remains below its file-length limit. The syntactic manual-import guard does not count the removed registry descriptor callbacks, so its global allowance file is unchanged. The remaining MCP host registration is separate follow-up work; this change does not alter its frame, lease, or teardown contracts.

Visual proof

Inspected synthetic-only before/after captures are attached below.

Before: synthetic report widget

After: native lazy report widget

Final CI attribution

Full CI run39909839428 completed on 901013a48946f5f1a9e8d969f2e23963025aae6e. Selected static checks, UI units, performance and security-fast passed. Five E2E jobs contain 16 failing test names, and every one also fails in completed scheduled main run39906351041 at 6e4f76bc9f92891851ab0415393a41b2683f1d17. The native inherited-failure route retains CI as failed.

Exact failing test names matched to main

checks-ui-e2e-real-gateway (1/2)

  • ui/src/e2e/provider-browser-login.real-gateway.e2e.test.ts > Provider browser login through real HTTPS Gateway > rejects cancelled and stale callbacks, then saves a fresh sign-in and serves an existing session

checks-ui-e2e (1/9)

  • ui/src/e2e/mobile-sidebar-session-menu.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps mobile sidebar titles and menus usable with a coarse pointer
  • ui/src/e2e/mobile-sidebar-session-menu.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps mobile sidebar titles and menus usable with a fine pointer
  • ui/src/e2e/cloud-workspace-conflict.e2e.test.ts > Control UI cloud workspace conflict recovery > exposes the full request diagnostic with keyboard and clipboard access
  • ui/src/e2e/session-management.rename.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps a duplicate rename in the dialog (concurrent failure: false)

checks-ui-e2e (6/9)

  • ui/src/e2e/browser-dictation-status.e2e.test.ts > Control UI browser dictation status > dictates during a running turn and sends explicitly (wait for completion: true)
  • ui/src/e2e/browser-dictation-status.e2e.test.ts > Control UI browser dictation status > preserves the draft through caret insertion
  • ui/src/e2e/browser-dictation-status.e2e.test.ts > Control UI browser dictation status > preserves the draft through selection replacement

checks-ui-e2e (7/9)

  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps dark child rows stable through loading and refresh at 1440 px with a fine pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps light child rows stable through loading and refresh at 1440 px with a fine pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps dark child rows stable through loading and refresh at 390 px with a fine pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps light child rows stable through loading and refresh at 390 px with a coarse pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps light child rows stable through loading and refresh at 390 px with a fine pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps dark child rows stable through loading and refresh at 390 px with a coarse pointer and 100% text
  • ui/src/e2e/sidebar-session-stability.e2e.test.ts > Control UI session management mocked Gateway E2E > keeps dark child rows stable through loading and refresh at 1440 px with a fine pointer and 140% text

checks-ui-e2e (5/9)

  • ui/src/e2e/session-management.filtered-errors.e2e.test.ts > Control UI session management mocked Gateway E2E > clears the visible All sidebar error after its failed roster recovers or retires

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 23, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-23T06:14:52.107028Z 901013a 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 commented Oct 23, 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 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: 46387f6c85

ℹ️ 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 +68 to +71
let connected = true;
onSettled(() => () => {
connected = false;
});

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 Cancel stale-chunk recovery when the widget retires

When a core widget import fails with a recognized stale-chunk error, the global vite:preloadError listener can already have started scheduleStaleChunkReload; this cleanup only marks the fallback disconnected and never cancels that recovery. If the user hides the board or navigates away while the Gateway is still unreachable, the recovery can therefore reload the document later after the widget is inactive or disposed. The removed createLazyCustomElementRequests.abandon() path called cancelStaleChunkRecovery() for this case, so the new boundary needs equivalent cancellation on deactivation/disposal.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR replaces registration polling for four built-in board widgets with native Solid loading and error boundaries.

Example: A session:report widget fails, then the user hides and reopens its dashboard.

  • Before: Reactivation automatically retries the failed registration request.
  • After: The error remains visible with an explicit Retry action.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, focused ownership reduction with inspected rendering evidence, but a verified recovery-lifetime regression blocks merge.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected browser captures exercise the report renderer, while the supplied lifecycle tests use a held import and injected render failure.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Built-in board widgets should load independently, stay cold before activation, and retain their controls when hidden and shown.
Reason: Maintainer authorship establishes direction, and the scoped change replaces registration polling with the repository's native Solid loading pattern.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this PR open: the maintainer-directed Solid cutover is useful, but it drops cancellation of automatic stale-chunk recovery when a failed widget retires.

Priority: P2
Reviewed head: 46387f6c857656565f1b3e8af4b28dd34a4eb5c0

Before merge

  • Cancel automatic stale-chunk recovery when the widget retires (P2) - If a widget import fails with a recognized stale-chunk error while the Gateway is unreachable, the global vite:preloadError listener starts scheduleStaleChunkReload(). Hiding the widget or navigating away then only changes activity or sets connected=false; neither cancels that automatic recovery, whose caller has no widget-specific canReload check. When the Gateway becomes reachable, it can reload the unrelated current page. The removed requestWhileActive/abandon path called cancelStaleChunkRecovery() for this case. Restore that existing cancellation on deactivation and disposal, and cover the delayed-reachability case.
  • Explain or restore the original intent of Retired stale-failure recovery - 233f1f0: fix(ui): stop dismissed lazy retries from reloading the page #130988 prevents dismissed lazy requests from navigating the page after a delayed reachability probe.

Findings

  • [P2] Cancel automatic stale-chunk recovery when the widget retires — ui/src/components/board/core-board-widget.tsx:69-71

Provenance

Tests

  • Missing end-to-end proof: The supplied browser captures establish rendered-report parity, but no production-browser trace demonstrates failed-import recovery retirement, and no red-on-base regression for that invariant is shown.
Agent review details

How this fits together

Board cells receive saved widget data, session context, activity, and advertised widget kinds, then render a built-in component while existing owners retain frame and Gateway responsibilities.

flowchart TD
  A[Saved board widget] --> B[Board cell]
  C[Advertised widget metadata] --> B
  B --> D[Core Solid boundary]
  D --> E[Lazy widget component]
  D --> F[Error and Retry surface]
  F --> G[Shared stale chunk recovery]
Loading

Technical review

Best possible solution:

Keep the native Solid boundary and retire stale-chunk recovery through its existing owner whenever a failed widget deactivates or disposes.

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

The introduced regression is traceable from a recognized import failure through the global preload listener to an uncanceled reload after widget retirement; no target code was executed.

Is this the best way to solve the issue?

The focused Solid cutover uses existing renderers and removes the replaced registration path, but its lifetime handling must preserve the existing recovery cancellation contract.

Full review comments:

  • [P2] Cancel automatic stale-chunk recovery when the widget retires — ui/src/components/board/core-board-widget.tsx:69-71
    If a widget import fails with a recognized stale-chunk error while the Gateway is unreachable, the global vite:preloadError listener starts scheduleStaleChunkReload(). Hiding the widget or navigating away then only changes activity or sets connected=false; neither cancels that automatic recovery, whose caller has no widget-specific canReload check. When the Gateway becomes reachable, it can reload the unrelated current page. The removed requestWhileActive/abandon path called cancelStaleChunkRecovery() for this case. Restore that existing cancellation on deactivation and disposal, and cover the delayed-reachability case.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/components/board/board-widget-cell-plugin.test.ts --maxWorkers=1
  • pnpm test ui/src/app/stale-chunk-reload.test.ts --maxWorkers=1
  • pnpm test ui/src/lib/board/widgets/index.test.ts --maxWorkers=1
  • pnpm tsgo:ui
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9ca289a adds ui/src/components/board/board-widget-cell.solid.tsx:115 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9ca289a1e1ef; files: ui/src/components/board/board-widget-cell.solid.tsx)

PR surface

Source +44, Tests +48. Total +92 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 107 63 +44
Tests 3 59 11 +48
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 166 74 +92

Review metrics

Metric Value Why it matters
Production versus test growth Production +44 lines; tests +46 lines; test isolation configuration +2 lines The growth introduces a focused loading/error boundary and distinct cold-load, retry, retention, and live-prop assertions while removing registration polling.

Labels

Label changes:

  • add P2: A failed lazy widget can unexpectedly reload the document after navigation or hiding, with impact limited to stale-chunk recovery.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp 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:

  • P2: A failed lazy widget can unexpectedly reload the document after navigation or hiding, with impact limited to stale-chunk recovery.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp 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 23, 2026, 12:35 AM ET / 04:35 UTC.

@steipete
steipete merged commit 021bdf1 into main Oct 23, 2026
117 of 126 checks passed
@steipete
steipete deleted the solid2/w-zero-board-widgets branch October 23, 2026 06:48
@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 24, 2026
…nclaw#181314)

* refactor(ui): give core board widgets one Solid loading boundary

* fix(ui): retire stale board recovery when hidden

* test(ui): document isolated stale widget renderer
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. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M 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