Skip to content

fix: composer capability menu steals newer keyboard focus - #175052

Merged
steipete merged 2 commits into
mainfrom
solid2/fix-composer-skill-focus
Oct 17, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/fix-composer-skill-focus

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Proof Result
chat-composer-menu.test.tsx --maxWorkers=1 Initial suite: 6/6 passed (6.10 s wall, 379 ms tests). After refinement, newer item/external cases passed; the stronger closure-only case reproduced the controlled-open ordering gap and now passes with the live-open check (5.96 s wall, 509 ms tests). First-item focus after removing Back is also asserted. Exact-head full-suite proof comes from CI below.
pnpm tsgo:ui Passed after a complete isolated frozen workspace install.
Focused lint and format Passed. Lint reports one existing reactivity warning at line 250 in unchanged test setup; no new warning. Format and diff checks passed.
Independent Codex review Exact staged final candidate scoped-clean through P2; the sole earlier INDEX-only finding was resolved by staging the already-tested live-open fix.
Exact-head ci:full run 39000441133 6,995 unit tests passed; composer regressions, real-Gateway, performance, type/lint, and security passed. CI remains red on 11 baseline E2E cases and one unrelated WebKit Layout geometry case; native admin evidence retains the exception.

Behavior 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
Touched production file metric Before After
LOC 607 606
Controller-pattern references 0 0
createEffect 1 1
untrack 1 1
Native event listeners 0 0
DOM queries 1 1
Animation-frame callbacks 1 0

Production 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.tsx case, “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 main 0d537f1ff727289ee30794eb380e89baeff9876a and PR 3def95ead1b0e569f46f6ed0546207c65b17ef84. 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 desktop
  • ui/src/e2e/chat-plugin-steering.e2e.test.ts > Plugin steering notices > keeps projected plugin steering in a collapsed native notice on dark mobile
  • ui/src/e2e/chat-plugin-steering.e2e.test.ts > Plugin steering notices > keeps projected plugin steering in a collapsed native notice on light desktop
  • ui/src/e2e/chat-plugin-steering.e2e.test.ts > Plugin steering notices > keeps projected plugin steering in a collapsed native notice on light mobile
  • ui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > keeps every PR visible and actionable at 1440 in dark
  • ui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > keeps every PR visible and actionable at 1440 in light
  • ui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > keeps every PR visible and actionable at 390 in dark
  • ui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > keeps every PR visible and actionable at 390 in light
  • ui/src/e2e/chat-pull-requests.e2e.test.ts > session pull request chips > shows detected PRs in Details with rate-limit staleness
  • ui/src/e2e/chat-retry-failure.e2e.test.ts > Control UI retry and terminal failure > preserves restart partials and a neutral durable recovery notice through reload
  • ui/src/e2e/chat-pr-publication-state.e2e.test.ts > Control UI PR publication state > recovers shared receipts and observes committed status without publishing
  • src/components/solid/menu-shortcut-alignment.browser.test.tsx > keeps Layout hints aligned before and after panel styles load, and hidden on mobile

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 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 17, 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-17T03:55:20.044641Z 3def95e 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: S labels Oct 17, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. label Oct 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserve 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.

  • Before: A queued animation-frame callback moves focus back to Back.
  • After: The docs row keeps focus, and a pending menu close prevents the focus reset.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch appears correct and useful, with meaningful component coverage but no observed shipped-entry-point proof of the focus change.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; component tests exercise the focus repair, while all four inspected prepared screenshots show unrelated system-event disclosures.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Keyboard focus jumps back to Back after the user has already moved to another capability-menu item.
Reason: The maintainer-authored change restores the established focus-preservation contract with a smaller production implementation.

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
Reviewed head: 3def95ead1b0e569f46f6ed0546207c65b17ef84

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped-browser focus trace demonstrates the changed ordering; the supplied component regressions cover it, and the body reports pre-fix failures without an attached baseline trace.
Agent review details

How this fits together

Chat 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]
Loading

Technical review

Best 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

  • Capability-view focus timing changes intended behavior with a stated reason (07384e0: The Solid port preserved composer focus behavior using a deferred first-item focus callback; the native-menu migration retained that behavior.)
  • Native Menu selection and handle ownership keeps the original intent (5469173: The migration consolidated composer menus under shared native controls while preserving actions, navigation, and focus; the patch continues using that owner.)
  • Safari attachment-picker anchor keeps the original intent (9ef8b5d: Safari needs the current Plus-button rectangle for upload-picker placement; the patch still passes the same overlay trigger.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -1, Tests +100, Docs +2. Total +101 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 21 22 -1
Tests 1 100 0 +100
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 123 22 +101

Review metrics

Metric Value Why it matters
Production versus regression coverage Production −1 LOC; tests +100 LOC The additional parameterized coverage protects distinct focus and closure outcomes without adding production state or test-only exports.

Labels

Label changes:

  • add P2: The bug interrupts keyboard navigation in a limited composer-menu workflow.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The bug interrupts keyboard navigation in a limited composer-menu workflow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 17, 2026, 12:24 AM ET / 04:24 UTC.

@steipete
steipete merged commit 2437641 into main Oct 17, 2026
110 of 118 checks passed
@steipete
steipete deleted the solid2/fix-composer-skill-focus branch October 17, 2026 04:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…75052)

* fix(ui): preserve focus while navigating capability menus

* fix(ui): respect live menu close requests during focus settlement
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. docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant