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): holding Esc in the Files search clears it without closing the sheet - #41815
When the Files panel opens as a sheet (narrow windows), holding Escape in "Search files" closed the whole sheet. Since #41616 the first Escape clears the search and stays in the sheet, but it also blurred the input. The OS auto-repeat Escape then went to the page and reached the sheet's dismiss handler, so holding the key a moment too long closed Files.
Escape with a query clears it, keeps focus in the field and stays in the sheet.
Auto-repeat keydowns from a held Escape are swallowed, so holding Escape never closes the sheet.
A fresh Escape on an empty field closes the sheet (or leaves the field in the inline panel), as before.
Escape during IME composition still does nothing.
Repro
Setup: Linux, Chromium (T3 Browser panel), light theme, 900×760 viewport, vp run dev --no-seed with one synthetic project on each commit.
Steps: open Files (shown as a sheet) → type readme into Search files → press Escape → auto-repeat Escape (Browser panel: one real Escape press, then repeat: true Escape keydowns dispatched on the focused element, as the OS sends while the key is held).
cd128e77 (main)
6e331748 (this PR)
Esc clears the search and drops focus, and the repeated Esc closes the whole Files sheet.
Esc clears the search, focus stays in it, and repeated Esc keeps the Files sheet open.
After the fix, a fresh Escape on the empty search closes the sheet.
Verification
An AI agent ran each check below.
The existing FileBrowserPanel.browser.test.tsx case now asserts that focus stays in the search after the clearing Escape, that a repeat: true Escape does not close the sheet, and that a fresh Escape closes it without refocusing by hand. It fails on main and passes here (10/10, vp test run ... --maxWorkers=1).
Reviewing files that changed from the base of the PR and between 6e33174 and 9aa537d.
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 Files search field now handles Escape key events based on the query and whether the event is repeated. The browser test checks that clearing the query retains focus and that a repeated Escape does not close the sheet.
Changes: Files search Escape handling
Layer / File(s)
Summary
Escape handling and test coverage apps/web/src/components/files/FileBrowserPanel.tsx, apps/web/src/components/files/FileBrowserPanel.browser.test.tsx
The search field prevents default behavior and stops propagation for repeated Escape events. The test verifies that clearing the query retains focus and a repeated Escape leaves the sheet open.
This fixes a held Escape key closing the Files sheet while clearing the search. The change is small and has test coverage, so merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the actual change: holding Esc in the Files search clears the query without closing the sheet. The summary describes Escape handling in FileSearchField that keeps focus after clearing …
Description check
The description covers the problem, the fix, reproduction steps with before and after screenshots, and verification. It uses the template's section intent, although the template's headings (Problem, C…
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 actual change: holding Esc in the Files search clears the query without closing the sheet. The summary describes Escape handling in FileSearchField that keeps focus after clearing and swallows auto-repeat keydowns, so the title matches the main change. It follows the conventional commit style, and it is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description covers the problem, the fix, reproduction steps with before and after screenshots, and verification. It uses the template's section intent, although the template's headings (Problem, Change, Scope, Verification) are not all present as named headings. The Scope section is missing: it does not link an issue or explain why an issue is unnecessary, and it does not say whether a maintainer requested the PR. It references #41616 and #41764 but not as a Scope link for the bug. The verification is specific and states the test result and the commands run. The remaining sections are mostly complete, so the check passes.
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.
Real web app, Chromium, 900×760, light theme, fresh synthetic project and Replay thread on each commit. Open Files, search readme, hold Escape (initial keydown plus 15 repeats), then release. On head, press Escape separately once more.
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.
When the Files panel opens as a sheet (narrow windows), holding Escape in "Search files" closed the whole sheet. Since #41616 the first Escape clears the search and stays in the sheet, but it also blurred the input. The OS auto-repeat Escape then went to the page and reached the sheet's dismiss handler, so holding the key a moment too long closed Files.
Fix
The same held-key handling as #41764:
Repro
Setup: Linux, Chromium (T3 Browser panel), light theme, 900×760 viewport,
vp run dev --no-seedwith one synthetic project on each commit.Steps: open Files (shown as a sheet) → type
readmeinto Search files → press Escape → auto-repeat Escape (Browser panel: one real Escape press, thenrepeat: trueEscape keydowns dispatched on the focused element, as the OS sends while the key is held).cd128e77(main)6e331748(this PR)After the fix, a fresh Escape on the empty search closes the sheet.
Verification
An AI agent ran each check below.
FileBrowserPanel.browser.test.tsxcase now asserts that focus stays in the search after the clearing Escape, that arepeat: trueEscape does not close the sheet, and that a fresh Escape closes it without refocusing by hand. It fails on main and passes here (10/10,vp test run ... --maxWorkers=1).vp run check:changedpasses.Generated with Claude Opus 5.5 in T3 Code Nightly