You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): Tab from Permissions menu keeps focus inside model picker - #47114
When a keyboard user opens the nested Permissions menu in the model picker and presses Tab, focus escapes to the picker trigger behind the still-open popover instead of staying on a visible control inside it. Permissions: <mode> is the last footer tab stop and Base UI portals MenuPopup outside PopoverPopup, so Tab hits the popover's after-focus-guard from outside and focuses its trigger without closing it.
Change
Handle unmodified Tab on PermissionsMenu's MenuPopup (ComposerModelEffort.tsx) to close only the menu and focus its trigger inside the open picker, so the next Tab closes the picker. Modified Tab is ignored because Shift+Tab already closes the menu and returns to the trigger by default; open/blur handling stays unchanged. In ComposerPermissionsSection.browser.test.tsx, the larger diff moves #46640's Picker fixture to module scope unchanged so the new test reuses it while #46640's case stays unchanged in behavior and passes.
Scope
Web-only bug fix for focus escaping behind an open popover (no issue needed; mobile uses ThreadSettingsSheet.tsx).
Verification
Setup. Ubuntu 26.04, Chromium (Playwright debugging-port input), dark theme, 1280x820, isolated dev state with Replay (dev) (Showcase) and demo-project.
Steps. Focus composer → Tab to Showcase → Enter → Tab to Permissions: Full access → Enter → Tab.
macOS / Windows Electron, Safari, Firefox (tested in Linux Chromium).
Hardware OS key events (tested via Playwright debugging-port input and Vitest browser mode).
Automated checks and real-app verification details
Real-app checks on 7e2b094714ae (base) vs ab9ddd7aff82 (head) using Playwright debugging-port key events:
Replay (dev) (Showcase) thread: base after Tab had popoverCount: 1, menuCount: 0, activeElement: button[aria-label="Showcase"]; head after Tab had popoverCount: 1, menuCount: 0, activeElement: button[aria-label="Permissions: Full access"].
New draft thread (Claude Opus 5.5): base escaped to button[aria-label="Claude Opus 5.5, Medium"] with popoverCount: 1; head landed on button[aria-label="Permissions: Full access"] with popoverCount: 1, menuCount: 0.
Controls unchanged on head: Tab from closed Permissions: Full access closes the picker (popoverCount: 0) and focuses Start voice input; Shift+Tab from open Permissions menu closes the menu and focuses Permissions: Full access; Tab from the effort column's Context Window: 1M side menu closes only that menu and moves to Standard inside the picker; Arrow keys, Enter, Escape, type-ahead (s → Supervised), and pointer selection all still work.
New browser test in ComposerPermissionsSection.browser.test.tsx: failed on 7e2b094714ae (Permissions: Full access did not have focus after Tab) and passed on ab9ddd7aff82 (9/9 tests passing, including the existing effort-shortcut test).
Concurrent stress loop: 2 x 100 runs of ComposerPermissionsSection.browser.test.tsx passed 200/200 (0 failures).
vp run check:changed 7e2b094714ae86c860590c2961a3f45b4af2613d: format (0.5s), lint (0.8s), knip (7.5s), typecheck (0.5s), test (2 files, 11 tests, 8.9s), react compiler (0.7s) — all passed.
Reviewing files that changed from the base of the PR and between ab9ddd7 and 6e5358d.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The Permissions menu now handles unmodified Tab by closing the menu and restoring focus to its trigger. The browser test fixture moves to module scope, and a new test verifies the behavior.
Changes: Permissions menu Tab handling
Layer / File(s)
Summary
Handle Tab and verify focus restoration apps/web/src/components/chat/ComposerModelEffort.tsx, apps/web/src/components/chat/ComposerPermissionsSection.browser.test.tsx
PermissionsMenu closes on unmodified Tab and returns focus to its trigger. The browser test fixture moves to module scope, and a new test checks focus restoration. Modified Tab combinations and other keys retain existing behavior.
Pressing Tab in the Permissions menu now closes only that menu and keeps focus inside the open model picker. The change is limited to the web UI and is covered by a new browser test. It is low risk to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: unmodified Tab from the nested Permissions menu no longer leaves focus behind the open model picker. It follows the conventional commit format and matches the Composer…
Description check
The description follows the template. Problem explains the bug, the expected behavior, and the reproduction steps. Change explains the Tab handling in PermissionsMenu and why modified Tab is ignored. …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: unmodified Tab from the nested Permissions menu no longer leaves focus behind the open model picker. It follows the conventional commit format and matches the ComposerModelEffort.tsx change and the new browser test. It is specific and clear.
Full details: Description check
Explanation
The description follows the template. Problem explains the bug, the expected behavior, and the reproduction steps. Change explains the Tab handling in PermissionsMenu and why modified Tab is ignored. Scope says it is a web-only bug fix and gives the reason no issue is linked. Verification gives focused browser test results, real-app before/after steps with screenshots, and lists what was not tested. The template asks for a linked issue or an explanation for why none is needed. The description gives the explanation, so it passes. The template's agent-model line is present as a Gemini attribution.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Environment on both sides: Linux Chromium web client, 1280×800, light theme, fresh synthetic demo project and new-thread composer, Replay (dev) Showcase.
Steps: Click the new-thread composer (Full access); Tab twice to the model picker trigger; Enter; Tab through the picker to Permissions: Full access; Enter; unmodified Tab. On head, Tab once more to exit the picker. Replay (dev) Showcase supplies the model list; no model turn is needed.
Scenario: Tab from Permissions returns to the model picker before exiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a keyboard user opens the nested Permissions menu in the model picker and presses
Tab, focus escapes to the picker trigger behind the still-open popover instead of staying on a visible control inside it.Permissions: <mode>is the last footer tab stop and Base UI portalsMenuPopupoutsidePopoverPopup, soTabhits the popover's after-focus-guard from outside and focuses its trigger without closing it.Change
Handle unmodified
TabonPermissionsMenu'sMenuPopup(ComposerModelEffort.tsx) to close only the menu and focus its trigger inside the open picker, so the nextTabcloses the picker. ModifiedTabis ignored becauseShift+Tabalready closes the menu and returns to the trigger by default; open/blur handling stays unchanged. InComposerPermissionsSection.browser.test.tsx, the larger diff moves#46640'sPickerfixture to module scope unchanged so the new test reuses it while#46640's case stays unchanged in behavior and passes.Scope
Web-only bug fix for focus escaping behind an open popover (no issue needed; mobile uses
ThreadSettingsSheet.tsx).Verification
Setup. Ubuntu 26.04, Chromium (Playwright debugging-port input), dark theme, 1280x820, isolated dev state with
Replay (dev)(Showcase) anddemo-project.Steps. Focus composer →
TabtoShowcase→Enter→TabtoPermissions: Full access→Enter→Tab.7e2b094714ae)ab9ddd7aff82)Permissions menu open on Full access
Permissions menu open on Full access
After Tab: picker open, focus on Showcase behind it
After Tab: menu closed, focus on Full access in picker
Links.
apps/web/src/components/chat/ComposerModelEffort.tsx,apps/web/src/components/chat/ComposerPermissionsSection.browser.test.tsx.Not shown.
Automated checks and real-app verification details
7e2b094714ae(base) vsab9ddd7aff82(head) using Playwright debugging-port key events:Replay (dev)(Showcase) thread: base afterTabhadpopoverCount: 1, menuCount: 0,activeElement: button[aria-label="Showcase"]; head afterTabhadpopoverCount: 1, menuCount: 0,activeElement: button[aria-label="Permissions: Full access"].Claude Opus 5.5): base escaped tobutton[aria-label="Claude Opus 5.5, Medium"]withpopoverCount: 1; head landed onbutton[aria-label="Permissions: Full access"]withpopoverCount: 1, menuCount: 0.Tabfrom closedPermissions: Full accesscloses the picker (popoverCount: 0) and focusesStart voice input;Shift+Tabfrom open Permissions menu closes the menu and focusesPermissions: Full access;Tabfrom the effort column'sContext Window: 1Mside menu closes only that menu and moves toStandardinside the picker; Arrow keys,Enter,Escape, type-ahead (s→Supervised), and pointer selection all still work.ComposerPermissionsSection.browser.test.tsx: failed on7e2b094714ae(Permissions: Full accessdid not have focus afterTab) and passed onab9ddd7aff82(9/9 tests passing, including the existing effort-shortcut test).ComposerPermissionsSection.browser.test.tsxpassed 200/200 (0 failures).vp run check:changed 7e2b094714ae86c860590c2961a3f45b4af2613d: format (0.5s), lint (0.8s), knip (7.5s), typecheck (0.5s), test (2 files, 11 tests, 8.9s), react compiler (0.7s) — all passed.Generated with Gemini 4 Neon in T3 Code Nightly