Skip to content

refactor: give mounted sidebar rows and Inbox controls explicit owners - #176507

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

steipete merged 2 commits into
mainfrom
solid2/w-zero-sidebar-registrations

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sidebar catalog adoption and Inbox keyboard navigation still depend on DOM discovery and render effects to identify mounted controls.

User Impact

Catalog adoption preserves focus and open menus, Inbox navigation follows its visible controls, and the saved roster filter applies before its first read. Shared notification, approval, outbox, and refresh cards also render when no Inbox focus provider is mounted.

Why This Change Was Made

Catalog rows now register their mounted session keys with the existing session projection. This preserves the mounted-only presentation boundary from #171259: hidden or capped catalog rows do not contribute full live-row presentation. Native and adopted rows own their refs and cleanup. Each replacement captures the active control before the old DOM leaves, then retargets the retained menu and restores focus after settlement. The native fallback has its own component lifetime, including adoption in both directions.

The mounted Inbox owns a focus registry supplied to its shared row renderers through context. The context has an explicit null default, so shared renderers outside the Inbox skip registration; Solid 2 treats an undefined default as a required context. Tab wrapping and approval return focus consume registered controls in DOM order, excluding disabled controls, hidden content, and actions inside collapsed details. The registry implementation stays in the existing lazy panel module. Lifetime-stable application services come from context; outbox labels consume the Gateway, agent, and session projections. The roster's involving-me filter moves to the synchronous session-data owner, which applies it before subscribing and clears it on release. Picker parameters are derived together with their comparison keys.

This is a bounded checkpoint, and the whole sidebar lane remains unfinished. Across 18 changed production files, LOC grows 6,934 → 7,047 (+113) for explicit mount/focus registrations, cleanup, and the owner boundary. Five test files add 171 net lines. Total: 23 files, +594/−310 lines. The final line-cap repair keeps the catalog event adapter next to its subscription and reuses the existing mutation-error dismissal; it removes seven raw lines without changing behavior. No dependencies were added; existing tags, classes, routes, selectors, and lazy boundaries remain intact.

Evidence

Comparison base for the registration-port build/capture proof: 993ec298df4ee9e5a761553500c623f3c38feab6. Builds and captures ran on the same machine with synthetic fixtures. Those build/media rows precede the three-file repair at e20a4e21dbed9e51cd547a3b7ee469891703f8bd; no rebuild was run for its nullable-context and lint-only changes.

Check Result
pnpm tsgo:ui Passed, including a fresh run on the three-file repair
Catalog adoption/release focus 2 passed, 78 unrelated cases skipped; covers open and closed menus through native → adopted → native rendering
Inbox/attention suite 22 passed, including Tab wrapping across collapsed details, expanded actions, and an empty tab
Session-data warm boot 5 passed, including applying the saved roster filter before the first read and releasing it with the owner
Line-cap ratchet Passed across all 23 changed source files after the repair
Independent review Prior full-candidate/line-cap review clean through P2; fresh isolated P0–P2 repair review clean with all changed modules and consumers supplied
Production build, base and head Passed
Startup JS 336,820 → 336,824 B gzip (+4 B); raw bytes identical at 1,020,855; 7 JS requests both
Startup CSS 1 request, 38,500 B gzip both
Strict performance check Fails the same chat-boot limit on both sides: 1,495,333 → 1,495,334 B gzip (+1 B) against 1,490,000 B; startup checks pass
Synthetic visual comparison Sidebar, session menu, and open Inbox PNGs byte-identical before/after; all six captures inspected; zero page errors
Production Knip Final canonical pnpm deadcode:knip completed on e20a4e21dbed: no UI findings; exits 1 for two unchanged core files, src/auto-reply/reply/reply-admission-ticket.ts and src/auto-reply/reply/reply-turn-admission-owner.ts. These are outside the PR diff; no ignores added.
Three-file repair proof Exact standalone outbox case failed before the edit with ContextNotFoundError; afterward outbox/issue suites passed 15 tests and the real Chromium floating-refresh-card test passed (16 total). Targeted type-aware lint passed with one existing advisory warning and no errors.
Broad CI Full run 39170733122 passed at e20a4e21dbed, including openclaw/ci-gate; no failed jobs remain. ci:full is present.
Exact-head CI performance Job 117803325904 passed: startup JS 336,568 B gzip, 1,020,095 B raw, 7 requests; startup CSS 38,500 B gzip, 1 request. Chat boot 1,488,475 → 1,488,529 B (+54 B), below 1,490,000 B. These are the final CI measurements; earlier local before/after measurements above remain separately identified.

The prior-head run 39168004934 at f275184a9c11 had 34 named failures: three real-Gateway media names also failed on the latest completed scheduled main run, and the other 31 names were PR-only. Those are prior-head results, not evidence about the repaired head. The nullable-context repair addresses the reproduced standalone-card failure and restores the tested refresh surface. The repaired head has now passed full CI run 39170733122, covering the prior-head regression surfaces with no failed jobs. The two touched-file lint errors were also repaired without changing focus restoration or cleanup behavior.

The focused runs emitted strict-read diagnostics for SessionSectionHeader (renderSessionSection.group) and SidebarUpdateSurface. These remain open evidence. #176405 contains the tracked-read header-path repair; these warnings are not a CI exemption, and no matching-name main failure claim is made here. The capture warning was the expected Playwright service-worker block.

Checklist counts

Pattern Changed production: before After Whole lane: before After
Controller pattern 0 0 0 0
createEffect 11 7 30 26
createRenderEffect 0 0 0 0
untrack 16 11 36 31
Raw addEventListener 0 0 20 20
DOM queries, including generic calls 4 0 39 35
String-builder checklist matches 1 1 2 2
flush 2 2 3 3
Explicit owner wiring 1 1 7 7

Whole-lane production LOC: 35,735 → 35,840 (+105). Counts describe this checkpoint against its own base; they do not combine the separate sidebar checkpoints.

Categorized survivors in changed production files

These locations remain visible follow-up work unless an allowed snapshot category is named. A comment alone is not an exception to the final wave-zero targets. Paths below are under ui/src/components/.

Category Current locations
Effect: lazy catalog module admission app-sidebar-owner.tsx:400
Effects: roster query binding and child-to-owner publication sidebar-agent-roster.tsx:140, sidebar-agent-roster.tsx:149
Effects: Inbox route close and overflow measurement sidebar-attention.tsx:210, sidebar-attention.tsx:218
Effects: update recovery and countdown timer sidebar-update-card.tsx:80, sidebar-update-card.tsx:89
Initial reactive identity snapshots app-sidebar-session-list-render.tsx:112 (mounted lazy renderer), app-sidebar-session-list-render.tsx:226 (section kind), sidebar-agent-roster.tsx:103, sidebar-agent-roster.tsx:340 (keyed agent identity), sidebar-outbox-item.tsx:28 (initialEntry, retained click authority)
Tracking suppression/service delivery still to convert app-sidebar-session-list-render.tsx:273, app-sidebar-session-row-render.tsx:93, sidebar-agent-roster.tsx:139, sidebar-agent-roster.tsx:261, sidebar-attention.tsx:78, sidebar-attention.tsx:303
Explicit flushes still to review sidebar-attention.tsx:202, sidebar-update-card.tsx:138
Retained native menu owner app-sidebar-owner.tsx:80 (runWithOwner/createRoot)
Non-class string-builder match app-sidebar-session-row-render.tsx:227 joins ARIA description IDs

No raw listeners, render effects, or DOM queries remain in this checkpoint's changed production files. The remaining effects and non-snapshot tracking suppression are not claimed as completed wave-zero conversions.

Inspected synthetic screenshots

The sidebar and menu PNGs match the already-uploaded synthetic assets below. The Inbox before/after files are also byte-identical and are embedded below.

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

Preserve catalog focus and retained menus through native and adopted row
transitions. Track mounted Inbox controls for keyboard and return focus,
and apply the saved roster filter before its first subscription.

Keep catalog event adaptation at the subscription and reuse the existing
mutation-error dismissal.
@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-18T22:09:00.471974Z e20a4e2 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.

@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: f275184a9c

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

Comment on lines +74 to +75
function createSidebarAttentionFocus(root: () => HTMLElement): SidebarAttentionFocus {
const targets = new Map<HTMLElement, SidebarAttentionFocusKind>();

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.

P1 Badge Finish the refactor without growing production code

The commit’s own evidence reports a net increase of 115 production lines for this behavior-preserving Solid refactor, while the required UI refactor checklist says touched production code must be net-negative. Finish or narrow the cutover so this new focus-owner machinery replaces enough of the old implementation instead of landing as an explicitly unfinished, permanently larger checkpoint.

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

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 registers mounted sidebar rows and Inbox focus targets with their owners and applies the saved roster filter before subscribing.

Example: Open the roster with Involving me saved, with sessions agent:main:mine and agent:main:other.

  • Before: The roster can start its first read before the view applies the saved filter.
  • After: The session-data owner applies involvingMe before subscribing, so the first read requests the filtered roster.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, maintainer-directed refactoring with inspected visual parity, but the shared optional-context regression blocks merge.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Catalog adoption must preserve focus and retained menus, Inbox keyboard navigation must follow mounted controls, and the saved roster filter must apply to the first read.
Reason: The maintainer-authored direction reuses existing domain owners and explicitly explains the bounded lifecycle-registration growth.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the ownership refactor has maintainer direction, but its new optional context breaks shared cards outside the Inbox.

Priority: P2
Reviewed head: f275184a9c11eec904399ee0313650ad66e823e5

Before merge

  • Give the optional focus context a null default (P1) - Solid 2 treats an undefined context default as unset, so useContext throws before optional chaining can return. Shared renderers also run outside SidebarAttentionPanel: FloatingUpdateCard mounts the standalone recovery card without this provider, causing its new ref registration to prevent the “Server updated” recovery control from rendering. Exact-head UI CI also traces this error through standalone update, issue, and outbox cards. Declare the context as SidebarAttentionFocus | null with a null default, preserving optional registration rather than requiring every shared-card caller to install an Inbox provider.

Findings

  • [P1] Give the optional focus context a null default — ui/src/components/sidebar-attention-focus.ts:10-12

Tests

  • Missing end-to-end proof: The supplied captures do not demonstrate catalog adoption/release, populated-Inbox keyboard and approval-return focus, or standalone recovery-card rendering through the production UI; red-on-base evidence for the added regressions is also not supplied.
Agent review details

How this fits together

The Control UI sidebar consumes Gateway session and attention owners, renders catalog and Inbox rows, and routes keyboard focus and actions through existing owners.

flowchart TD
  A[Gateway state] --> B[Session data owner]
  B --> C[Sidebar projection]
  C --> D[Mounted catalog rows]
  E[Attention owner] --> F[Inbox panel]
  F --> G[Focus registry]
  G --> H[Shared card controls]
Loading

Technical review

Best possible solution:

Keep the existing owners and registrations, but make the focus context genuinely optional with a null default so standalone cards continue rendering.

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

The introduced helper, Solid's verified context contract, the standalone floating-card caller, and exact-head CI failure traces establish the regression without executing target code locally.

Is this the best way to solve the issue?

Explicit mounted lifetimes fit the existing ownership design; a null optional-context default is the smallest complete repair for the demonstrated failure.

Full review comments:

  • [P1] Give the optional focus context a null default — ui/src/components/sidebar-attention-focus.ts:10-12
    Solid 2 treats an undefined context default as unset, so useContext throws before optional chaining can return. Shared renderers also run outside SidebarAttentionPanel: FloatingUpdateCard mounts the standalone recovery card without this provider, causing its new ref registration to prevent the “Server updated” recovery control from rendering. Exact-head UI CI also traces this error through standalone update, issue, and outbox cards. Declare the context as SidebarAttentionFocus | null with a null default, preserving optional registration rather than requiring every shared-card caller to install an Inbox provider.
    Confidence: 1

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 4a9b42a5dbc5.

Provenance checked

  • Catalog focus and menu handoff keeps the original intent (e80558a: The Solid migration preserved catalog adoption, menu identity, and focus; later owned-ref work retained those contracts.)
  • Mounted catalog presentation keeps the original intent (2984089: Visible-projection admission avoids full presentation work for hidden or capped catalog rows.)
  • Roster filter ownership keeps the original intent (c289fc3: Roster consumers share the existing authoritative all-agent query while preserving Gateway-owned Involving me membership.)
  • Outbox retained click authority keeps the original intent (c4bf363: Mounted outbox handlers retain their original row and Gateway scope so later connection changes cannot retarget them.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/components/sidebar-outbox-item.test.tsx --maxWorkers=1
  • pnpm test ui/src/components/sidebar-update-card.test.tsx --maxWorkers=1
  • pnpm test ui/src/components/sidebar-issue-item.test.tsx --maxWorkers=1
  • pnpm test ui/src/components/sidebar-attention.test.ts --maxWorkers=1
  • pnpm test ui/src/app/navigation-surface.browser.test.tsx --maxWorkers=1

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 2984089 adds ui/src/components/app-sidebar-session-projection.ts:146 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 298408928484; files: ui/src/components/app-sidebar-session-projection.ts)

PR surface

Source +115, Tests +171. Total +286 across 23 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 18 393 278 +115
Tests 5 203 32 +171
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 596 310 +286

Labels

Label changes:

  • add P2: This is a bounded UI ownership refactor with a concrete, narrowly repairable regression before merge.
  • add merge-risk: 🚨 compatibility: Existing standalone shared-card callers now throw because they do not provide the newly introduced Inbox context.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp 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:

  • P2: This is a bounded UI ownership refactor with a concrete, narrowly repairable regression before merge.
  • merge-risk: 🚨 compatibility: Existing standalone shared-card callers now throw because they do not provide the newly introduced Inbox context.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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:43 PM ET / 21:43 UTC.

Use an explicit null default for optional sidebar focus registration so standalone notifications, outbox items, approvals, and the refresh card render without an Inbox provider. Resolve the two touched-file lint errors without changing focus or cleanup behavior.
@steipete
steipete merged commit c8c8e88 into main Oct 18, 2026
127 checks passed
@steipete
steipete deleted the solid2/w-zero-sidebar-registrations branch October 18, 2026 22:51
@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
openclaw#176507)

* refactor: register sidebar rows and focus targets with their owners

Preserve catalog focus and retained menus through native and adopted row
transitions. Track mounted Inbox controls for keyboard and return focus,
and apply the saved roster filter before its first subscription.

Keep catalog event adaptation at the subscription and reuse the existing
mutation-error dismissal.

* fix(ui): render sidebar cards outside the inbox

Use an explicit null default for optional sidebar focus registration so standalone notifications, outbox items, approvals, and the refresh card render without an Inbox provider. Resolve the two touched-file lint errors without changing focus or cleanup behavior.
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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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