Skip to content

refactor(ui): move sidebar session data ownership into a reactive controller - #112853

Merged
steipete merged 1 commit into
mainfrom
sidebar-flatten-3-data-controller
Jul 23, 2026
Merged

steipete merged 1 commit into
mainfrom
sidebar-flatten-3-data-controller

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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

What Problem This Solves

PRs #112753, #112809, and #112817 extracted the sidebar render boundary and moved attention into a controller, but session and catalog data still occupied two coupled inheritance layers. Their shared Gateway client, refresh lifecycle, and abstract up-calls kept the remaining element tower difficult to flatten safely.

Why This Change Was Made

This is PR 3 of the sidebar-flattening series. Session and catalog state now have one SessionDataController owned by Projection, which extends AppSidebarBase directly. All consumers address the controller explicitly; the deleted element layers have no aliases, re-exports, or delegating element getters. Stateless catalog orchestration lives in free functions so the controller stays within the 700-line guard without introducing another class or lifecycle owner.

The controller host is narrow and descriptive: Lit lifecycle/update support, connection state, the current application context, and the existing dismissTransientMenus, expandedAgentId, promoteCreatedSession, selectedAgentIdForSessions, and sidebarSessionStatusFilter up-calls.

AI-assisted change; implementation and proof were reviewed with the repository autoreview workflow.

User Impact

None. This is a behavior-neutral ownership refactor; sidebar sessions, child lineage, pagination, catalogs, presence, mutation errors, and scroll presentation are intended to behave identically.

Evidence

  • node scripts/run-vitest.mjs ui/src/components/app-sidebar.test.ts: 160 passed in 1 suite, with the DOM oracle cases unchanged
  • Six additional importer suites: 41 passed across 6 files
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json: passed on Blacksmith Testbox
  • node scripts/check-changed.mjs -- <17 touched paths>: passed (coreTests, ui) on Blacksmith Testbox, run 29973129244
  • pnpm ui:build: passed on Blacksmith Testbox; startup JS 9 requests / 315.7 KiB gzip against the 317.0 KiB limit
  • @state() parity audit: all 15 moved reactive fields request a host update after every assignment cluster, including replacement arrays, maps, and sets; the two former plain caches remain non-reactive
  • $HOME/.claude/skills/autoreview/scripts/autoreview --mode uncommitted: clean, no accepted/actionable findings
  • $HOME/.claude/skills/autoreview/scripts/autoreview --mode branch --base origin/main: clean, no accepted/actionable findings
  • git diff --numstat origin/main...HEAD: +801/-596 across 16 files (net +205 from the explicit host/controller and reactive-notification plumbing while deleting two inheritance layers)

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Jul 23, 2026
@steipete steipete self-assigned this Jul 23, 2026
@steipete
steipete marked this pull request as ready for review July 23, 2026 02:43
@steipete
steipete force-pushed the sidebar-flatten-3-data-controller branch from 655ba40 to 30b1bc2 Compare July 23, 2026 03:33
@steipete
steipete merged commit efc19fa into main Jul 23, 2026
91 checks passed
@steipete
steipete deleted the sidebar-flatten-3-data-controller branch July 23, 2026 03:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Jul 23, 2026
…ytes

All four QA Smoke profiles fail on main since the #112880 ratchet landed:
startup JS gzip ~323,326-323,342 B vs baseline 322,526 + 512 B tolerance.
The overage comes from UI commits that landed after the baseline was
captured (#112859 #112866 #112853 #111861). Local macOS builds measure
~322,535 B; Linux CI is ~800 B larger, so the baseline must track the CI
measurement (max observed across profiles, run 29980596056).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 23, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 23, 2026
…ytes

All four QA Smoke profiles fail on main since the openclaw#112880 ratchet landed:
startup JS gzip ~323,326-323,342 B vs baseline 322,526 + 512 B tolerance.
The overage comes from UI commits that landed after the baseline was
captured (openclaw#112859 openclaw#112866 openclaw#112853 openclaw#111861). Local macOS builds measure
~322,535 B; Linux CI is ~800 B larger, so the baseline must track the CI
measurement (max observed across profiles, run 29980596056).
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