Repository navigation
refactor: give mounted sidebar rows and Inbox controls explicit owners - #176507
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| function createSidebarAttentionFocus(root: () => HTMLElement): SidebarAttentionFocus { | ||
| const targets = new Map<HTMLElement, SidebarAttentionFocusKind>(); |
There was a problem hiding this comment.
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 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis 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.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete 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 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4a9b42a5dbc5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +115, Tests +171. Total +286 across 23 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment 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.
|
Merged via squash.
|
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.
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
nulldefault, so shared renderers outside the Inbox skip registration; Solid 2 treats anundefineddefault 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 ate20a4e21dbed9e51cd547a3b7ee469891703f8bd; no rebuild was run for its nullable-context and lint-only changes.pnpm tsgo:uipnpm deadcode:knipcompleted one20a4e21dbed: no UI findings; exits 1 for two unchanged core files,src/auto-reply/reply/reply-admission-ticket.tsandsrc/auto-reply/reply/reply-turn-admission-owner.ts. These are outside the PR diff; no ignores added.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.e20a4e21dbed, includingopenclaw/ci-gate; no failed jobs remain.ci:fullis present.The prior-head run
39168004934atf275184a9c11had 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 run39170733122, 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) andSidebarUpdateSurface. 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
createEffectcreateRenderEffectuntrackaddEventListenerflushWhole-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/.app-sidebar-owner.tsx:400sidebar-agent-roster.tsx:140,sidebar-agent-roster.tsx:149sidebar-attention.tsx:210,sidebar-attention.tsx:218sidebar-update-card.tsx:80,sidebar-update-card.tsx:89app-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)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:303sidebar-attention.tsx:202,sidebar-update-card.tsx:138app-sidebar-owner.tsx:80(runWithOwner/createRoot)app-sidebar-session-row-render.tsx:227joins ARIA description IDsNo 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.