Skip to content

fix(web): a second Escape in the theme CSS editor closes the theme editor - #41692

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-theme-css-editor-second-escape
Nov 23, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-theme-css-editor-second-escape

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

In the theme editor's Custom CSS box, Escape is meant to stop Tab from indenting so the next Tab leaves the box ("Press Escape, then Tab to leave."). But the box swallowed every Escape, not just that first one, so pressing Escape again never closed the theme editor the way it does from every other field.

Change

The CSS box now handles Escape only while Tab still indents, or when the key is held down and repeating. The first Escape still releases Tab and keeps the editor open, and holding it does not close the editor. A second press reaches the theme editor, which closes, and Settings stays open.

Scope

A one-line fix of an obvious bug in a component added in #35247, so it has no issue. Web and desktop only: mobile has no theme CSS editor.

Verification

A browser test focuses the Custom CSS box beside the Settings dialog, presses Escape, sends a held-key repeat, then presses Escape again. It fails on main, where the second press does nothing, and passes with the fix: the first press and the repeat keep the editor open, the second press closes it, and Settings stays open. An AI agent ran the test on both revisions, vp run check:changed and the captures below.

Setup: Linux, Chromium (T3 Browser panel), light theme, 1280×800, isolated dev state with no seeded data (vp run dev --no-seed) on each commit.
Steps: Settings → Appearance → Create theme → Custom CSS → type .sidebar { border-radius: 12px; } → Escape → Escape

Before (4ce9f8c1b87) After (d7774c45b14)
A second Escape in Custom CSS leaves the theme editor open A second Escape in Custom CSS closes the theme editor and Settings stays open
A second Escape in Custom CSS leaves the theme editor open A second Escape in Custom CSS closes the theme editor and Settings stays open

Links: #35247, #25130

Not shown: after the first Escape the head build looks the same as the Before image: the editor stays open with the hint "Tab moves to the next control." Focusing the box again still turns Tab indenting back on. Holding Escape is covered by the test, not the captures. Desktop runs the same web component.

Generated with Gemini 4 Neon 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 23, 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 d7774c4 and 318002a.

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 Custom CSS editor now disables Tab indentation on Escape only when indentation is active or the event is a repeat. A browser test covers successive Escape events and the resulting dialog state.

Changes: Theme editor Escape handling

Layer / File(s) Summary
Escape condition and dialog coverage
apps/web/src/components/settings/ThemeCssEditor.tsx, apps/web/src/components/settings/ThemeEditorPanel.browser.test.tsx
The Escape condition checks whether Tab indentation is active or the event is a repeat. The browser test verifies that the first two Escape events leave both dialogs open, and that the next closes the theme editor while Settings remains open.

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

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · previous review d7774

The first Escape in the Custom CSS box stops Tab from indenting, and a second Escape closes the theme editor while Settings stays open. No concrete merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the actual change: a second Escape in the theme CSS editor now closes the theme editor. It follows the conventional commit form and matches the raw summary (Escape handling in ThemeCss…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem and Change sections explain the bug and the fix. Scope explains why no issue is linked and g…
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 actual change: a second Escape in the theme CSS editor now closes the theme editor. It follows the conventional commit form and matches the raw summary (Escape handling in ThemeCssEditor.handleKeyDown) and the PR objectives.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem and Change sections explain the bug and the fix. Scope explains why no issue is linked and gives the web and desktop reach. Verification names a focused browser test, shows before and after captures, and states what was not shown. It also gives the model and harness, as the template asks. It does not add a Conventional Commit title beyond the PR title, and the template's comment asks for a conventional commit title, which the title satisfies.

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 2621031 and d7774c4.

Files selected for processing: 2

  • apps/web/src/components/settings/ThemeCssEditor.tsx
  • apps/web/src/components/settings/ThemeEditorPanel.browser.test.tsx

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 23, 2026
…tor-second-escape

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

Copy link
Copy Markdown
Member

Evidence

Real web app, Chromium, 1280×1000, light appearance, fresh synthetic state on each commit. Open Settings → Appearance → Create theme → Custom CSS; enter .sidebar { border-radius: 12px; }. First Escape releases Tab indentation; repeated keydowns while held keep both panels open. Release Escape and press it again: base keeps the theme editor open; head closes only the theme editor and leaves Appearance settings open.

Proven: scenarios:prove exited 0, failing on base and passing on head.

Step Before — 3f09ad9127 After — 318002a8d0
Before Escape Before: focused Custom CSS After: focused Custom CSS
First Escape releases Tab Before: Tab movement hint After: Tab movement hint
Held Escape keeps editor open Before: held Escape After: held Escape
Second distinct Escape Before: theme editor remains open After: theme editor closed, Appearance remains open
Recording Before recording After recording

Scenario source

Not shown:

  • Electron desktop was not run separately; this proof exercises the shared web component in Chromium.

@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 23, 2026
@juliusmarminge
juliusmarminge merged commit d49cf0b into pingdotgg:main Nov 23, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 23, 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