Skip to content

refactor: give sidebar controls explicit ownership - #176405

Merged
steipete merged 4 commits into
mainfrom
solid2/w-zero-sidebar
Oct 18, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-zero-sidebar

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sidebar and session menus still discovered their own controls through DOM searches and carried redundant tracking suppression after the Solid migration. This checkpoint gives menu controls, section headers, rail pins, presence facepiles, and person triggers renderer-owned refs. The existing Menu focus owner exposes focusFirst() and itemElement(id) so callers retain control identity.

User Impact

Existing navigation, keyboard focus, host tags, classes, routes, selectors, and lazy boundaries are preserved. Authoritative sidebar reads stay synchronous in plain TypeScript owners; Solid consumers receive live owner accessors and scoped projections.

Current Candidate

Head ca4bf52f226e0b07d068c0424133f2df4179abd7 merges current main c8c8e886daae866027b976d606e83a8ceb6c114c to resolve repeated GitHub mergeability computation timeouts. The five overlapping files now retain main's mounted-row and Inbox focus ownership. Three files match main exactly; the session row keeps main's settled mount/focus callback plus live host accessors, and Inbox keeps main's focus registry plus route-derived open state.

The initial CI exposed section-reorder focus, hidden landscape startup, and two catalog retry regressions. This PR fixes those at their owners: retain the reorder trigger in a component-owned lifetime; allow shell startup inputs while later hidden owner updates stay parked; and keep reactive view reads separate from synchronous owner callbacks. This is one checkpoint; the remaining effect, timer, focus, and measurement conversions continue in the follow-up sidebar PRs.

Evidence

Check Result
Focused catalog refresh 8/8 passed on this candidate, including both previously failing retry/startup cases
Focused projection and row rendering 33/33 passed on this candidate; existing strict-read diagnostics remain recorded
Dependency qualification Candidate's first local runs used fs-safe 0.26.7; frozen install subsequently adopted main's 0.26.8. Solid/UI pins and the tested unit imports were unchanged, so the 41 focused passes are retained with this qualifier. Full current-lock proof comes from fresh ci:full.
UI typecheck after frozen install Passed with fs-safe 0.26.8 installed
Production Knip after frozen install Completed with the same two unused core files: reply-admission-ticket.ts and reply-turn-admission-owner.ts; no UI findings. Local failure is retained, not relabeled green or used as a CI exemption.
Independent review Fresh complete effective diff reviewed clean through P2; supplied unchanged main row and Inbox files included. Final source verification passed.
Native preparation Being refreshed for this exact head
Full current-head CI Run 39175445655 passed: all 3 UI unit shards, 9 mocked UI E2E shards, 2 real-Gateway shards, performance, and remaining selected checks. No inherited-failure exception is used.
Current CI startup 337,310 B gzip, 7 JS requests, 1 CSS request / 38,500 B; passes all limits. The 338,803 B value is the committed startup baseline, not a measured-base delta.
Current CI route comparison Chat 1,487,705 → 1,488,517 B (+812 B), 25 requests both; new-session 1,048,059 → 1,048,822 B (+763 B), 20 requests both. Both pass; CSS unchanged.
Historical local startup comparison Earlier same-machine base/candidate: 336,531 → 336,536 B gzip (+5 B), 7 JS requests and 1 CSS request; CSS 38,500 B both. These are prior-head values; fresh CI owns current-head budgets.
Historical visual proof Inspected synthetic sidebar and session-menu images below; repaired normal captures matched their hashes. Reorder focus and 844×390 hidden-question startup captures had no page errors.

The two focused files still emit previously disclosed STRICT_READ_UNTRACKED diagnostics for renderSessionSection.group and observeHost.revision; passing assertions are not described as warning-free. No full local E2E suite or repeat test loop was run.

CI Attribution

The former inherited-media exception is retired. Latest completed scheduled main 39172446197, head 4812f059427b2db240fbefd3af4411c9d701538a, passed both real-Gateway jobs and the three previously failing media cases. Fresh current-head CI 39175445655 passed; it tested merge d69a24e0a1ab942e1760d107a2cb84efbb36d2f3 against base 65fdda51d7d87d8bfbdebf97e3ccea16a92cb457. Old run 39168070659 does not authorize this head's landing. Prior-head performance and media failures remain historical evidence only.

Size and Checklist Counts

Compared with pinned main, this candidate changes 46 files, +766/−478 lines. Changed production files: 16,107 → 16,323 LOC (+216). Whole sidebar/session production scope: 35,839 → 36,023 LOC (+184). The growth pays for explicit refs, cleanup, the shared focus contract, and the synchronous-owner/parked-view repair; this checkpoint does not claim the final wave-zero targets.

Pattern Changed production before After Whole scope before After
Controller pattern 0 0 0 0
createEffect 18 16 26 24
createRenderEffect 0 0 0 0
untrack 26 8 31 13
Raw addEventListener 11 1 20 10
DOM queries, including generic calls 25 6 34 15
String-builder matches 2 2 2 2
flush 4 4 3 3
Explicit owner wiring 4 4 7 7

Remaining counts are follow-up work, not comment-based exceptions. The known owned-island query is the sanitized Markdown template; mixed Markdown/Solid discovery, cross-owner geometry, row membership, and filter controls still require explicit ownership conversions. Mounted reactive identities retain named initial snapshots.

Current remaining patterns by category

Locations are on ca4bf52f226e; follow-up conversions are not claimed complete. Test-support modules are excluded. The session-progress-card.ts:99 query owns a sanitized Markdown island. The roster readCollapsed suppression is pending removal; other listed untrack calls capture named mounted identities.

Category File and lines
Effects pending shared owner/lifecycle conversion ui/src/components/app-sidebar-owner.tsx:399; ui/src/components/app-sidebar-render.tsx:302; ui/src/components/app-sidebar-session-pr-indicators.ts:125; ui/src/components/app-sidebar.tsx:254; ui/src/components/session-attention.ts:76; ui/src/components/session-background-view.tsx:32; ui/src/components/session-background.tsx:128, 207; ui/src/components/session-menu-settings.ts:52; ui/src/components/session-owner-filter.ts:107; ui/src/components/session-progress-card-solid.tsx:52, 241; ui/src/components/session-progress-card-view.tsx:18; ui/src/components/session-progress-disclosure-binding.ts:504; ui/src/components/session-progress-hovercard.runtime.tsx:448, 503, 513, 528; ui/src/components/sidebar-agent-roster.tsx:140, 149; ui/src/components/sidebar-attention.tsx:216; ui/src/components/sidebar-people.ts:55; ui/src/components/sidebar-update-card.tsx:80, 89
Intentional initial snapshots and one remaining roster suppression ui/src/components/app-sidebar-rail.tsx:182, 533; ui/src/components/app-sidebar-session-catalog-render.tsx:68; ui/src/components/app-sidebar-session-list-render.tsx:112, 227; ui/src/components/session-hovercard-solid.tsx:192, 248, 280, 309, 441, 490; ui/src/components/sidebar-agent-roster.tsx:139; ui/src/components/sidebar-outbox-item.tsx:28
Direct DOM listeners pending owned handlers or listen() ui/src/components/session-progress-disclosure-binding.ts:275, 276, 277, 278, 279, 280, 281, 285, 288; ui/src/components/sidebar-session-filter-popover.tsx:89
Queries pending explicit owner interfaces, except the Markdown island ui/src/components/app-sidebar-render.tsx:329; ui/src/components/session-background-layout.ts:14, 15, 27, 30; ui/src/components/session-link-titling.ts:145, 177, 470; ui/src/components/session-progress-card.ts:99; ui/src/components/session-progress-disclosure-binding.ts:254; ui/src/components/session-progress-hovercard-registration.ts:36, 78; ui/src/components/session-progress-hovercard.runtime.tsx:287; ui/src/components/sidebar-session-filter-popover.tsx:12, 52

Screenshots

The following before/after captures contain synthetic fixtures only and were inspected in full. Repaired normal-capture PNG hashes match these uploaded assets, so no duplicate upload was needed.

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

@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-18T23:15:22.771256Z ca4bf52 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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 replaces sidebar DOM searches and imperative wiring with owned references, shared menu operations, and scoped reactive projections.

Example: Open the session menu for the synthetic “Visual parity” conversation.

  • Before: Menu controls are discovered through DOM queries.
  • After: Owned references provide the same visible menu and return-focus behavior.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, approved ownership cleanup with inspected visual evidence, but introduced consumer and reactive-diagnostic failures prevent a clean patch verdict.
Proof confidence 🐚 platinum hermit (4/6) Maintainer-authored PRs are outside the ordinary contributor proof gate; the inspected Chromium screenshots cover rendered sidebar and session-menu parity, with the body recording production-bundle startup and Escape focus restoration.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-facing defect is claimed; the maintenance problem is indirect control discovery and redundant lifecycle plumbing after the Solid migration.
Reason: Maintainer authorship supplies direction for this bounded ownership checkpoint, and the shared-menu and chat-header edits serve the same cutover.

Merge readiness

⛔ Needs changes before merge - 4 items remain

Keep open for focused repairs: the ownership refactor has approved direction, but leaves a constructor consumer unmigrated, introduces strict reactive-read failures, and adds an assertion that violates the safety ratchet.

Priority: P3
Reviewed head: 948df3ee5d3cab52db2289f0370f81693ce1e084

Before merge

  • Migrate the row fixture to the new sidebar constructor (P2) - Removing the props parameter changes AppSidebarOwner's inherited constructor to (catalog, context, host), but createHost in app-sidebar-session-row-render.test.tsx:71 still calls it with (catalog, props, context, props). Consequently the owner receives the sidebar element as its application context and the application context as its DOM host. Exact-head checks-ui (2/3) reports the resulting agentSelection and gateway snapshot errors across the row cases. Update that consumer to pass (catalog, context, props).
  • Preserve intentional snapshots outside reactive tracking (P2) - Calling entry() directly in this keyed For setup replaces a deliberate identity snapshot with a strict untracked reactive read. The same change appears in Pages, catalog setup, and SessionList's host sampling. Exact-head catalog-event tests now fail on STRICT_READ_UNTRACKED warnings, including the For and renderSessionList.host paths. These setup values are intentionally fixed for their keyed lifetime; retain narrowly documented untrack snapshots there, or pass live accessors where replacement must remain reactive, while keeping the valid removals from already-untracked effect apply callbacks.
  • Explicitly type the optional focus callback slot (P3) - The new non-const assertion has no SAFETY comment, and this file has no assertion-safety baseline allowance. The production ratchet counts it, so the added slot violates the enforced assertion contract; CI reports assertion-safety failure as well. Declare the callback slot's type explicitly instead of asserting the initializer's type or expanding the baseline.
  • Explain or restore the original intent of Keyed-entry and renderer setup snapshots - e80558a: The existing untrack calls deliberately sampled lifetime-stable keyed identities and renderers; local history also traces renderer sampling through 285cf09.

Findings

  • [P2] Migrate the row fixture to the new sidebar constructor — ui/src/components/app-sidebar-base.ts:165-167
  • [P2] Preserve intentional snapshots outside reactive tracking — ui/src/components/app-sidebar-rail.tsx:178-179
  • [P3] Explicitly type the optional focus callback slot — ui/src/components/sidebar-menus.tsx:300

Provenance

  • Keyed-entry and renderer setup snapshots changes intended behavior without addressing why it exists (e80558a: The existing untrack calls deliberately sampled lifetime-stable keyed identities and renderers; local history also traces renderer sampling through 285cf09.)
Agent review details

How this fits together

The Control UI sidebar consumes Gateway session, agent, presence, and navigation state and renders navigation, hovercards, and session actions.

flowchart LR
  Gateway[Gateway state] --> Owners[Session and navigation owners]
  Owners --> Projections[Solid projections]
  Projections --> Sidebar[Sidebar components]
  Sidebar --> Controls[Owned refs and menu handles]
  Controls --> Actions[Existing action owners]
Loading

Technical review

Best possible solution:

Keep the existing owners and reference cutover, migrate the constructor fixture, preserve intentional setup snapshots, and explicitly type the optional focus callback.

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

The constructor mismatch and unsupported assertion are directly source-reproducible, and exact-head CI independently records the constructor errors and strict-read warnings; no target code was executed.

Is this the best way to solve the issue?

Owned references and the existing Menu focus owner are appropriate, but removing intentional lifetime snapshots is unnecessary and the constructor cutover must include its test consumer.

Full review comments:

  • [P2] Migrate the row fixture to the new sidebar constructor — ui/src/components/app-sidebar-base.ts:165-167
    Removing the props parameter changes AppSidebarOwner's inherited constructor to (catalog, context, host), but createHost in app-sidebar-session-row-render.test.tsx:71 still calls it with (catalog, props, context, props). Consequently the owner receives the sidebar element as its application context and the application context as its DOM host. Exact-head checks-ui (2/3) reports the resulting agentSelection and gateway snapshot errors across the row cases. Update that consumer to pass (catalog, context, props).
    Confidence: 1
  • [P2] Preserve intentional snapshots outside reactive tracking — ui/src/components/app-sidebar-rail.tsx:178-179
    Calling entry() directly in this keyed For setup replaces a deliberate identity snapshot with a strict untracked reactive read. The same change appears in Pages, catalog setup, and SessionList's host sampling. Exact-head catalog-event tests now fail on STRICT_READ_UNTRACKED warnings, including the For and renderSessionList.host paths. These setup values are intentionally fixed for their keyed lifetime; retain narrowly documented untrack snapshots there, or pass live accessors where replacement must remain reactive, while keeping the valid removals from already-untracked effect apply callbacks.
    Confidence: 0.99
  • [P3] Explicitly type the optional focus callback slot — ui/src/components/sidebar-menus.tsx:300
    The new non-const assertion has no SAFETY comment, and this file has no assertion-safety baseline allowance. The production ratchet counts it, so the added slot violates the enforced assertion contract; CI reports assertion-safety failure as well. Declare the callback slot's type explicitly instead of asserting the initializer's type or expanding the baseline.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Sidebar inputs, control references, and menu ownership keeps the original intent (e80558a: The Solid sidebar migration preserved one shell-owned sidebar, existing controls, focus, routes, and synchronous plain TypeScript authority.)
  • Automation hovercard loading keeps the original intent (86f68e9: Read-only automation inspection uses session-filtered inventory, existing pagination, and retirement of obsolete connection or session reads.)
  • Session menu focus keeps the original intent (4818138: Shared Solid session components preserve menu actions, focus behavior, and session ownership; the patch routes focus through the existing menu and appearance owners.)
  • Attention-panel navigation lifecycle keeps the original intent (54b5f60: The attention view owns presentation lifecycle; deriving closure from route identity retains that responsibility.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/components/app-sidebar-session-row-render.test.tsx src/components/app-sidebar.catalog-events.test.ts src/components/session-hovercard-automations.locale.test.tsx
  • pnpm tsgo:ui
  • pnpm tsgo:test:ui
  • pnpm check:assertion-safety

What I checked:

PR surface

Source +174, Tests +28. Total +202 across 42 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 41 518 344 +174
Tests 1 41 13 +28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 42 559 357 +202

Review metrics

Metric Value Why it matters
Production versus test LOC Production +174; tests +28 The introduced diff confirms these net changes; explicit references and cleanup replace concrete lookups, while the test extension checks retained content and subscription replacement.

Labels

Label changes:

  • add P3: This is an internal ownership cleanup with no intended user-facing change; its introduced validation defects need repair but establish no urgent production incident.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is an internal ownership cleanup with no intended user-facing change; its introduced validation defects need repair but establish no urgent production incident.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • 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, 4:28 PM ET / 20:28 UTC.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3761bbe27f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const createAgentLinkRef = (card: () => { id: string }) => {
// The keyed row keeps this identity until its branch is removed.
const id = untrack(() => card().id);
const id = card().id;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep keyed roster IDs as explicit snapshots

When an agent roster row renders, this helper is called from a keyed <For> callback, so reading card() here occurs at the top of a flow owner rather than in a tracking computation and produces Solid's STRICT_READ_UNTRACKED diagnostic. The ID is intentionally fixed for the keyed row's lifetime, so retain the explicit untrack snapshot (and do the same for the new direct card().id argument in the pinned-row loop) instead of turning the snapshot into an accidental untracked read; otherwise ordinary roster rendering can fail strict diagnostic checks.

AGENTS.md reference: ui/AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 00575be into main Oct 18, 2026
114 checks passed
@steipete
steipete deleted the solid2/w-zero-sidebar branch October 18, 2026 23:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
* refactor: give sidebar controls explicit ownership

* fix: preserve sidebar parking and control focus
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL 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