Repository navigation
refactor(ui): deslop shared components and libraries - #156740
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: blocked before merge. Reviewed September 23, 2026, 10:36 PM ET / September 24, 2026, 02:36 UTC (Revision 9). ClawSweeper reviewWhat this changesThe branch simplifies shared Control UI components and libraries for sessions, settings, browser and Board views, terminal controls, and chat display while reducing the assertion baseline. Merge readiness⛔ Blocked before merge - 2 items remain This remains useful work that current main has not absorbed. The earlier browser import-cycle finding is resolved, and the reviewed owner paths show no discrete introduced defect. The prior compatibility concern came from truncated file metadata; the complete changed-file inventory does not show a config, protocol, or stored-data contract change. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI turns Gateway state into web views for sessions, settings, browser activity, and other tools. User actions pass through UI controllers and stores to Gateway requests, whose results update those views. flowchart LR
A[Gateway state] --> B[Control UI stores]
B --> C[Shared session and settings logic]
B --> D[Browser and Board controllers]
C --> E[Rendered web views]
D --> E
F[User actions] --> C
F --> D
C --> G[Gateway requests]
D --> G
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep each Control UI workflow on its existing state owner, preserving scoped async-result checks and the current Gateway contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor does not report a user-facing failure to reproduce; its stated goal is equivalent behavior with fewer duplicated UI paths. Is this the best way to solve the issue? Yes, based on the reviewed paths: the branch reuses existing UI owners while retaining the sampled connection, mutation-access, and stale-result checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8c870f669e35. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
00dee31 to
c782fa1
Compare
c782fa1 to
7ede99b
Compare
7ede99b to
056f08f
Compare
|
Merged via squash.
|
* refactor(ui): deslop shared components and libraries * refactor(ui): consolidate shared component and library owners * refactor(ui): preserve acyclic browser host contracts
Consolidate config rendering, sidebar/session bookkeeping, and common formatting helpers while removing unused forwarding and derived state. Preserve component, Gateway, route, preference, and accessibility contracts. Fix generic filename glyphs, file-preview type labels, and session channel labels for prototype-shaped names. Clear geolocation when its IP is removed. Second-pass follow-up to #156740 with page importers from #158032 covered.
Consolidate config rendering, sidebar/session bookkeeping, and common formatting helpers while removing unused forwarding and derived state. Preserve component, Gateway, route, preference, and accessibility contracts. Fix generic filename glyphs, file-preview type labels, and session channel labels for prototype-shaped names. Clear geolocation when its IP is removed. Second-pass follow-up to #156740 with page importers from #158032 covered.
Consolidate config rendering, sidebar/session bookkeeping, and common formatting helpers while removing unused forwarding and derived state. Preserve component, Gateway, route, preference, and accessibility contracts. Fix generic filename glyphs, file-preview type labels, and session channel labels for prototype-shaped names. Clear geolocation when its IP is removed. Second-pass follow-up to #156740 with page importers from #158032 covered.
Consolidate config rendering, sidebar/session bookkeeping, and common formatting helpers while removing unused forwarding and derived state. Preserve component, Gateway, route, preference, and accessibility contracts. Fix generic filename glyphs, file-preview type labels, and session channel labels for prototype-shaped names. Clear geolocation when its IP is removed. Second-pass follow-up to openclaw#156740 with page importers from openclaw#158032 covered.
What Problem This Solves
Shared Control UI components and libraries repeat forwarding layers, state-owner projections, mutation settlement, and rendering decisions. Each copy increases the chance that one path misses an ownership guard or drifts from the same UI behavior elsewhere.
User Impact
No intended behavior or appearance change. CSS, visible copy, translation keys, config/protocol/storage schemas, CLI contracts, and plugin SDK exports are unchanged.
Why This Change Was Made
This maintainer-requested subsystem sweep removes duplication around existing owners:
The sweep read all 247 production files over 200 lines in its inventory of the two owned subtrees and recorded a per-file outcome. It preserves larger owners where their receipts, request identity, persistence, or rendering contracts differ.
Production reduction at the final head: 1,085 net lines.
Measured with
git diff --shortstat $(git merge-base origin/main HEAD) -- . ':(exclude)**/*.test.*' ':(exclude)**/test/**' ':(exclude)docs/**'.Evidence
The full sweep proof ran on base
2cb62af8ba92992a21c850e2f28a740b8c99d983. After the type-contract rollback, architecture, scoped changed-file checks, browser tests, E2E, and build were rerun on base5e20a15ffe76ef51a2426f9cd85b52e11fe70d0b. The final rebase preserves the commit patches, with hosted CI bound to the final head.056f08fb2cdbaf2e92834d28c17a09339e42ea31.node scripts/check-changed.mjs: passed with exit 0: all 25 core test type graphs, production UI types, formatting, i18n, ratchets, three zero-entry dead-export scans, core/script lint, and UI style lint.node scripts/run-vitest.mjsover the focused and resolved reverse-import selections: passed 1,178 files and 20,874 cases, with one existing skip, across eight routed shards in 595.95s; includes 82 Chromium files and 1,017 browser cases.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runnerover 21 selected mocked-Gateway flows: passed all 21 files / 116 unique cases across the initial run and the three-file environment-repaired replay (19/19 replay cases). The separate plugin-skill bundle browser flow also passed 6/6 tests.pnpm check:architecturepassed (zero runtime and Madge cycles);node scripts/check-changed.mjs -- ui/src/components/browser/browser-panel-{controller-input,download,native-controller,native-presentation,snapshot-controller,stream,viewport-controller}.tspassed, including all 25 type graphs; browser/direct-caller tests passed 29 files / 362 cases, and six browser E2E files passed 45 cases.pnpm build: passed again after the correction in 6m23.4s, including the production UI bundle and all 158 SDK export checks.pull_requestrun for056f08fb2cdbaf2e92834d28c17a09339e42ea31. Architecture, both formerly failing tooling shards, all 3 UI jobs, all 9 UI E2E jobs, build artifacts, andopenclaw/ci-gatepassed. The native exact-head watcher exited 0 (GREEN).ClawSweeper’s review of the final head reports no actionable findings and confirms the prior browser cycle is removed. Its remaining compatibility checklist comes from
unknown-truncated-pull-filesmetadata. Compatibility review used the complete 100-file Git diff: only the two UI subtrees and the assertion-count shrink ratchet changed; config, protocol, and stored-data shapes are preserved, with schema/scalar parity proof above. No migration is needed.The changed-file translation-call inventory is identical to base: 455 literal keys and 14 existing dynamic expressions; the conditional key choices retain the original literal sets.
Changed-test single-worker costs (
pnpm test <file> --maxWorkers=1): exec-approval-card 12.79s wall; app-sidebar-catalog-menu 14.78s; dock-panel-layout 39.32s on the loaded local host. Earlier unchanged browser test edits measured 17.97s and 12.97s. Hosted UI job costs on the final head, including setup: shard 1/3 369s; 2/3 375s; 3/3 333s. All nine UI E2E jobs passed (276–521s each).The remote runs used Blacksmith Testbox with native source-tree and explicit file-hash verification:
tbx_01m38961msge93nkf7df7p0gd2tbx_01m38bm3h8fmhdnxmsncr08avjtbx_01m38gc00qffd8tqtv8ky4n4wtThe wrapper exit and timing result own Testbox proof; normal one-shot cleanup may cancel its backing Actions step.
Investigated failures and rejected sub-changes
The first expanded exact-head CI run, on
7ede99bd7ec, found one introduced architecture failure: deriving browser child contracts fromBrowserPanelControllercreated a type-import cycle. The runtime cycle check stayed at zero, but Madge correctly rejected the dependency graph. Matched local proof found one cycle on the candidate and zero on clean base5e20a15ffe76; restoring the original child-host contracts returned the candidate to zero. All seven modules emit identical JavaScript after whitespace normalization. The responsible simplification was reverted; no cycle rule or ignore was changed. Two independent tooling failures in that run were repaired by main-owned fixes10145049f81(wrapper closure inventory) anda018e414bb9(Codex database-worker test routing); both are included by the final rebase. Matched Node 26.5/macOS whole-file runs on candidate and clean base each finished with 6 failures and 382 passes: both reproduced the exact unresolved plugin-loader import, plus the same five project-config fixture failures (timeouts and subsequent selection assertions). A single clean-base focused ownership probe reached the original CI assertion and reproduced the exact two missing Codex paths; the corresponding candidate-local probe hit the unchanged 120s deadline. These limitations are retained; no timeout was raised and no passing replay is presented as a fix.A proposed outbox codec regrouping broke the existing canonical JSON read-back guard by moving
sessionKeyahead ofsendAttempts. The candidate reproduced 11 failures across four existing test files; a clean merge-base worktree passed all 420 cases. The entire codec simplification was reverted. The corrected candidate passed those 420 cases plus all 10 dock-layout tests, with no changed assertion or guard. There is no remaining codec diff.The subsequent static run passed all type graphs and three dead-export scans, then rejected object spreads inside the command-argument map. That projection sub-change was restored verbatim to base; the command wrapper/comparator simplifications remain. The eight command/caller files passed all 1,062 cases in 12.22s, and the final static gate was rerun.
The first static run found an orphaned
DockPanelSideexport after its final production forwarding caller was removed. The alias was removed, and the existing test now derives the identical type fromDockPanelPlacement.The expanded E2E run passed 109/116 cases; seven recording cases in three files stopped before page creation because the Testbox lacked Playwright’s ffmpeg binary. The recovery run installed that test-environment binary and passed the three entire files plus the previously unrun build. No source or assertion was changed for this environment repair.
The first remote test preflight incorrectly compared the synthetic source-carrier commit with the ordinary local HEAD. It stopped before running tests. The corrected preflight uses the native verified source capsule/base, physical checkout, and explicit file-byte checks; no source verification was skipped.
Initial review reports about config unions and channel single-select steps omitted unchanged early returns; complete-function evidence resolved them. Two browser reports concerned code identical to the base apart from a forwarding-method rename. A later scalar fallback report was also contradicted by the complete base function: both versions prefer a valid numeric candidate before falling back to the string; the 27,720-case comparison confirms equivalent outputs. An intermediate review’s lightbox report was rejected against the complete owner: unchanged
destroyPanzoom()already resetsimageReady, so the removed second assignment is redundant;resetZoom()is unchanged. The fresh final review completed all 13 passes with no findings.The prior server CI failures were independently attributed. The public-share fixture repair is
db8095d7ce4; the Workshop clock repair is764c9331a31b, which superseded #156776. Both are included by the final rebase. The previous supplemental real-Gateway agent-file scenario exceeded its unchanged startup deadline on both candidate and clean base, before any UI mutation; no successful real-Gateway proof or screenshots are claimed. The changed UI paths are covered by the mocked-Gateway/browser checks above.The build retains the documented unchanged Mermaid vendor-asset warning: 1,555.8 KiB gzip versus the 960 KiB advisory budget. Earlier base/candidate builds emitted the identical content-addressed asset and showed zero CSS-size change; no budget was relaxed.
No SDK export or extension boundary changed, so the conditional SDK/extension suites do not apply. No test budget, timeout, snapshot, ignore, or assertion was weakened. The existing assertion-count baseline decreases only from 3 to 2 for the removed redundant cast.