Skip to content

fix(web): a held Esc or a search of spaces no longer closes Settings - #42093

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-settings-search-escape-hold-spaces
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-settings-search-escape-hold-spaces

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

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)
47329274: one Esc on the spaces closed Settings. 086a3d8d: one Esc on the spaces cleared the search and Settings stayed open.
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:

086a3d8d: after Esc cleared "theme", a held Esc kept Settings open.

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.

Generated with Claude Opus 5.5 in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested labels: bugfix

Suggested reviewers: juliusmarminge, macroscopeapp

Merge Risk: Minimal · previous review 086a3

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f516cf9 and 086a3d8.

Files selected for processing: 2

  • apps/web/src/components/settings/SettingsSidebarNav.composition.browser.test.tsx
  • apps/web/src/components/settings/SettingsSidebarNav.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
…ch-escape-hold-spaces

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the fix/web-settings-search-escape-hold-spaces branch from 98d17f1 to 742076c Compare November 24, 2026 11:23
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

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.

Interaction Before — 59fe770e01 After — 742076cdff
Result Both defects reproduced Query clears, focus stays in search, held Escape keeps Settings open; fresh Escape closes it
Spaces before Escape Before: spaces entered After: spaces entered
Spaces after Escape Before: Settings closed After: search cleared and Settings open
Theme before held Escape Before: theme results After: theme results
While Escape held Before: Settings closed during hold After: Settings stays open during hold
After release Before: Settings remains closed After: Settings remains open
Fresh Escape Before: Settings already closed After: fresh Escape closes Settings
Recording Before recording After recording

Scenario driver. Scenario comparison exited 0: fails on base, passes on head.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 24, 2026
@juliusmarminge
juliusmarminge merged commit b51399f into pingdotgg:main Nov 24, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants