Repository navigation
refactor(ui): replace lazy element controller with request factory - #174032
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces the lazy custom-element controller with a synchronous request factory and migrates its consumers to explicit subscriptions. Example: Open the command palette before openclaw-command-palette is registered.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it completes an owner-directed Solid cleanup, preserves the existing lazy-loading contracts, and introduces no actionable correctness finding. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI request owner receives optional-element descriptors and actions, coordinates shared module registration and recovery, and publishes loading state to shell and page consumers. flowchart LR
A[Shell and page actions] --> B[Request factory]
B --> C[Shared module registration]
C --> D[Custom element registry]
B --> E[Owner subscriptions]
E --> F[Solid views]
F --> G[Render completion]
G --> B
B --> H[Action replay or recovery]
Technical reviewBest possible solution: Complete this focused factory cutover while preserving synchronous request ownership and the existing recovery and replay boundaries. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor, so no failing product reproduction is claimed or required. Is this the best way to solve the issue? The factory keeps the existing synchronous owner and adopts the established projection adapter without creating a competing loader or changing lazy boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3aa642027ea1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -27, Tests +69. Total +42 across 21 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 16, 2026, 4:53 AM ET / 08:53 UTC. |
|
Merged via squash.
|
…penclaw#174032) * refactor(ui): project lazy element requests into Solid * refactor(ui): use canonical lazy-request cancellation
What Problem This Solves
Lazy custom-element requests still relied on a controller host callback and ad hoc revision signals in their Solid consumers. Replace the controller with a synchronous request factory and explicit subscriptions. Solid views use the existing owner projection; retained domain owners publish through their existing notification path.
The request owner still controls request identity, cancellation, stale-chunk recovery, preload publication, and the render-before-action-replay barrier. Global registration remains deduplicated by tag. The shell retains its production retry callback to persist pending actions across reload. Cancellation now uses the canonical recovery owner directly, removing a test-only injection.
All callers move together, including the recently landed new-session and chat-question consumers. The board regression waits for its real module import and verifies that loading yields to report content. No routes, tags, selectors, markup, styling, or lazy boundaries change; screenshots are not applicable to this ownership refactor.
Evidence
c316ecaacdefcand this head: JS gzip 347,796 → 347,730 B (−66 B), raw 1,055,829 → 1,055,110 B; 8 JS / 1 CSS requests; CSS 38,786 B gzip unchangedui/src/pages/chat/chat-tool-icon-controller.ts:PluginToolIcon. No new findings or ignores.ci:fullrun 38874967816, exact head0d605ef155c3cc; no local E2E or paritycreateEffectcallsuntrackcallsaddEventListenercallsProduction shrinks by 27 lines; tests grow from 3,589 to 3,658 lines. Controller references count controller class declarations,
ReactiveController/ReactiveControllerHost, lifecycle hooks, andrequestUpdate. The remaining references belong to coupled owners outside this factory cutover. Added tests protect distinct subscription disposal, preload, replay-order, and deferred-registration boundaries. The simplification pass removed the obsolete class, manual notification counters, liveness flags, and cancellation seam.