Repository navigation
fix(ui): palette selections open the wrong agent and skip result rows - #130344
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
The command-palette repair is verified at The original Chromium reproduction selected Reviewer but opened Main. The fixed flow opens Reviewer's canonical settings URL, preserves the global chat agent, survives reload/Back, and routes keyboard Enter to the highlighted agent. Mixed groups now share one display/keyboard order; option IDs use displayed positions so punctuation and accepted UTF-16 session keys cannot alias or throw. Production is net -9 lines (+33/-42); tests are +231/-20. Local verification passed: 152 focused tests across eight owner/sibling files; final 25-test palette rerun; all six Chromium agent-page scenarios; production UI build/performance; the full changed-file policy, format, type, lint, i18n and Knip gates. A separate rendered-browser pass checked click/Enter plus 120 keyboard transitions with selected-row/ARIA identity. These browser flows use deterministic mocked Gateway traffic, not authenticated provider/channel execution. The PR body contains inspected, sanitized before/after captures. Fresh structured Codex autoreview and independent source review found no actionable issues. Exact-head hosted CI and Workflow Sanity passed. Proceeding through the native prepare/merge gates. CI note: the first run's unrelated mobile terminal-menu pointer click timed out with an SVG intercepting the target (350 other tests in that shard passed). The original two-test file passed twice unchanged locally, including its normal pointer click. One failed-job retry used the same commit; no timeout increase, forced click, assertion change, or production workaround was added. Follow-up: investigate this intermittent mobile menu hit-target failure if it recurs; its underlying cause is not yet proven. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where selecting a named agent from the Control UI command palette opened the default agent's settings instead. Keyboard navigation also skipped visible rows when matches spanned categories, and session keys differing only in punctuation could give two options the same accessibility ID.
Related: #128356, which introduced catalog search (
798c21af7b96, authored by @clawsweeper and merged by @VACInc on August 24).Why This Change Was Made
Keep the agent identity attached to its catalog result and carry the existing navigation options through the palette and shell to the canonical agent route. Agent settings remain URL-owned and do not change the selected chat agent. Keyboard selection and rendering now use the same grouped result order; accessibility IDs use that displayed position instead of lossy session-key conversion.
The repair removes the positional filter wrapper duplication. Production: +33/-42, net -9 lines. No new dependencies, configuration, storage, protocol, or Gateway behavior. AI-assisted; independently reviewed.
User Impact
Clicking or pressing Enter on an agent result opens that agent, including under a mounted URL prefix. Arrow keys follow the visible rows and screen-reader focus identifies the selected result. Reload and browser Back preserve the expected route and chat-agent scope.
Evidence
The named-agent regression failed in real Chromium before the fix: clicking Reviewer opened
/settings/agentswith Main selected. The same flow now opens/settings/agents/reviewerwith Reviewer selected, survives reload, and leaves the chat agent unchanged after Back.Before:
After:
Both images were inspected and contain only synthetic fixture data. Browser tests run the actual Control UI with a deterministic mocked Gateway; they are not authenticated provider/channel proof.
pnpm ui:buildpassed, including 768 compressed-asset sidecars and the startup performance budget.Focused browser command:
OPENCLAW_CAPTURE_UI_PROOF=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/agent-page-scope.e2e.test.ts.