Skip to content

refactor(ui): deslop UI core - #164011

Merged
steipete merged 4 commits into
mainfrom
deslop/l317-deslop-ui-core-20261002
Oct 3, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/l317-deslop-ui-core-20261002

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Control UI carries duplicate state, encoding, presentation, and CSS paths, including styles for companion layouts that no longer render.

User Impact

Normal UI rendering, translations, storage keys, and Gateway shapes stay the same. This batch also fixes:

  • Terminal event listeners leaking when an attach replay is malformed.
  • Plugin command descriptions breaking for prototype names such as constructor.
  • MCP onboarding failing on supported insecure origins without crypto.randomUUID.

Why This Change Was Made

Reuse the existing UI owners for encoding, presentation subscriptions, session operations, command descriptions, and menu construction; remove obsolete companion styles and duplicate CSS declarations. The bundled terminal UI uses its current same-version Gateway offset protocol. External-client compatibility remains server-owned.

The batch removes 1,054 net production lines (+835/−1,889), plus 77 net test/support lines: 1,132 fewer lines overall, including the shrink-only assertion baseline correction. All production changes stay inside ui/; the only additional file is the assertion-safety baseline. No Gateway client, plugin SDK, configuration, or storage contract changes.

Evidence

The first exact-head CI attempt (37094291111) correctly required three assertion-baseline shrink updates caused by this cleanup: display.ts 6→5, chat-avatar.ts 1→0 (row removed), and stream-reconciliation.ts 3→1. Corrected in 0306c398bd46954f049eea9b9c18d64559e5bebe; the full ratchet passes across 3,060 files / 7,647 grandfathered assertions, and the focused independent review is clean. Fail-fast cancelled 34 jobs in that first attempt; those cancellations are not passing coverage. This was a PR-caused failure, not an inherited-main exception.

The second exact-head CI attempt (37095349470) passed all three UI unit shards (1,038 combined job-wall seconds), the assertion ratchet, and the performance job. It exposed one incomplete terminal fixture migration: a 19-unit output declared offset 17 and correctly triggered recovery. 4cdb4e58eff39a67d0e7f26f46845de419f5b2bb corrects that payload and two sibling zero-offset fixtures using each unchanged string’s .length, retaining every assertion. The three affected bundled E2E files pass 10/10 tests in 108.77 s Vitest wall time at one worker; formatting, targeted lint, and independent review pass. UI E2E shard 8/9 was collateral cancellation, not a second failing root.

Final exact-head CI 37096865729 passed for 4cdb4e58eff39a67d0e7f26f46845de419f5b2bb. The complete 139-file review confirms no configuration schema/default or persisted-format change; the generic compatibility flags caused by truncated file-list metadata do not represent a source change requiring migration. ClawSweeper's current-head technical review reports no actionable defect or security finding.

  • All seven new regression cases failed against the original production source for the expected reasons, then passed with the fixes.
  • Prior focused proof: 1,957 tests / 71 files; integrated proof: 690 tests / 20 files; additional browser proof: 95 tests / 10 files. These selections overlap and are not additive.
  • Rebased-head rerun: both previously interrupted suites passed, 77 tests / 2 files, using pnpm test ui/src/pages/chat/components/chat-session-workspace.test.ts ui/src/pages/chat/components/chat-sidebar.test.ts --maxWorkers=1 through the equivalent direct Node wrapper. Wrapper wall time: 97.32 s (Vitest: 86.13 s). The second exact-head run passed all three UI unit shards; their combined job-wall time is recorded above.
  • UI production typecheck, both import-cycle checks (zero cycles), candidate UI build, and matched-toolchain main-baseline build all pass. The performance checker reports no violations. Prior final UI lint, stylelint, and i18n checks pass; the rebase is patch-identical.
  • Fresh independent Codex review: completed with two P2 suggestions rejected after checking the owner contracts: bundled UI/Gateway version skew is unsupported by ui/AGENTS.md, and the removed facade exports belong to the private UI package, with all consumers migrated. The public terminal protocol/server compatibility remains intact. No accepted actionable finding remains.
  • Remote attempt: the wrapper-owned Blacksmith Testbox stayed queued beyond the ten-minute availability window; it and the earlier unowned-allocation attempt were stopped. Final validation used the authorized serial nice -n 15 local fallback.
  • Known prior browser limitation: four responsive-suite cold-Vite startup failures reproduce on clean main. A separate blank-page initialization timeout occurred before UI content loaded; the focused layout probe passed without a source change. No timeout, retry, threshold, or assertion was weakened.

Bundle measurements

Both builds use one Vite 8.3.1 toolchain and a normalized build identity. Budget limits are unchanged.

Baseline: 704fbb812e1c7157df999343b81c5bcef452e390; measured runtime candidate: 8d480d01541833a85b7704ee4ee9165bae7dc312. Subsequent corrective commits change only baseline counts and test fixtures; the runtime build and visual proof remain applicable to 4cdb4e58eff39a67d0e7f26f46845de419f5b2bb.

Gzip bytes Main baseline Candidate Change
Startup JS 373,161 373,125 −36
Startup CSS 50,768 50,708 −60
Combined startup 423,929 423,833 −96
Total JS 9,414,746 9,414,204 −542
Total CSS 238,235 237,215 −1,020

New-session ready-route JS also shrinks by 14 B and CSS by 137 B. Its one additional deferred request remains within the existing route budget. The pre-existing startup CSS advisory remains above its soft target, with 492 B of hard-ceiling headroom.

Visual parity

38/38 screenshot states match exactly, retaining the original 36 matching pairs and replacing both disputed surfaces with fresh desktop/narrow captures. Synthetic Gateway data, fixed clock/randomness, and fixed latency are used throughout.

The supposed appearance-icon delta was a 2×2 Language-card border corner; settled recaptures match. The model-dialog difference reproduced with the identical baseline build on both sides. All 405 desktop / 418 narrow measured elements also had identical geometry and computed styles. Explicitly settling the page and capturing with Playwright animations: "allow" instead of "disabled" removed the capture-time difference. No production revert was warranted.

Visual baseline: ac96ec93fa9554428992841a686d494cfd34edc9; the final rebase preserved both patches exactly, and intervening UI changes only refresh foreign-language catalog metadata/translations. These English fixtures and rendering source are unchanged by that integration.

Pixel-identical appearance and model-dialog pairs

Consolidate browser data readers, presentation subscriptions, state and request forwarding, chat rendering helpers, and duplicate CSS. Remove styles for retired companion rail and dock renderers while retaining the embedded UI.

Also repair malformed terminal replay listener cleanup, prototype-named command descriptions, and MCP onboarding where crypto.randomUUID is unavailable. Original-source regression probes fail as expected; focused UI proof passes 1,957 tests across 71 files. Bundle, browser, cycle and hosted gates follow before publication.
@clawsweeper

clawsweeper Bot commented Oct 3, 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.

@steipete
steipete marked this pull request as ready for review October 3, 2026 03:45
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 3, 2026, 12:38 AM ET / 04:38 UTC (Revision 3).

ClawSweeper review

What this changes

The Control UI consolidates rendering, subscriptions, encoding, menus, and styles while repairing terminal replay cleanup, plugin command descriptions, and MCP app onboarding.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: the cleanup and fixes remain useful against current main, and no blocking introduced defect was found. Source inspection does not support retaining the previous generic configuration/upgrade warning.

Priority: P2
Reviewed head: 4cdb4e58eff39a67d0e7f26f46845de419f5b2bb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful consolidation with inspected visual parity, focused reported validation, and no supported blocking finding.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: Repository State identifies a MEMBER author, so the external-contributor runtime gate does not apply. Inspected browser before/after images support settings-layout parity; recorded regression tests supplement the terminal, command, and onboarding fixes. No persisted data-model contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository State identifies a MEMBER author, so the external-contributor runtime gate does not apply. Inspected browser before/after images support settings-layout parity; recorded regression tests supplement the terminal, command, and onboarding fixes. No persisted data-model contract changes.
Evidence reviewed 9 items Pinned introduction and review continuity: Reviewed the merge-base-to-head delta. The change since the previous reviewed head only corrects three terminal E2E output offsets, retaining their assertions; it introduces no production change.
Terminal compatibility boundary: The fully read UI policy defines same-version UI/Gateway coupling. The browser advertises terminal-offset-seq, and the unchanged server includes the replay offset for that capability while retaining its external-client compatibility handling.
Replay cleanup remains necessary: Current main validates malformed attach responses after the listener-holding request has completed. The branch moves replay validation inside that request's failure cleanup, allowing malformed responses to release the listener.
Findings None None.
Security None None.

How this fits together

The Control UI turns Gateway state and browser input into chat, terminal, sidebar, and settings views. Its controllers manage presentation and requests while the Gateway remains the shared-state owner.

flowchart LR
  A[Browser input] --> B[UI controllers]
  C[Gateway state] --> B
  B --> D[Shared rendering and encoding]
  D --> E[Chat and sidebar views]
  D --> F[Terminal and settings views]
  B --> G[Gateway requests]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test footprint production +835/-1889; tests/support +272/-349 The net reduction reflects shared-owner consolidation and removal of retired rendering paths rather than production growth.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep the existing UI owners consolidated while preserving Gateway authority, stored-state contracts, and rendered behavior.

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

Yes, source provides concrete paths for malformed terminal replay listener retention and MCP onboarding without crypto.randomUUID; no runtime reproduction was executed in this read-only review.

Is this the best way to solve the issue?

Yes, reusing existing owners and removing unreachable compatibility/rendering paths is a maintainable approach; the inspected changes preserve supported configuration and storage contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P2: The cleanup includes bounded terminal, command-description, and onboarding fixes without evidence of an urgent user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository State identifies a MEMBER author, so the external-contributor runtime gate does not apply. Inspected browser before/after images support settings-layout parity; recorded regression tests supplement the terminal, command, and onboarding fixes. No persisted data-model contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Repository State identifies a MEMBER author, so the external-contributor runtime gate does not apply. Inspected browser before/after images support settings-layout parity; recorded regression tests supplement the terminal, command, and onboarding fixes. No persisted data-model contract changes.

Evidence

What I checked:

  • Pinned introduction and review continuity: Reviewed the merge-base-to-head delta. The change since the previous reviewed head only corrects three terminal E2E output offsets, retaining their assertions; it introduces no production change. (ui/src/e2e/claude-sessions.e2e.test.ts:353, 4cdb4e58eff3)
  • Terminal compatibility boundary: The fully read UI policy defines same-version UI/Gateway coupling. The browser advertises terminal-offset-seq, and the unchanged server includes the replay offset for that capability while retaining its external-client compatibility handling. (src/gateway/server-methods/terminal.ts:600, 4cdb4e58eff3)
  • Replay cleanup remains necessary: Current main validates malformed attach responses after the listener-holding request has completed. The branch moves replay validation inside that request's failure cleanup, allowing malformed responses to release the listener. (ui/src/components/terminal/terminal-connection.ts:297, e159e3bcf618)
  • Stored-state compatibility assessment: The introduced boot-record parser extraction preserves validation, scope matching, expiration, credential admission, and storage keys. The durable composer change relocates the identical Blob-to-data-URL reader without changing persisted records or write/recovery contracts; no data-model migration is introduced. (ui/src/app/boot-record.ts:137, 4cdb4e58eff3)
  • Onboarding and security-preserving UUID reuse: Current main still calls crypto.randomUUID directly during MCP onboarding. The branch uses the existing normalization owner, whose fallback uses getRandomValues and refuses UUID generation without Web Crypto. (packages/normalization-core/src/uuid.ts:17, 4cdb4e58eff3)
  • Inspected visual evidence: Opened the prepared image linked at https://github.com/user-attachments/assets/1c78ba2c-cdd7-45f6-a391-6972a38df469. Its four before/after pairs show matching desktop and narrow appearance settings and provider-dialog layouts. This directly supports visual parity, not terminal cleanup or network/security behavior. The captured body reports 38 matching states and identifies the runtime candidate; later corrections only affect baseline counts and test fixtures. (8d480d015418)

Likely related people:

  • Peter Steinberger: Raw commit 96dbb3a adds ui/src/lit/presentation-binding.ts:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 96dbb3a20f3c; files: ui/src/lit/presentation-binding.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-03T03:51:09.362Z sha 8d480d0 :: blocked before merge. :: none
  • reviewed 2026-10-03T04:13:00.068Z sha 0306c39 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 3, 2026
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 3, 2026
@steipete
steipete merged commit 8bb7fb2 into main Oct 3, 2026
113 checks passed
@steipete
steipete deleted the deslop/l317-deslop-ui-core-20261002 branch October 3, 2026 04:45
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
* refactor(ui): deslop UI core

Consolidate browser data readers, presentation subscriptions, state and request forwarding, chat rendering helpers, and duplicate CSS. Remove styles for retired companion rail and dock renderers while retaining the embedded UI.

Also repair malformed terminal replay listener cleanup, prototype-named command descriptions, and MCP onboarding where crypto.randomUUID is unavailable. Original-source regression probes fail as expected; focused UI proof passes 1,957 tests across 71 files. Bundle, browser, cycle and hosted gates follow before publication.

* refactor(ui): finish canonical command copy and style consolidation

* chore(ui): shrink assertion baseline after cleanup

* test(ui): use terminal offsets in E2E fixtures
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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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