Repository navigation
refactor(ui): keep navigation focus targets with their owners - #177149
Conversation
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces navigation focus queries with lifecycle-bound toggle registrations and a sidebar-owned active-button handle. Example: Collapse Pages navigation at 1280×800.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: the maintainer-directed refactor preserves navigation focus through existing owners, with no actionable correctness or security findings; exact-head CI is still pending. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI shell handles navigation toggles and focus restoration; sidebar and header components provide mounted controls through the existing shell/outlet registry. flowchart TD
A[Keyboard or navigation action] --> B[Shell chrome owner]
C[Topbar and chat header] --> D[Shell and outlet registry]
E[Sidebar owner] --> F[Active rail button]
D --> B
F --> B
B --> G[Restore keyboard focus]
Technical reviewBest possible solution: Retain the focused owner-held registration cutover and let the existing exact-head CI gate complete. Do we have a high-confidence way to reproduce the issue? This refactor claims no existing user-visible failure; source confirms the markup queries being replaced, and supplied production captures exercise preserved navigation focus. Is this the best way to solve the issue? The change uses the existing registry and sidebar owner, removes both superseded queries, and gives each conditional control an explicit cleanup lifetime. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4cba3b50298f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +49, Tests +129. Total +178 across 13 files. Added test files: 0. View PR surface stats
Review metrics
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 19, 2026, 4:55 AM ET / 08:55 UTC. |
|
Merged via squash auto-merge.
|
What Problem This Solves
The shell still searched rendered markup to find the navigation controls that should regain keyboard focus.
User Impact
No intended visual or interaction change. Collapsing desktop navigation keeps focus on the selected rail view; dismissing the mobile drawer returns focus to the visible toggle. Existing tags, classes, routes, and selectors remain unchanged.
Why This Change Was Made
Register the topbar and conditional chat-header toggles through the existing shell/outlet registry, and let the sidebar expose its active rail button. Registrations follow Solid component lifetimes and release when a branch or bridge unmounts. The shell reads these owned handles instead of querying descendant markup. The shared ref factory has two callers; it adds no effects, listeners, dependencies, or eager page imports.
Evidence
Base:
fd547069429314c8a8cfd68360dc23278e6c6653. Head:a7139210257d84cea296f3b3097e5e75f3ed5ae3. The rebase preserved the reviewed patch exactly.pnpm tsgo:ui; app, components, and chat test graphs passedci:fullrequested for shell, sidebar, and chat; app navigation-focus test left to CIProduction LOC: 2,990 → 3,039 (+49). Tests: 2,180 → 2,309 (+129). Total: 13 files, +222/−44. Growth is registration, lifecycle cleanup, and regressions that reconnect retired nodes so connected-element filtering cannot conceal stale registry entries.
Existing coupled-sidebar survivors are outside the app/lib lane: presentation commit effect at
app-sidebar.tsx:264, plugin fallback mounting atapp-sidebar.tsx:223–225, and intentional keyed-identity snapshots atapp-sidebar-rail.tsx:193,544. None was added or broadened here. Across this lane since its original baseline, effects are 20 → 6 (−70%), render effects 2 → 0, owned DOM listeners 3 → 0, and queries 43 → 5; remaining queries belong to foreign-DOM islands. The separate layout cleanup remains in #176965.The attached screenshots use synthetic data only and were inspected in full. They cover desktop collapsed focus, mobile drawer open, and mobile dismissed focus, in before/after order. The capture used the existing production build and screenshot helper; initial standalone harness setup errors were corrected by running it in a Vitest worker. That first worker also built an unused bundle once; the final head capture used an explicit prebuilt-server configuration. No full local E2E suite or parity run was executed.