Repository navigation
fix: composer capability menu steals newer keyboard focus - #175052
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 changesPreserve newer keyboard focus and menu-close requests when switching composer capability views. Example: Return from tools:docs to Connectors, then focus the docs connector row.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes a focus hazard still present on main, and inspection found no introduced code defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherChat and New Session render capability views through the shared composer Plus menu; Solid updates the rows, while the native Menu owns visibility and keyboard navigation. flowchart LR
A[Keyboard selection] --> B[Composer Plus menu]
B --> C[Capability view state]
C --> D[Solid row rendering]
D --> E[Settlement callback]
F[Native Menu visibility] --> E
E --> G[Preserved or initial focus]
Technical reviewBest possible solution: Retain the settlement-based focus repair within the existing composer and native-menu owners. Do we have a high-confidence way to reproduce the issue? Current main visibly queues an unconditional focus reset after a view change, allowing it to overwrite a subsequent focus choice; no target code was executed during this review. Is this the best way to solve the issue? The change addresses the delayed callback directly, reads existing visibility authority, and preserves attachment anchoring without adding another lifecycle owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6cf7c4775738. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -1, Tests +100, Docs +2. Total +101 across 3 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 17, 2026, 12:24 AM ET / 04:24 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…75052) * fix(ui): preserve focus while navigating capability menus * fix(ui): respect live menu close requests during focus settlement
What Problem This Solves
Fixes keyboard focus jumping back to Back after moving to another capability-menu item immediately after changing views.
User Impact
Users can keep navigating skills and connector tools without a delayed focus reset interrupting them. Closing the menu or moving focus elsewhere also wins over an unfinished view change.
Why This Change Was Made
A keyed Back row can survive a view transition, while the composer queued an unconditional animation-frame focus reset. Focus now moves after Solid settles the new rows, provided both the requested and accepted menu state are open and focus has not moved elsewhere. Reading the live requested state also covers a controlled close that Menu has not applied yet. The private helper consumes the existing overlay and component props; no frame, listener, copied state, or cancellation state is added.
This focused follow-up fixes a pre-existing focus hazard found while investigating the skill-library E2E failure in #174792. The owner paths were unchanged on that PR; the exact failing CI event ordering remains unobserved.
Evidence
chat-composer-menu.test.tsx --maxWorkers=1pnpm tsgo:uici:fullrun 39000441133Behavior and focus only; no layout, styling, selector, or route changes. Direct DOM-focus proof covers the change. Startup imports and lazy boundaries are unchanged, so no local build or startup-byte comparison was run.
Scope and size
createEffectuntrackProduction decreases by 1 line while replacing the pending frame with live open/focus checks and removing redundant DOM arguments and the pre-connection handle guard (Menu supplies its ref before exposing selectable rows). Test LOC: 258 → 358 (+100), one parametrized behavioral regression with no test-only production exports. Documentation: +2 lines. Existing reactive-read diagnostics occur only in unchanged tests.
CI failure attribution
All 11 E2E failure names match the latest completed scheduled main run 38999305057: four plugin-steering notice variants, the restart-recovery notice, shared PR-receipt dismissal, and five compact PR-chip cases. Notice grouping (#173838) and compact PR presentation (#173842) already landed before this branch. The informational failure table calls plugin steering new because it runs in a different shard on main; the case-name comparison confirms the same four failures.
The additional WebKit
menu-shortcut-alignment.browser.test.tsxcase, “keeps Layout hints aligned before and after panel styles load, and hidden on mobile,” compares exact fractional bounds around a CSS import. Its right edge differs by about 0.012 px and widths by at most 0.035 px. That test mounts the Layout menu and never imports or mounts this composer callback. Its owner, native Menu/overlay, keyboard hints, styles, and test are unchanged. This case passed in the scheduled main run; it is independently attributed as an unrelated existing geometry/timing failure, not claimed as a matching main failure.The actual CI checkout is merge
36196992d783d20afcec10ab9747cf263450ff28, with ordered parents main0d537f1ff727289ee30794eb380e89baeff9876aand PR3def95ead1b0e569f46f6ed0546207c65b17ef84. All 41 inspected failure input blobs are identical between that baseline and tested merge. The contribution remains exactly the three files listed above. Native evidence records every failed job and aggregate propagation; no failed check is represented as passing.Exact failed cases
ui/src/e2e/chat-plugin-steering.e2e.test.ts > Plugin steering notices > keeps projected plugin steering in a collapsed native notice on dark desktopui/src/e2e/chat-plugin-steering.e2e.test.ts > Plugin steering notices > keeps projected plugin steering in a collapsed native notice on dark mobileui/src/e2e/chat-plugin-steering.e2e.test.ts > Plugin steering notices > keeps projected plugin steering in a collapsed native notice on light desktopui/src/e2e/chat-plugin-steering.e2e.test.ts > Plugin steering notices > keeps projected plugin steering in a collapsed native notice on light mobileui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > keeps every PR visible and actionable at 1440 in darkui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > keeps every PR visible and actionable at 1440 in lightui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > keeps every PR visible and actionable at 390 in darkui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > keeps every PR visible and actionable at 390 in lightui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > shows detected PRs in Details with rate-limit stalenessui/src/e2e/chat-retry-failure.e2e.test.ts > Control UI retry and terminal failure > preserves restart partials and a neutral durable recovery notice through reloadui/src/e2e/chat-pr-publication-state.e2e.test.ts > Control UI PR publication state > recovers shared receipts and observes committed status without publishingsrc/components/solid/menu-shortcut-alignment.browser.test.tsx > keeps Layout hints aligned before and after panel styles load, and hidden on mobile