Skip to content

refactor(ui): inline sidebar presentation owners - #177887

Merged
steipete merged 6 commits into
mainfrom
solid2/w-deslop-sidebar-controls
Oct 20, 2026
Merged

steipete merged 6 commits into
mainfrom
solid2/w-deslop-sidebar-controls

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Sidebar and settings rendering passed through single-caller component and event-handler layers that repeated props and obscured the existing lifetime owners. Inline those layers into their callers, remove the three unused files, and retain the same rendered hosts, classes, routes and callbacks.

The agent card remains a local component beneath its existing Show, so avatar loading and cleanup stay conditional. Save feedback retains its two-second saved interval, the theme toggle stays in the lazy identity menu, and native controls preserve rejected-change rollback, disabled behavior, reselection and RTL keyboard navigation. Current main’s direct ThemeBrandIcon renderer and removal of the unused ariaPressed option are preserved. The remaining reductions inline single-caller toolbar/plugin-tab adapters and the settings-search predicate, and remove absent-context branches from the required-context owner.

Proof Result
Production LOC, affected files 3,575 → 3,444 (−131) against main e417802; six tests 1,477 → 1,491 (+14); test helper unchanged
UI typecheck pnpm tsgo:ui passed
Selected local tests 16 passed across settings-save-indicator.test.ts, settings-ui.browser.test.tsx, control-ui-environment.test.ts; each file once, --maxWorkers=1, default pinned runtime
Lint / format Passed; four local shadow-name errors fixed before final lint
Controller guard Passed; no baseline increases
Production Knip pnpm deadcode:knip passed
Builds / strict performance check One build per side completed on the same machine/check-out; strict checks have the same pre-existing Russian locale pair violation (310,078 B > 307,200 B), while all startup limits pass
Startup JS gzip 325,982 → 325,956 B (−26 B; raw bytes unchanged at 979,131 B), measured base 24afcdf → pre-integration head 0830ea0
Startup CSS 1 → 1 request, 38,492 B gzip unchanged
Final-head hosted performance Tested merge 65d878b (92ca95e + d073ed4): 325,793 B startup JS gzip, 7 requests; 38,492 B CSS gzip, 1 request. Hosted check passed, with a separate 303.7 KiB Russian locale-budget advisory.
Synthetic visual proof All five before/after pairs byte-identical; matching interaction states and callback counts; zero page errors or external requests
Independent review Completed, no actionable P0–P2 findings
CI Final ci:full run 39361481358 on d073ed4: 38 successful jobs, 24 skipped. Six E2E shards and the dependent CI aggregate fail; all 22 failed test names also fail on both completed scheduled main run 39360046029 (84e1848a) and the newer completed run 39365230806 (0244bb44), with zero PR-only failures. Native inherited-failure evidence records complete attempt 1.

Visual proof compares base ba61d5d995261fe6c919ab61b68bd30f7400acc6 with production head 5f76efe57e4cc5103de96643b2fc54d9390489b3; subsequent repairs remove two retired bridge fields from E2E failure diagnostics and one redundant literal role already supplied by the shared Menu. The verified production caller always supplies those bindings, so the rendered DOM remains identical and the visual proof is reused. Startup proof was refreshed separately after the main integration: one build and strict measurement each on base 24afcdfebe8ea39e89ceb6b48e6a531fa48df8dd and pre-integration head 0830ea0a3eb365bcac631d83cca62e83f28c420b. Both strict checks fail only the identical Russian locale-pair budget; neither has a startup violation. The bounded 1200×1400 gallery exercises initial/saved/apply/recovery states, theme cycling, rejected switch changes, row actions, disabled controls, radio keyboard navigation and RTL rejection. Both sides use exact source snapshots (including deleted modules on the before side), with no unlanded prerequisite code. All captures were inspected as synthetic-only. Both sides emit the same six existing STRICT_READ_UNTRACKED console warnings; these are recorded and are not page errors. The initial capture attempt failed at setup because deleted before-side imports needed snapshot resolution; the repaired harness completed both sides.

Solid checklist on touched production: controllers 0→0; effects 2→2; render effects 0→0; untrack 0→0; listeners 0→0; DOM queries 0→0; manual classes 0→0; flush 0→0; memos 34→34. One unchanged domain getOwner call is not a Solid owner escape. No dependency, config option, new state owner or lazy boundary is introduced.

Before/after screenshots below are ordered by initial, saved, apply, recovery, and controls. The first image in each pair is the base.

Before: initial sidebar and settings controls

After: initial sidebar and settings controls

Before: saved sidebar and settings controls

After: saved sidebar and settings controls

Before: apply sidebar and settings controls

After: apply sidebar and settings controls

Before: recovery sidebar and settings controls

After: recovery sidebar and settings controls

Before: controls sidebar and settings controls

After: controls sidebar and settings controls

CI repairs: run 39348823465 exposed obsolete .mode/.menuItem failure diagnostics; those two reads are removed and the exact E2E type config passes. The complete job log from replacement run 39353588468 identified one UI unit failure: shared control ownership > keeps dialogs, menus, and tabs on shared primitives. The direct theme renderer had introduced a literal role="menuitem"; the existing menuAttributes spread already receives that same role from the shared Menu owner. Removing the duplicate preserves the rendered role without weakening the ownership guard. The exact ownership test (3 assertions), existing theme browser test (mode cycle), and UI typecheck pass; a fresh independent review found no issues. Initial abbreviated log/artifact inspection missed the named assertion; no inherited-failure or runner-timeout exemption is claimed.

The same run had one E2E failure, session-owner-assignment.e2e.test.ts > assigns named and self owners through one themed keyboard-accessible submenu: the submenu closed while the requested avatar was already loaded and decoded. The exact case passed once on the branch, its merge base, and CI’s main parent 7902ff19a219ed5ec898497dc7a403fec10f70b5, so the cause of that closure is not established and no inherited-failure exemption is claimed. This keyboard/accessibility case now opens through the existing keyboard helper, keeping all avatar, paint, layout, assignment and keyboard assertions. Separate tests in the same file retain hover traversal coverage. The changed case passes in a single focused rerun. All other jobs in run 39353588468, including both real-Gateway shards, passed.

Integrated main 24afcdfebe8ea39e89ceb6b48e6a531fa48df8dd after #177715 produced a real modify/delete conflict. The settings helper stays deleted; its now-retired option is also removed from the surviving Solid owner. Main’s direct brand renderer and simplified pressed-state expression are retained. UI types and the affected settings browser tests pass on the resolved candidate. Prior visual evidence is reused for unchanged behavior; startup was remeasured on the then-current 24afcdf/0830ea0 base/head. Production Knip and independent P0–P2 review also pass on the resolved candidate. No unlanded branch was merged.

Native landing later found an import-cluster conflict with main e4178022618ea6839e9b75fb74996fd41cd31952. Replacement head d073ed494ef86e5415b217d7f6caec25e4275851 removes both retired imports, keeps main’s lazy Pages component, and retains the retired MCP JSX-interface removal. Root inspection and independent P0–P2 review found no issues; UI types, production Knip, and all three focused Pages/MCP-lifetime tests pass. The earlier paired startup and visual measurements retain their exact source provenance; no further local build or screenshot pass was run for this import-only resolution.

Inherited CI: exact failed test names compared with scheduled main

The CI classifier supplied job-name-only attribution; the retained raw logs were compared by exact test name. A fresh check after scheduled main run 39365230806 completed independently confirmed the same 22 names also fail there; no PR-only name appeared. Every name below fails on both PR run 39361481358 and scheduled main run 39360046029. The test and Custodian owner source objects are identical in the scheduled main, actual CI base 92ca95e, and tested merge 65d878b. All other selected jobs, including both real-Gateway shards, passed. The earlier keyboard owner-assignment repair also passes in this final run.

  • ui/src/e2e/custodian-auto-setup.e2e.test.ts > Custodian automatic AI setup > keeps the existing greeting when automatic setup is not advertised
  • ui/src/e2e/custodian-auto-setup.e2e.test.ts > Custodian automatic AI setup > runs ChatGPT sign-in and refreshes setup (shared=false)
  • ui/src/e2e/custodian-auto-setup.e2e.test.ts > Custodian automatic AI setup > runs ChatGPT sign-in and refreshes setup (shared=true)
  • ui/src/e2e/custodian-auto-setup.e2e.test.ts > Custodian automatic AI setup > shows pending, preserves a failed choice, activates an alternative, and retains dismissal
  • ui/src/e2e/custodian-event-nudge.e2e.test.ts > Control UI custodian event nudge mocked Gateway E2E > does not reopen agent chat when a deferred setup reply arrives after exit
  • ui/src/e2e/custodian-event-nudge.e2e.test.ts > Control UI custodian event nudge mocked Gateway E2E > keeps a blocking startup error next to the composer
  • ui/src/e2e/custodian-event-nudge.e2e.test.ts > Control UI custodian event nudge mocked Gateway E2E > keeps event nudges out of sensitive wizard input
  • ui/src/e2e/custodian-event-nudge.e2e.test.ts > Control UI custodian event nudge mocked Gateway E2E > keeps nudges out of a closed question and sends a parseable skip answer
  • ui/src/e2e/custodian-event-nudge.e2e.test.ts > Control UI custodian event nudge mocked Gateway E2E > renders rich wizard controls and sends typed answers
  • ui/src/e2e/custodian-event-nudge.e2e.test.ts > Control UI custodian event nudge mocked Gateway E2E > shows one consequential nudge and sends its canonical message
  • ui/src/e2e/custodian-onboarding-locale.e2e.test.ts > Control UI onboarding locale > uses the selected Chinese UI locale for the onboarding welcome and keeps replies actionable
  • ui/src/e2e/model-setup-cancel.e2e.test.ts > Control UI first-run wizard cancellation ownership > requires an explicit activation review decision before first-run handoff (Yes)
  • ui/src/e2e/model-setup-reconnect.e2e.test.ts > Control UI model setup same-client reconnect > retains clicked candidate first-run activation before refresh reconnects
  • ui/src/e2e/model-setup-reconnect.e2e.test.ts > Control UI model setup same-client reconnect > retains manual first-run activation through restart during config refresh (reconnect)
  • ui/src/e2e/model-setup-reconnect.e2e.test.ts > Control UI model setup same-client reconnect > retains manual first-run activation through restart during config refresh (reopen)
  • ui/src/e2e/model-setup-reconnect.e2e.test.ts > Control UI model setup same-client reconnect > retains prepared model first-run activation before refresh reconnects
  • ui/src/e2e/model-setup-reconnect.e2e.test.ts > Control UI model setup same-client reconnect > retains provider sign-in first-run activation before refresh reconnects
  • ui/src/e2e/model-setup.e2e.test.ts > Control UI Model Setup mocked Gateway E2E > hands first-run model setup to the custodian in onboarding chrome
  • ui/src/e2e/update-triage.e2e.test.ts > Control UI update failure triage E2E > diagnoses only on demand even when session storage is denied
  • ui/src/e2e/update-triage.e2e.test.ts > Control UI update failure triage E2E > diagnoses only on demand even when session storage is full
  • ui/src/e2e/update-triage.e2e.test.ts > Control UI update failure triage E2E > requires a button press to diagnose a pre-ledger automatic failure without retrying the update
  • ui/src/e2e/update-triage.e2e.test.ts > Control UI update failure triage E2E > requires a button press to diagnose a pre-ledger manual failure without retrying the update

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 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 20, 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-20T02:57:53.511886Z d073ed4 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.

@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: 5f76efe57e

ℹ️ 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".

import { hasSameOriginGatewayTransport } from "../dev-gateway.ts";
import { normalizeAgentLabel, resolveAgentTextAvatar } from "../lib/agents/display.ts";
import { resolveAgentAvatarUrl } from "../lib/avatar.ts";
import { createIdentityAvatars } from "../lib/identity-avatar-loader.ts";

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 Regenerate the boot-module manifest after inlining

This moves the agent-card implementation into an existing boot-path module without regenerating ui/config/control-ui-boot-modules.json, which still lists the deleted ui/src/components/sidebar-agent-card.tsx and ui/src/components/theme-mode-toggle.ts files. Because control-ui-chunking.ts consumes that generated capture to assign boot chunks, the checked-in manifest no longer represents the reachable module graph; run pnpm ui:boot-manifest:gen, commit its output, and verify with pnpm ui:build.

AGENTS.md reference: ui/AGENTS.md:L78-L79

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 20, 2026
@steipete
steipete enabled auto-merge (squash) October 20, 2026 00:54
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR inlines sidebar presentation layers and settings event handlers into their existing callers.

Example: A settings save transitions from saving to saved with changes awaiting application.

  • Before: A custom-element bridge displays Saved for two seconds, then Apply changes.
  • After: The directly rendered Solid component preserves the same feedback and timing.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful ownership cleanup with component-level parity evidence and one confirmed, narrowly repairable UI-check failure.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor-proof gate; inspected screenshots show matching synthetic initial and saved component states, supported by reported focused tests and builds.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No visible behavior change is intended; redundant presentation layers make existing sidebar behavior harder to maintain.
Reason: The maintainer-authored direction continues the established renderer cutover, reduces production code, and preserves existing controls, callbacks, and lifetime owners.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored cleanup open; the refactor preserves the existing owners, but a redundant menu-role assignment causes a focused UI check to fail.

Priority: P3
Reviewed head: 5f76efe57e4cc5103de96643b2fc54d9390489b3

Before merge

  • Use the shared menu binding instead of duplicating its role (P2) - The new literal role="menuitem" makes the shared-control ownership guard fail: web-awesome-migration.node.test.ts detects menu roles outside the shared primitives, and exact-head checks-ui (2/3) reports this file. Its .ts spelling comes from normalizing .tsx filenames. The production caller already forwards MenuItemBindings, whose shared owner supplies the role, so remove this redundant assignment without weakening the guard.

Findings

  • [P2] Use the shared menu binding instead of duplicating its role — ui/src/components/theme-mode-toggle.tsx:24

Tests

  • Missing end-to-end proof: The supplied synthetic gallery does not exercise theme cycling and save feedback through the shipped Control UI shell.
Agent review details

How this fits together

The Control UI sidebar consumes application owners and presentation props, renders navigation and settings controls, and forwards interactions to existing callbacks.

flowchart LR
  A[Application owners] --> B[Sidebar presentation]
  B --> C[Solid components]
  C --> D[Native controls]
  D --> E[Existing action callbacks]
  E --> A
Loading

Technical review

Best possible solution:

Remove the duplicate theme-toggle role assignment and retain the shared menu bindings as its existing owner.

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

The exact-head CI annotation records the ownership assertion failure, and the changed literal role matches its source scanner; no target code was executed during this review.

Is this the best way to solve the issue?

Inlining single-caller layers is consistent with the completed Solid migration, and the retained conditional avatar component preserves its resource lifetime.

Full review comments:

  • [P2] Use the shared menu binding instead of duplicating its role — ui/src/components/theme-mode-toggle.tsx:24
    The new literal role="menuitem" makes the shared-control ownership guard fail: web-awesome-migration.node.test.ts detects menu roles outside the shared primitives, and exact-head checks-ui (2/3) reports this file. Its .ts spelling comes from normalizing .tsx filenames. The production caller already forwards MenuItemBindings, whose shared owner supplies the role, so remove this redundant assignment without weakening the guard.
    Confidence: 1

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 7988bf3bdc00.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/components/web-awesome-migration.node.test.ts --maxWorkers=1
  • pnpm test ui/src/components/theme-mode-toggle.browser.test.ts --maxWorkers=1
  • pnpm test ui/src/components/app-sidebar-identity-keyboard.browser.test.ts --maxWorkers=1
  • pnpm tsgo:ui
  • git diff --check

What I checked:

PR surface

Source -130, Tests +16. Total -114 across 17 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 12 449 579 -130
Tests 5 88 72 +16
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 537 651 -114

Review metrics

Metric Value Why it matters
Production versus test LOC Production −130; tests +16; test helper unchanged The pinned diff removes forwarding layers while adapting existing behavioral tests to direct Solid rendering.

Labels

Label changes:

  • add P3: This is behavior-preserving UI cleanup with a narrow CI repair and no established user-facing runtime regression.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is behavior-preserving UI cleanup with a narrow CI repair and no established user-facing runtime regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • 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 19, 2026, 8:54 PM ET / October 20, 2026, 00:54 UTC.

@steipete
steipete disabled auto-merge October 20, 2026 01:27
@steipete
steipete merged commit b8daeb2 into main Oct 20, 2026
106 of 118 checks passed
@steipete
steipete deleted the solid2/w-deslop-sidebar-controls branch October 20, 2026 04:44
@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 21, 2026
* refactor(ui): inline sidebar presentation owners

* test(ui): drop retired theme bridge diagnostics

* fix(ui): leave theme menu role with shared bindings

* test(ui): open owner assignment proof through keyboard navigation
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. clawsweeper:intake:feature Preliminary submission classification; full source review pending. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant