Skip to content

refactor: bind sidebar subscriptions to component lifetimes - #176477

Merged
steipete merged 3 commits into
mainfrom
solid2/w-zero-sidebar-effects
Oct 19, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/w-zero-sidebar-effects

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sidebar and session renderers still use effect-driven subscriptions and state copies that make their mounted ownership harder to maintain during the Solid 2 migration.

User Impact

User impact: no intended appearance or behavior change; sidebar selection and hovercard focus remain stable across owner updates.

Why This Change Was Made

Sidebar and session renderers used effects to copy owner state, bind subscriptions, and discover owned controls. This checkpoint binds subscriptions to component lifetimes, consumes existing owner projections, and uses shared timer and Markdown primitives. Owned gesture events move into JSX.

The synchronous sidebar owner now retains the last presented roster selection. Hovercard client replacement preserves its open portal and focused children; its remaining commit effect waits for Markdown reconciliation before restoring focus. Catalog and background loading keep their existing lazy boundaries. Tags, classes, routes, selectors, and appearance are preserved.

Head 91ca5f01f6dd is rebased onto fd2a6caa89df. The focused 17-file implementation retains the synchronous roster selection and native bridge contracts from current main.

Evidence

Check Result
Install and UI types Frozen install and pnpm tsgo:ui passed on rebased head; default tsrs, no override or branch dependency changes
Focused behavior Retained unchanged-source proof: parked-roster and People sorting; catalog retries and quiet startup; hovercard client replacement/focus; Details/composer and locale cases passed
Prior runner exception Parked-roster proof used Node with --fsModuleCache=false after cached workers stalled in SSD filesystem-cache rename; all interrupted attempts were joined. No runtime override was used in the refresh
Scoped lint Retained pass for the unchanged 17-file implementation using tsconfig.ui.json
Independent review Rebased candidate scoped-clean through P2
Production Knip File/dependency scan passed. Full production scan reports the same 3 unused core exports on exact base/head, with no UI findings or new ignores
Build/startup Exact-base and head pnpm ui:build completed on the same machine. Startup 337,719→337,718 B gzip (−1 B), 7 JS requests; CSS 38,500 B / 1 request both. Lazy boundaries preserved
Strict route budgets Both sides fail the same metrics: Chat 1,492,548→1,492,489 B (limit 1,490,000); New 1,050,469→1,050,378 B (limit 1,050,000). Candidate reduces both; no budget changed
Visual proof Retained synthetic sidebar/menu pairs below are byte-identical; zero page errors and Escape restores row focus
Broad proof Exact-head ci:full 39193935024 completed: all 3 UI unit, 8 of 9 Control UI E2E and both real-Gateway shards passed. E2E 2/9, baseline ratchets and performance failed; exact-name/main and exact-base attribution is recorded below

The former root-help mock-export failure and prior CI budget failures are historical evidence, not inherited exceptions for this replacement head. Current failures have been compared with the actual new merge base or latest completed scheduled main by exact name. Earlier Details/composer captures emitted strict warnings and are not claimed warning-clean.

The full production Knip phase reports settleInterruptedRestartRecovery, StateDatabaseAccessError, and the RequesterSettleWakeBatchCallbacks type identically on exact base fd2a6caa89df and head 91ca5f. These are recorded local failures, not a passing full scan.

Counts and size

Counts compare fd2a6caa89df with this candidate. The scope is direct components/app-sidebar*, sidebar-*, and session-*, excluding tests/test-support and nested solid/; generic queries count.

Pattern Touched production before After Whole lane before After
Effects 19 4 23 8
Render effects 0 0 0 0
untrack 7 1 13 7
Raw listeners 9 0 9 0
DOM queries 2 2 13 13

17 files, +521/−442. The 14 production files shrink 5,730→5,710 lines (−20); three tests grow 381→480 (+99). Whole-lane production shrinks 36,121→36,101. The original lane began with 30 effects; the Inbox effect is already removed on main; focused follow-ups remove non-island DOM queries and remaining covered effect work.

Surviving effects synchronize external DOM/image/focus state or owner queries: app-sidebar-render.tsx:302, app-sidebar-session-pr-indicators.ts:125, app-sidebar.tsx:259, session-background.tsx:214, session-menu-settings.ts:52, session-owner-filter.ts:107, session-progress-disclosure-binding.ts:507, session-progress-hovercard.runtime.tsx:459. Inbox overflow now uses the shared scroll primitive on main.

Intentional initial snapshots: app-sidebar-rail.tsx:182,533, app-sidebar-session-catalog-render.tsx:68, app-sidebar-session-list-render.tsx:112,227, sidebar-agent-roster.tsx:302, sidebar-outbox-item.tsx:28. The new initialAgentId snapshot preserves the keyed pending-creation row identity; row metadata remains reactive.

Remaining queries are assigned to focused title/lookup/layout/disclosure follow-ups: app-sidebar-render.tsx:329, session-background-layout.ts:14,15,27,30, session-link-titling.ts:145,177,470, session-progress-disclosure-binding.ts:255, session-progress-hovercard-registration.ts:36,78, session-progress-hovercard.runtime.tsx:290. session-progress-card.ts:99 is the deliberate Markdown island.

Screenshots

State Before After
Sidebar Synthetic sidebar before Synthetic sidebar after
Session menu Synthetic session menu before Synthetic session menu after

Current CI failure attribution

The only failed runtime test is ui/src/e2e/model-providers-help.e2e.test.ts > Control UI Models help mocked Gateway E2E > explains the utility model with accessible pointer, keyboard, and narrow-layout behavior. Both this PR and completed scheduled main 39195750293 fail at 238:66: expected closest option supported by the selected model, received the revised closest-supported-option copy. Each shard reports 434 passed and 1 failed. This is an exact-name/assertion match, not a shard-level attribution.

The mock-export ratchet reports test/scripts/ci-node-test-plan.test.ts:3297: ../../scripts/lib/ci-test-timings.mts; the same command fails with that exact diagnostic on merge base fd2a6caa89df. CI measures Chat boot JS at 1,491,463→1,491,379 B (−84 B), both above the unchanged 1,490,000 B limit. New Session stays within its limit at 1,049,642→1,049,523 B. No failed check is reported as passing.

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

clawsweeper Bot commented Oct 18, 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 18, 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-19T03:22:01.188273Z 91ca5f0 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR binds sidebar and session subscriptions to Solid component lifetimes and reuses shared timer, listener, and Markdown primitives.

Example: A session hovercard is open when its client property changes.

  • Before: Effect-driven wiring manages source replacement while retaining the portal.
  • After: Component-scoped bindings retain the portal and retire subscriptions when their source changes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful ownership-preserving cleanup with relevant visual and browser evidence; unresolved required-check attribution limits merge confidence.
Proof confidence 🐚 platinum hermit (4/6) The ordinary contributor proof gate does not apply to this maintainer-authored refactor; inspected synthetic Control UI captures support sidebar/menu parity, while the reported browser tests cover replacement and focus behavior.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Sidebar navigation, hovercards, and recovery controls must retain their behavior through source replacement and component teardown.
Reason: The maintainer-authored direction reduces lifecycle plumbing while preserving existing state owners and user-facing contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it is a useful, maintainer-approved lifecycle refactor, and source review found no actionable introduced defect.

Priority: P3
Reviewed head: bd2aa96a66e5f4d5991a1620f3f3c38f47f213e2

Before merge

  • Complete next step - Classify the remaining required-check failures against matching base evidence and resolve any failures caused by this PR before merging.

Findings

None.

Agent review details

How this fits together

Control UI components consume application and Gateway owners, render sidebar and session views, and release subscriptions, timers, and overlays when their component or source retires.

flowchart TD
  Application[Application context] --> Owners[Gateway and session owners]
  Owners --> Bindings[Component scoped bindings]
  Bindings --> Sidebar[Sidebar and roster]
  Bindings --> Hovercard[Session hovercard]
  Bindings --> Progress[Progress and background views]
  Bindings --> Cleanup[Source replacement and disposal]
Loading

Technical review

Best possible solution:

Keep domain state synchronous and use the existing component, projection, overlay, and Markdown owners for lifecycle work.

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

This PR proposes a refactor rather than a reported product bug; source inspection confirms the lifecycle machinery it replaces.

Is this the best way to solve the issue?

The change follows existing ownership boundaries, removes superseded wiring, and preserves synchronous admission, source retirement, and lazy imports.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b1066a5c4910.

Provenance checked

  • Sidebar roster selection and source ownership keeps the original intent (3b4fbc4: Keep synchronous query authority outside the view and retain the last presented selection while parked; subsequent navigation work made every displayed agent section collapsed.)
  • Attention and People subscriptions keeps the original intent (54b5f60: Component lifetimes own subscriptions and display timers while retained question records remain synchronous; People follows the same separation established in refactor(ui): scope sidebar people lifetimes to the Solid view #174500.)
  • Hovercard rendering and source replacement keeps the original intent (4b032fa: Preserve synchronous hover/focus admission, portal snapshots, reconnect behavior, and the empty-card retirement guard.)
  • Background image and geometry lifecycle keeps the original intent (4c0d83f: Keep lazy loading, component-owned geometry cleanup, and synchronous retirement of private image pixels before deferred rendering.)
  • Progress rendering and disclosure keeps the original intent (890370d: Keep gesture reduction, remembered choices, pointer capture, and transcript observation with their existing synchronous owner while Solid owns element bindings.)
  • Filter query scheduling keeps the original intent (3982daa: Saved filter membership remains synchronous, explicit changes refresh immediately, and automatic repairs use scheduled reads.)
  • Dialog and filter focus keeps the original intent (7d536d5: Preserve accepted-open and settled focus behavior; the nested browser now exposes an existing path ref that replaces the remaining input query.)
  • Update-card recovery keeps the original intent (e80558a: The Solid migration preserved existing update actions and recovery behavior; the replacement scope identity retains stale-completion rejection and synchronous duplicate admission protection.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change verified: Reviewed the pinned merge-base-to-head hunks; the changes replace lifecycle plumbing without adding dependencies, configuration, or persisted formats. (bd2aa96a66e5)
  • Question subscription ownership: Question hydration follows client identity, retains the current-client check, and releases both Gateway subscriptions and question timers on disposal. (ui/src/components/session-attention.ts:63, bd2aa96a66e5)
  • Roster cutover: The synchronous sidebar owner now retains the last admitted roster selection; the child-owned accessor and its effect wiring are removed. (ui/src/components/app-sidebar-session-navigation.ts:120, bd2aa96a66e5)
  • Source retirement and focus preservation: Keyed context and Gateway bindings release old subscriptions; the existing portal owner and post-Markdown focus commit remain authoritative. (ui/src/components/session-progress-hovercard.runtime.tsx:543, bd2aa96a66e5)
  • Supplied visual evidence inspected: Inspected all four downloaded before/after images: the synthetic sidebar and open session menu preserve their visible layout. (bd2aa96a66e5)
  • Current main remains distinct: Current main retains the prior lifecycle implementation; its nearby sidebar change removes the Community invitation and does not overlap this PR's introduced sidebar hunks. (ui/src/components/app-sidebar-owner.tsx, b1066a5c4910)

Likely related people:

  • Peter Steinberger: Raw commit 54b5f60 adds ui/src/components/session-attention.ts:35 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 54b5f6080063; files: ui/src/components/session-attention.ts)

PR surface

Source -20, Tests +168. Total +148 across 23 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 19 462 482 -20
Tests 4 171 3 +168
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 633 485 +148

Review metrics

Metric Value Why it matters
Production versus test changes Production +462/−482 lines; tests +171/−3 lines Production shrinks by 20 lines; added coverage exercises source replacement, retained DOM, teardown, and nested keyboard focus.

Labels

Label changes:

  • add P3: This is a behavior-preserving UI maintenance refactor without an established urgent user-facing defect.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit 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 a behavior-preserving UI maintenance refactor without an established urgent user-facing defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit 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 18, 2026, 5:28 PM ET / 21:28 UTC.

@steipete
steipete force-pushed the solid2/w-zero-sidebar-effects branch 2 times, most recently from 7d37250 to eb0c703 Compare October 19, 2026 00:38
@steipete
steipete enabled auto-merge (squash) October 19, 2026 00:56
@steipete
steipete disabled auto-merge October 19, 2026 01:41
Evaluate disabled presentation in the card memo before menu setup can first instantiate its parent presentation getter inside onSettled.

Complete hovercard row fixtures and preserve native MediaQueryList members in the mobile focus fixture. The existing Details browser regression passes after reproducing the reactive halt, and the production collapsed-desktop send, stream, and refresh case passes.
@steipete
steipete force-pushed the solid2/w-zero-sidebar-effects branch from eb0c703 to 91ca5f0 Compare October 19, 2026 03:16
@steipete
steipete merged commit dbb656b into main Oct 19, 2026
108 of 114 checks passed
@steipete
steipete deleted the solid2/w-zero-sidebar-effects branch October 19, 2026 04:28
@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 20, 2026
…#176477)

* refactor: bind sidebar subscriptions to component lifetimes

* fix(ui): derive progress menu state before lifecycle setup

Evaluate disabled presentation in the card memo before menu setup can first instantiate its parent presentation getter inside onSettled.

Complete hovercard row fixtures and preserve native MediaQueryList members in the mobile focus fixture. The existing Details browser regression passes after reproducing the reactive halt, and the production collapsed-desktop send, stream, and refresh case passes.

* refactor(ui): simplify sidebar roster admission and keyed identity
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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant