Skip to content

refactor(ui): move sidebar mutations and groups into one organizer controller - #112923

Merged
steipete merged 3 commits into
mainfrom
sidebar-flatten-4-mutations-groups
Jul 23, 2026
Merged

steipete merged 3 commits into
mainfrom
sidebar-flatten-4-mutations-groups

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #112753
Related: #112809
Related: #112817
Related: #112853

PR 4 of the sidebar flattening series.

What Problem This Solves

The Control UI sidebar still split session mutations and custom-group organization across separate layer files and, after their first controller extraction, separate controllers with bidirectional host wiring. That duplication kept the sidebar hierarchy deeper than necessary and pushed startup JavaScript above the shrink-only budget.

Why This Change Was Made

This merges mutations and groups into one SessionOrganizerController: the bidirectional dependency was a cohesion signal that these operations are one concern. It removes the controller-to-controller host bridge and keeps one host contract, while preserving eager group/drag presentation state and the former state-parity update points.

The interaction-only RPC and persistence tails live in session-organizer-operations.runtime.ts behind one cached dynamic import, following the sidebar narration precedent. Mutation scopes are captured before that lazy boundary, stale scopes are rejected before RPCs, and failed chunk loads clear the cache and report through the scoped mutation-error path. There are no production static importers of the runtime module.

The startup ratchet history was:

  • two controllers: 323318 B, 280 B over the allowed limit
  • merged controller with an eager stateless helper: 323382 B, 344 B over
  • final lazy boundary on the rebased branch: 322251 B, 275 B below baseline and 787 B below the allowed limit

User Impact

No visible behavior changes. First paint, collapsed sections, drag affordances, confirmations, and session/group operations remain the same; the interaction-only operation code now downloads on first use instead of during startup.

Evidence

  • app-sidebar.test.ts: 160/160 passed after rebase.
  • Changed-test expansion: 5,321 passed and 27 skipped; one unrelated board fake-timer case failed once and passed 42/42 on immediate focused rerun.
  • UI production and UI test tsgo lanes passed.
  • check:changed passed on the rebased branch, including max-lines, formatting, i18n, types, and the full core/UI/package lint sweep.
  • Production Control UI build passed with startup JS at 322251 B. [INEFFECTIVE_DYNAMIC_IMPORT] was absent.
  • Startup sourcemaps do not contain the operations runtime; it emits as a separate lazy chunk.
  • Codex autoreview accepted and fixed mutation-scope/load-failure findings, then returned clean. The final lint-only follow-up review was also clean.

Two DOM-dispatch assertions now use the existing waitForFast helper because EventTarget.dispatchEvent cannot return an async listener promise: custom-group reorder persistence and the session-pin tail of a sidebar drop. No production timing workaround was added.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Jul 23, 2026
@steipete
steipete merged commit b74f04a into main Jul 23, 2026
112 of 115 checks passed
@steipete
steipete deleted the sidebar-flatten-4-mutations-groups branch July 23, 2026 05:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 23, 2026
…ntroller (openclaw#112923)

* refactor(ui): move sidebar mutations and groups into controllers

* refactor(ui): lazy-load session organizer operations

* fix(ui): order organizer mutation scope before options
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 maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant