sessions: Fix duplicate agent mode picker tab stop - #334308
Conversation
Delegate toolbar focus to the nested sidebar button so the inert action-item wrapper is not exposed as a separate tab stop. Add regression coverage for focus and activation.\n\nFixes #333576\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation follows established action-view-item patterns and includes appropriate regression coverage.
Review tier: Balanced
Findings: None
What changed in this PR
Fixes the sidebar host picker’s duplicate tab stop by delegating toolbar focus behavior to its nested button.
Changes:
- Delegates focus, blur, and focusability to the picker button.
- Adds browser regression coverage for tab order, focus state, and activation.
| File | Description |
|---|---|
hostFilterActionViewItem.ts |
Corrects sidebar picker focus delegation. |
hostFilterActionViewItem.test.ts |
Tests the corrected keyboard focus behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Henning Dieterichs (hediet)
left a comment
There was a problem hiding this comment.
Approved after current-head Copilot Code Review and GPT Luna found no security issue in the full PR patch.
Screenshot ChangesBase: 2 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details. Errored (8)Fixtures that failed to render — no screenshot was produced.
|
Keep focus on the Interactive picker trigger instead of exposing its inert toolbar wrapper as a second tab stop. Add regression coverage for the wrapper and trigger focus state.\n\nFixes #333576\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Justin Chen (justschen)
left a comment
There was a problem hiding this comment.
thanks!
Henning Dieterichs (hediet)
left a comment
There was a problem hiding this comment.
Approved after manual review
Have enum pickers return their trigger directly so the action view item can manage focus without a fragile selector. Preserve the existing wrapper fallback for composite pickers.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1428be8
Fixes #333576
The Agent Host mode picker rendered its own focusable trigger inside a toolbar action item. The wrapper also participated in the toolbar focus model, producing an extra inert tab stop before the working Interactive trigger.
Delegate focus to the picker trigger and keep the wrapper out of the tab order. The regression test verifies that the wrapper is not tabbable, only one descendant is tabbable, and toolbar focus reaches the working trigger.
Testing
npm run hygienenpm run typecheck-clientnpm run transpile-client./scripts/test.sh --run src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostSessionConfigPicker.test.tstabIndex=0, its wrapper has notabindex, and it is the only tabbable descendant