Skip to content

fix(web): Esc in theme search clears it without closing the dialog - #41764

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
only21mil:fix/web-theme-search-escape-clear
Nov 24, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
only21mil:fix/web-theme-search-escape-clear

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

In Settings → Appearance → Add theme, the "Search themes..." field had no Escape handling. With a query typed, Escape closed the whole "Add a theme" dialog instead of clearing the search. The field also used type="search", which Chromium clears natively on Escape even while an IME is composing, despite the existing composition guard.

Fix

The same pattern as #41616 and #41647, plus the held-key handling from #41692:

  • type="text" with role="searchbox", so the browser no longer clears the field on its own.
  • Escape with a query clears it and stays in the dialog. Escape on an empty field closes the dialog as before.
  • Auto-repeat keydowns from a held Escape are swallowed, so holding Escape clears the query without also closing the dialog.
  • Escape during IME composition still does nothing, behind the existing guard.

Repro (Linux, Chromium, vp run dev --no-seed)

  1. Open Settings → Appearance → Add theme.
  2. Type nord into the search field.
  3. Press Escape.
Before (main) After (this PR)
Before: nord typed into the theme search After: nord typed into the theme search
Before: one Escape closed the Add a theme dialog After: one Escape cleared the search and kept the dialog open

After the fix, a second Escape closes "Add a theme" and leaves Settings open.

Verification

An AI agent ran each check below.

  • ThemeImportDialog.browser.test.tsx gains one case: the field is type="text", an IME Escape (both the isComposing and the Safari keyCode 229 shape) keeps nord, a real Escape clears it without closing, a held auto-repeat Escape does not close, and a second Escape closes. It fails on main and passes here (11/11, vp test run ... --maxWorkers=1).
  • vp run check:changed passes.

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 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The theme search input now uses text input semantics and handles Escape to clear a nonempty query. A later Escape can close the dialog. The browser test checks the input type, query clearing, repeated Escape handling, and dialog closure.

Changes: Theme search Escape handling

Layer / File(s) Summary
Escape handling and validation
apps/web/src/components/settings/ThemeSearchSection.tsx, apps/web/src/components/settings/ThemeImportDialog.browser.test.tsx
The input uses type="text" and role="searchbox". Escape clears a nonempty query or handles a repeated press. The IME guard and Enter-to-search behavior remain. The browser test checks query clearing and dialog closure.

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

Change: Bug fix

Suggested reviewers: maria-rcks, stienswout, macroscopeapp

Merge Risk: Minimal · up to a3b4f

Pressing Escape in the theme search now clears the query without closing the dialog, and a second Escape closes it. The change is narrowly scoped to one input and has a covering browser test, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(web): Esc in theme search clears it without closing the dialog" matches the main change. The diff makes Escape clear a nonempty theme search without closing the Add theme dialog, and sw…
Description check Passed The description follows the template. It has a Problem section that explains the Escape behavior and the native type="search" clearing. It has a Change section that lists the type, Escape, auto-repeat…
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 "fix(web): Esc in theme search clears it without closing the dialog" matches the main change. The diff makes Escape clear a nonempty theme search without closing the Add theme dialog, and switches the input to type="text" with role="searchbox". It follows the conventional commit format and is specific enough for a teammate to understand the primary change.

Full details: Description check

Explanation

The description follows the template. It has a Problem section that explains the Escape behavior and the native type="search" clearing. It has a Change section that lists the type, Escape, auto-repeat, and IME handling. It has a Scope reference to related PRs #41616, #41647, and #41692, but it does not link a bug issue or explain why no issue is needed, which the template asks for. Its Verification section lists the focused browser test, the 11/11 result, the check:changed run, and before/after screenshots. It also notes that an AI agent ran the checks and names the model. The main gap is the Scope section, which does not link an issue or state why none is needed.

Resolution

Optional: link the issue that shows the bug, or state why a small fix needs no issue. The template also asks for a maintainer link if a maintainer requested the PR.

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 1c7b39e and a3b4f56.

Files selected for processing: 1

  • apps/web/src/components/settings/ThemeImportDialog.browser.test.tsx

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

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

Copy link
Copy Markdown
Member

Evidence

Proven in the real web app using scenarios:prove (exit 0). Chromium, 1280×800, light appearance, fresh synthetic project on each commit.

Steps: Settings → Appearance → Add theme; type nord; wait for six results; press Escape. On head, send two held-key repeats, release Escape, then press it again.

Before After
Commit 78cffe29ec a3b4f56f32
Nord results Before: six nord results After: six nord results
First Escape Before: Add a theme incorrectly closes After: query clears and Add a theme stays open
Held repeats Cannot continue: dialog already closed After: held Escape repeats keep dialog open
Second distinct Escape — After: second distinct Escape closes dialog
Recording Before recording After recording

Scenario source

Base failed because the search field disappeared after Escape; head passed all Escape assertions. Real IME composition was not exercised.

Not shown:

  • Escape during real IME composition, including Chromium's reported native query clearing: no real IME session was available in the scenario browser. Synthetic composition events would not establish native IME behavior.

@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 fdcb71a 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