Skip to content

refactor(ui): replace minified sidebar render snapshot with host interface - #112809

Merged
steipete merged 1 commit into
mainfrom
sidebar-flatten-1b-host-interface
Jul 23, 2026
Merged

steipete merged 1 commit into
mainfrom
sidebar-flatten-1b-host-interface

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #112753

What Problem This Solves

PR #112753 left the Control UI sidebar session-list renderer with hand-minified source names such as data.l, data.v, and cb.om. That made a maintainability refactor materially harder to read and weakened the presence payload to unknown solely to stay under the startup-JS budget.

Why This Change Was Made

The render functions now accept one narrow SessionListHost implemented structurally by the sidebar element. They read the element's descriptively named state and call its methods directly, removing the duplicated snapshot builder and callback-binding table rather than abbreviating the interface. The host shape is byte-neutral in production because its TypeScript interface erases and the generated call sites are the same host.property reads the class renderers originally used.

The presence payload is normalized at the gateway boundary to a typed { presence } shape. DOM structure, CSS, keyed rendering, and event behavior are unchanged.

User Impact

No user-visible behavior changes. The sidebar rendering boundary is maintainable again without giving up the startup size guard.

Evidence

  • node scripts/run-vitest.mjs ui/src/components/app-sidebar.test.ts: 160 passed
  • node scripts/run-vitest.mjs ui/src/app/user-profile.test.ts ui/src/pages/profile/profile-page.test.ts: 8 passed across 2 files
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json: passed on Blacksmith Testbox
  • node scripts/check-changed.mjs -- <12 touched files>: passed (coreTests, ui) on Blacksmith Testbox
  • pnpm ui:build: passed on Blacksmith Testbox; startup JS gzip fell from 322,494 B to 322,281 B (-213 B), below the 322,560 B budget
  • $HOME/.claude/skills/autoreview/scripts/autoreview --mode branch --base origin/main: clean, no accepted/actionable findings
  • git diff --numstat origin/main: +284/-321 across 12 files (net -37)

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

@steipete
steipete marked this pull request as ready for review July 23, 2026 00:11
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Jul 23, 2026
@steipete
steipete merged commit 1a7a180 into main Jul 23, 2026
145 of 154 checks passed
@steipete
steipete deleted the sidebar-flatten-1b-host-interface branch July 23, 2026 00:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant