Skip to content

fix(web): Esc in the text generator model search clears it without closing the dialog - #42130

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

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
only21mil:fix/web-text-generators-model-search-escape

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Pressing Esc in the Search models box of a text generator's models dialog closed the whole dialog, so you lost your place instead of clearing what you typed. Holding Esc, or pressing it while an IME was composing, did the same.

The search box now works like the other Settings searches (#41856, #41764, #42076): the first Esc clears a non-empty search and keeps focus there, a second Esc on the empty box closes the dialog, held-Esc repeats can't close it, and Esc during IME composition is left to the IME. The input is type="text" with role="searchbox" and enterKeyHint="search", because a native search input clears itself on Escape even during composition.

Setup

Web on Linux (Chrome), dev build with no seeded data. A custom OpenAI-compatible text generator pointed at a local stub that lists 12 models, so the dialog shows its search box. Settings → Providers → Text generators → ⋮ → Show models.

Steps

  1. Type mini in Search models.
  2. Press Esc.
Before After
Typed mini Before: mini typed in the search After: mini typed in the search
After one Esc Before: the models dialog closed After: the search cleared and the dialog stayed open

Pressing Esc again with the search empty closes the models dialog and leaves Settings open.

Tests

  • New TextGeneratorsSettings.browser.test.tsx covers IME Esc, the first Esc clearing, a held-Esc repeat, and the second Esc closing. It fails on main (the dialog closes on the first Esc) and passes here.
  • vp run check:changed passes.

An AI agent ran each of these checks. Mobile is not affected: it has no text generator models dialog. Desktop renders this same web component.

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:S 10-29 changed lines (additions + deletions). labels Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR changes the test suite by +1 test cases (browser +1, unit 0, server 0).

New browser test files: apps/web/src/components/settings/TextGeneratorsSettings.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

@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 model search field now uses searchbox semantics and handles Escape based on IME composition, query content, and key repeat. A browser test checks search clearing, focus retention, and dialog closure.

Changes: Model Search Escape Handling

Layer / File(s) Summary
Handle Escape in model search
apps/web/src/components/settings/TextGeneratorsSettings.tsx, apps/web/src/components/settings/TextGeneratorsSettings.browser.test.tsx
The search field uses a text input with searchbox semantics. Escape during IME composition leaves the query unchanged. Escape clears a non-empty query and stops propagation. Browser tests check focus and dialog behavior, including repeated Escape.

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

Change: Bug fix

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: maria-rcks, macroscopeapp

Merge Risk: Minimal · up to 0590d

This change makes Escape in the model search field clear the query first and close the dialog on a second press. It is localized to one settings dialog, and no merge-blocking risk was identified.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description follows the template. Problem: Esc closed the models dialog while the search box held text, and it also closed during held-Esc and IME composition. Change: the input is now type text w… Link the issue that shows this bug, or explain why a small fix of this obvious bug needs no issue. If a maintainer asked for this PR, link that request. Otherwise the remaining sections are complete.
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the main change: Escape in the text generator model search now clears the query without closing the dialog. It uses a conventional commit prefix and plain language, and it matches the …
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 main change: Escape in the text generator model search now clears the query without closing the dialog. It uses a conventional commit prefix and plain language, and it matches the raw summary and objectives.

Full details: Description check

Explanation

The description follows the template. Problem: Esc closed the models dialog while the search box held text, and it also closed during held-Esc and IME composition. Change: the input is now type text with role searchbox and enterKeyHint search, and Esc handling is adjusted. Scope: it cites related Settings searches (#41856, #41764, #42076) but does not link an issue showing the bug, and it does not say why no issue is needed. Verification: it lists a new browser test with results, a passing check:changed run, and before/after screenshots. The Scope section is the main gap.

Resolution

Link the issue that shows this bug, or explain why a small fix of this obvious bug needs no issue. If a maintainer asked for this PR, link that request. Otherwise the remaining sections are complete.

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 b5f704d and 0590d35.

Files selected for processing: 1

  • apps/web/src/components/settings/TextGeneratorsSettings.tsx

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
juliusmarminge and others added 2 commits November 24, 2026 12:49
…tings searches

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Real web app, light theme, 1280×800, fresh isolated state on both commits. Add a Custom text generator backed by a local 12-model listing; open Show models, search mini, then press Escape.

Before After
f692811b95 0590d35b33
Before: Escape closes the models dialog After: Escape clears the focused search and keeps the models dialog open
Before recording After recording

On head, a subsequent Escape on the empty search closes the dialog. The scenario runner failed on base and passed on head.

Scenario and stand-in server

Not shown:

  • Held-Escape repeats were not exercised; the scenario sends discrete Escape presses.
  • IME composition Escape was not exercised; no composing input-method session was configured.

@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 3b829b6 into pingdotgg:main Nov 24, 2026
55 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:S 10-29 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