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): a held Esc or a search of spaces no longer closes Settings - #42093
In Settings, Escape in "Search settings" only stays inside Settings when the query has non-space text (query.trim()). Two cases fall through to the Settings modal and close it:
Holding Escape: the first keydown clears the query, then the OS auto-repeat keydown sees an empty query and closes Settings.
A query of only spaces: Escape neither clears it nor stays put, so one press closes Settings with the spaces still in the field.
Fix
The same held-key handling as #41815 and #41764. Escape in the settings search now stays in Settings when the field has any text, spaces included, or when the keydown is an auto-repeat. It clears the field in both cases. A fresh Escape on an empty field still closes Settings, and Escape during IME composition still does nothing.
Repro
Setup: Linux, Chromium (T3 Browser panel), light theme, 1280×800 viewport, one isolated vp run dev --no-seed server on this branch. For the main column, SettingsSidebarNav.tsx was swapped for its 47329274 copy before the page loaded. For this PR's column, the file was restored and the page reloaded.
Steps: open Settings → type three spaces into Search settings → press Escape. Then reopen Settings if it closed → type theme into Search settings → press Escape → auto-repeat Escape (Browser panel: one real Escape press, then a repeat: true Escape keydown dispatched on the focused search, as the OS sends while the key is held).
47329274 (main)
086a3d8d (this PR)
One Esc on the spaces closed Settings.
One Esc on the spaces cleared the search and Settings stayed open.
On main, the held Esc after clearing theme closes Settings too, leaving the same view as the left image. On this PR it stays:
After the fix, a fresh Escape on the empty search closes Settings. The narrow (390 px) compact search behaves the same.
Scope
One handler condition in SettingsSidebarNav.tsx, plus its test. No issue: this is a small bug with an exact repro, fixed the same way as #41815.
Verification
An AI agent ran each check below.
A new case in SettingsSidebarNav.composition.browser.test.tsx renders the settings nav inside the real AppRouteModal. It checks that Escape on theme and on spaces clears the search and keeps focus in it, that a repeat: true Escape then keeps Settings open, and that a fresh Escape closes it. It fails on main, fails with either half of the fix reverted, and passes here (3/3, vp test run ... --maxWorkers=1). The existing IME-Escape case still passes.
vp run check:changed passes.
Not shown
A physical held key: the Browser panel sends one real Escape press, then a dispatched repeat: true keydown.
Desktop: it renders this same web settings nav.
Mobile: its settings search is a separate native component that this change does not touch.
Reviewing files that changed from the base of the PR and between 086a3d8 and 742076c.
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
Escape now clears the settings search when it contains text or when the key event repeats. A browser test checks search clearing and modal behavior.
Changes: Settings Search Escape Handling
Layer / File(s)
Summary
Escape handling and modal test apps/web/src/components/settings/SettingsSidebarNav.tsx, apps/web/src/components/settings/SettingsSidebarNav.composition.browser.test.tsx
The Escape handler clears the search when the query is nonempty or the event repeats. The browser test checks that Escape clears text and space-only searches, retains focus, and leaves the modal open on a repeated Escape before a later Escape closes it.
Escape in the Settings search now clears any non-empty query, including whitespace-only queries, and an auto-repeat Escape no longer closes Settings. A fresh Escape on an empty search still closes it. The change is small and localized, and no merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the fix and the affected area: a held Escape or a search containing only spaces no longer closes Settings. This matches the main change, which alters the Escape handler in SettingsSide…
Description check
The description follows the template closely. It gives the problem (held Escape and space-only queries closing Settings), the change (one handler condition plus the auto-repeat case), scope (one file …
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 fix and the affected area: a held Escape or a search containing only spaces no longer closes Settings. This matches the main change, which alters the Escape handler in SettingsSidebarNav.tsx. It uses the conventional commit form and plain language, and it stays specific.
Full details: Description check
Explanation
The description follows the template closely. It gives the problem (held Escape and space-only queries closing Settings), the change (one handler condition plus the auto-repeat case), scope (one file and its test, with a no-issue justification), and verification (a new browser test with run results, check:changed, and before/after screenshots). It also lists what was not checked, as the template asks. The Problem section has no explicit label, and the template's optional sections are present in substance. The Verification section names an AI agent and model, which the template requests.
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; 6 remain after this review.
Evidence: real web app, Chromium 1280×800, light theme, fresh synthetic state on both commits.
Steps: search for three spaces and press Escape; reopen Settings, search for theme, hold Escape through five repeat keydowns after a 500 ms delay, release it, then press Escape freshly.
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.
In Settings, Escape in "Search settings" only stays inside Settings when the query has non-space text (
query.trim()). Two cases fall through to the Settings modal and close it:Fix
The same held-key handling as #41815 and #41764. Escape in the settings search now stays in Settings when the field has any text, spaces included, or when the keydown is an auto-repeat. It clears the field in both cases. A fresh Escape on an empty field still closes Settings, and Escape during IME composition still does nothing.
Repro
Setup: Linux, Chromium (T3 Browser panel), light theme, 1280×800 viewport, one isolated
vp run dev --no-seedserver on this branch. For the main column,SettingsSidebarNav.tsxwas swapped for its47329274copy before the page loaded. For this PR's column, the file was restored and the page reloaded.Steps: open Settings → type three spaces into Search settings → press Escape. Then reopen Settings if it closed → type
themeinto Search settings → press Escape → auto-repeat Escape (Browser panel: one real Escape press, then arepeat: trueEscape keydown dispatched on the focused search, as the OS sends while the key is held).47329274(main)086a3d8d(this PR)On main, the held Esc after clearing
themecloses Settings too, leaving the same view as the left image. On this PR it stays:After the fix, a fresh Escape on the empty search closes Settings. The narrow (390 px) compact search behaves the same.
Scope
One handler condition in
SettingsSidebarNav.tsx, plus its test. No issue: this is a small bug with an exact repro, fixed the same way as #41815.Verification
An AI agent ran each check below.
SettingsSidebarNav.composition.browser.test.tsxrenders the settings nav inside the realAppRouteModal. It checks that Escape onthemeand on spaces clears the search and keeps focus in it, that arepeat: trueEscape then keeps Settings open, and that a fresh Escape closes it. It fails on main, fails with either half of the fix reverted, and passes here (3/3,vp test run ... --maxWorkers=1). The existing IME-Escape case still passes.vp run check:changedpasses.Not shown
repeat: truekeydown.Generated with Claude Opus 5.5 in T3 Code Nightly