Skip to content

refactor(ui): collapse sidebar inheritance tower to three classes - #112969

Merged
steipete merged 1 commit into
mainfrom
sidebar-flatten-6-collapse
Jul 23, 2026
Merged

steipete merged 1 commit into
mainfrom
sidebar-flatten-6-collapse

Conversation

@steipete

@steipete steipete commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

PR 6, the finale of the sidebar-flattening series.

Prior stages:

What Problem This Solves

The Control UI sidebar still had seven inheritance levels after the controller extractions, leaving four shell classes whose remaining responsibility was field placement and forwarding rather than a distinct behavior boundary.

The full program now ends at three classes:

Before (13)
AppSidebarBase
  -> AppSidebarSessionCatalogDataElement
  -> AppSidebarSessionDataElement
  -> AppSidebarSessionAttentionElement
  -> AppSidebarSessionProjectionElement
  -> AppSidebarSessionOwnershipElement
  -> AppSidebarSessionNavigationElement
  -> AppSidebarSessionMutationsElement
  -> AppSidebarSessionGroupsElement
  -> AppSidebarMenusElement
  -> AppSidebarSessionNarrationElement
  -> AppSidebarSessionListElement
  -> AppSidebar

After (3)
AppSidebarBase
  -> AppSidebarSessionNavigationElement
  -> AppSidebar

Why This Change Was Made

Projection and ownership now live directly on AppSidebarSessionNavigationElement. Narration and list wiring now live directly on AppSidebar, while pure navigation and chrome-rendering work moved to free functions in sibling modules so neither surviving class needs a max-lines suppression.

The merge preserves the old field-initializer order and lifecycle callback order. The narration controller remains behind its original dynamic import, and the organizer/menu controllers remain on the final element side of the boundary.

Across the full series, GitHub numstat is +4,731/-3,684. This finale is +1,273/-1,067 across eight files; the added lines are explicit host/free-function contracts replacing four inheritance layers.

User Impact

None. This is a behavior-neutral ownership refactor.

Evidence

  • Sidebar DOM suite passed twice consecutively: 161/161 and 161/161.
  • Changed-importer expansion passed 5,326 tests across 386 files, with 27 expected skips.
  • UI tsgo passed on Blacksmith Testbox.
  • Exact touched-path check:changed passed on Blacksmith Testbox, including the max-lines ratchet, formatting, i18n, typechecks, and lint.
  • Production build passed. The narration controller remains a separate app-sidebar-session-narration-*.js chunk, and [INEFFECTIVE_DYNAMIC_IMPORT] was absent.
  • Startup JS is 323,528 bytes gzip, +93 bytes versus the 323,435-byte baseline and within the 1,024-byte tolerance; no baseline update was made.
  • Knip's all-exports configuration passed with duplicate reporting excluded; the new helper modules expose only live callers.
  • Codex autoreview returned clean with no accepted/actionable findings (0.94 confidence).

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 08:14
@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper's immutable exact-head review artifact from run 29990653397 reports no findings and judges the patch correct. Its public comment publication is delayed by the currently critical publication backlog, so I reviewed the artifact directly before landing.

Rank-up moves addressed:

  • Exact-head checks are complete: CI attempt 2 is successful with 53 jobs green and no failures.
  • I am accepting the review's documented test-only coverage option instead of adding a screenshot/recording. This is a behavior-neutral refactor with no intended visual delta, and the task explicitly designates the existing DOM suite as the behavior oracle. That suite passed twice consecutively (161/161 each), the changed-importer expansion passed 5,326 tests across 386 files, and the production build preserved narration as a separate lazy chunk with no ineffective dynamic-import marker. A before/after visual would be intentionally identical and would not add a stronger assertion than the unchanged DOM oracle.

No ClawSweeper finding or maintainer decision remains open.

@steipete
steipete merged commit f466c3d into main Jul 23, 2026
213 of 218 checks passed
@steipete
steipete deleted the sidebar-flatten-6-collapse branch July 23, 2026 08:44
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant