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): focus command dialog popup when its search input is disabled - #46890
When the file picker (Ctrl+P / Cmd+P) or project content search (Ctrl+Shift+F / Cmd+Shift+F) opens with no active project (e.g. /settings/general), or content search opens without filesystem read permission, focus stays outside the dialog: Escape returns to the command palette unfocused, and a second Escape closes Settings behind it. Swapping to a disabled search view from an open command palette (Ctrl+K → "Go to file" / "Search project contents") also leaves focus on document.body in Firefox (and, per the HTML spec, Safari), where removing the focused input fires no focusout.
Change
CommandDialogPopup (apps/web/src/components/ui/command.tsx): query input:not(:disabled):not([aria-hidden="true"]) in initialFocus so Base UI skips disabled and hidden inputs and focuses command-dialog-popup.
claimFocusInOpenDialog (apps/web/src/components/CommandPaletteContent.tsx): focus [role="dialog"] when input.disabled on view swaps.
Two browser tests in apps/web/src/components/CommandPaletteContent.browser.test.tsx.
Scope
Web-only bug fix (desktop wraps apps/web; mobile uses a React Native modal); obvious bug, no issue filed.
Verification
Setup: Linux 7.0.0-44-generic, Chromium & Firefox (1280x800), dark theme, isolated server (Demo Project); keys via debugging port. Steps:/settings/general → Ctrl+P → Escape → Escape.
Skip disabled and aria-hidden inputs in CommandDialogPopup's initialFocus so Base UI falls back to the dialog popup, and focus the enclosing dialog in claimFocusInOpenDialog when an open dialog swaps to a disabled input.
Reviewing files that changed from the base of the PR and between 16987d9 and 5d3cee7.
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 command palette now focuses the dialog popup when its input is disabled or when no enabled, accessible input is available. Browser tests cover opening a palette with a disabled input and switching to one.
Changes: Command palette focus handling
Layer / File(s)
Summary
Select and apply the dialog focus target apps/web/src/components/ui/command.tsx, apps/web/src/components/CommandPaletteContent.tsx, apps/web/src/components/CommandPaletteContent.browser.test.tsx
Initial focus selection skips disabled and aria-hidden inputs and falls back to the popup. When the command palette input is disabled, focus moves to the dialog. Browser tests cover both disabled-input scenarios.
This fixes dialog focus when the command palette search input is disabled, so focus lands on the dialog instead of an unusable input. The change is small and covered by browser tests. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(web): focus command dialog popup when its search input is disabled" describes the main change. The diff makes the command dialog popup take focus when its search input is disabled, and …
Description check
The description covers the problem, change, scope, and verification sections of the template. It explains the bug, lists the changed files and the focus logic, justifies the web-only scope, and gives …
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 "fix(web): focus command dialog popup when its search input is disabled" describes the main change. The diff makes the command dialog popup take focus when its search input is disabled, and the title follows the conventional commit format from the template. The title is specific and matches the changeset.
Full details: Description check
Explanation
The description covers the problem, change, scope, and verification sections of the template. It explains the bug, lists the changed files and the focus logic, justifies the web-only scope, and gives before/after evidence with a screenshot pair, test output, and a stress-loop result. It also states what was not verified. The remaining gaps are minor: the Verification section includes a 'Not shown' list, and the screenshots are linked as gists rather than embedded, which the template allows. The template's note about agent attribution is handled with 'Generated with Gemini 4 Neon in T3 Code Nightly'.
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; 5 remain after this review.
Real web app (fresh isolated server/database for each commit), driven by the repository scenarios:prove runner in headless Chromium and Firefox on Linux, 1280×800, light theme. Seed one synthetic demo project through t3.project, then open Settings directly with no active project; no model turns or external provider required. Firefox uses web({ browser: "firefox", viewport: { width: 1280, height: 800 } }) with no clipboard permission. Wait for browser animations to finish before captures. Both comparisons exited 0. All paired screenshots and recordings were visually inspected.
For each of four paths, open /settings/general with no active project and click the first Settings row. Open file search with Ctrl+P, contents search with Ctrl+Shift+F, or open Ctrl+K, enter Go to file / Search project contents, and press Enter. Capture the disabled search, press Escape and capture the palette, then press Escape again and capture the final screen. Record focus inside the popup at the first two stages and whether Settings stays open and the palette closes. Run the identical scenario on both commits in both browsers.
On base, both direct shortcuts lose focus and the second Escape closes Settings behind an open palette in both browsers. Firefox also loses focus on both in-palette swaps; Chromium already handles those swaps. On head, all four paths pass in both browsers.
Chromium
Scenario: Disabled command searches retain focus and Escape preserves Settings
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:S10-29 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 the file picker (
Ctrl+P/Cmd+P) or project content search (Ctrl+Shift+F/Cmd+Shift+F) opens with no active project (e.g./settings/general), or content search opens without filesystem read permission, focus stays outside the dialog:Escapereturns to the command palette unfocused, and a secondEscapecloses Settings behind it. Swapping to a disabled search view from an open command palette (Ctrl+K→"Go to file"/"Search project contents") also leaves focus ondocument.bodyin Firefox (and, per the HTML spec, Safari), where removing the focused input fires nofocusout.Change
CommandDialogPopup(apps/web/src/components/ui/command.tsx): queryinput:not(:disabled):not([aria-hidden="true"])ininitialFocusso Base UI skips disabled and hidden inputs and focusescommand-dialog-popup.claimFocusInOpenDialog(apps/web/src/components/CommandPaletteContent.tsx): focus[role="dialog"]wheninput.disabledon view swaps.apps/web/src/components/CommandPaletteContent.browser.test.tsx.Scope
Web-only bug fix (desktop wraps
apps/web; mobile uses a React Native modal); obvious bug, no issue filed.Verification
Setup: Linux 7.0.0-44-generic, Chromium & Firefox (
1280x800), dark theme, isolated server (Demo Project); keys via debugging port.Steps:
/settings/general→Ctrl+P→Escape→Escape.After two Escapes, Settings closed behind the open Command Palette
After two Escapes, Command Palette closed and Settings stayed open
On
16987d96cd,Ctrl+Shift+FandCtrl+K→"Go to file"/"Search project contents"(Chromium), andCtrl+K→Ctrl+P/Ctrl+Shift+F(Chromium & Firefox), focuscommand-dialog-popupand keep Settings open;Demo Project(Ctrl+P/Ctrl+Shift+F),Ctrl+K,Change theme, andAdd projectstill focusautocomplete-input.Links
Base
f0471c8639and head16987d96cdabove.Not shown
apps/web), mobile (noCommandDialogPopup), Safari/WebKit (not run).Ctrl+Shift+F, view swaps,Demo Project.Checks and test output
Generated with Gemini 4 Neon in T3 Code Nightly