Skip to content

fix(web): Enter in the theme editor's Theme name field saves the theme - #46336

Open
tiliakoos wants to merge 2 commits into
pingdotgg:mainfrom
tiliakoos:fix/theme-name-enter-saves
Open

tiliakoos wants to merge 2 commits into
pingdotgg:mainfrom
tiliakoos:fix/theme-name-enter-saves

Conversation

@tiliakoos

Copy link
Copy Markdown
Contributor

Problem

In the theme editor (Create theme, Duplicate or Edit), pressing Enter in the auto-focused Theme name field does nothing, while the Save button is enabled. The Input in renderNameField has no Enter handler and no <form>, and the panel's own onKeyDown handles only Escape.

Change

Add an onKeyDown to the Theme name Input in apps/web/src/components/settings/ThemeEditorPanel.tsx. On a plain Enter, when the name is not blank, it calls event.preventDefault() and the existing handleSubmit, the same action as Save. Enter does nothing with a modifier key, on key repeat, or during IME composition (isComposing or keyCode 229), using the same checks as the file's other key handlers. It also does nothing when the name is blank, matching the disabled Save button. One regression test is added to ThemeEditorPanel.browser.test.tsx.

Scope

A small fix for an obvious bug, so no issue. It re-lands only21mil's #45488, which Macroscope approved and only21mil closed themselves about 50 minutes after opening it. They are credited as co-author. The same kind of fix merged for the custom model editor in #45539.

Verification

  • vp test run src/components/settings/ThemeEditorPanel.browser.test.tsx (Chromium): the new test fails on base 8c4008f17f (expected "vi.fn()" to be called 1 times, but got 0 times), and all 11 tests pass with the fix. The test also checks that Enter with a blank name, during IME composition, or with Shift does not save.
  • vp run check:changed upstream/main: format, lint, knip, typecheck (2 packages), tests and the React compiler check all pass.
  • vp run scenarios:prove with the scenario below, web target, on macOS (not Linux), exits 0. Steps: Settings → Appearance → Create theme, type Aurora in Theme name, press Enter.

Proven: the scenario fails on base 1a7fe44843 and passes on head 44add625cf.

Base 1a7fe44843 Head 44add625cf
Result Fails: expect.toBeHidden on the "Create theme" dialog saw it still visible Passes
Before Enter Base: Aurora typed in Theme name Head: Aurora typed in Theme name
After Enter (base: the capture at the failed assertion) Base: the editor stays open Head: the editor closes and Aurora is the active theme

Not checked: Duplicate and Edit separately (they render the same name field), real IME input (only simulated events in the test), and the desktop app (it uses the same web component). The mobile app has no theme editor.

Scenario source (not committed)
import { expect } from "e2e";

import { test, WEB } from "./t3.ts";

test(
  "Enter in the theme editor's Theme name field saves the theme",
  WEB,
  async ({ t3, app, screen, browser }) => {
    await t3.project("demo");
    await t3.open("/settings/appearance");

    await screen.getByRole("button", "Create theme", { exact: true }).tap();
    const editor = screen.getByRole("dialog", "Create theme", { exact: true });
    await editor.getByRole("textbox", "Theme name").fill("Aurora");
    await app.screenshot("before-enter");

    await browser.keyboard.press("Enter");
    await expect(editor).toBeHidden();
    const savedTheme = screen.getByRole("button", "Use Aurora theme");
    await savedTheme.scrollIntoView();
    await app.screenshot("after-enter");
    await expect(savedTheme).toBeVisible();
  },
);

Claude Opus 5.5 via T3 Code

The auto-focused Theme name input had no Enter handler and no form, so Enter did nothing while Save was enabled.

Co-authored-by: only21mil <[email protected]>
@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 30, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 44add62

Macroscope's review found this PR approvable — Pressing Enter in the theme-name field now invokes the existing save action, with guards for composition, modifiers, repeated keys, and empty names. The change preserves existing save validation and does not alter product defaults.

Notes:

  • All code in this push has already been reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The theme editor submits a nonblank theme name when the user presses an eligible Enter key. Browser tests cover ignored Enter events, successful submission, panel closure, and cleanup of saved themes.

Changes: Theme name Enter submission

Layer / File(s) Summary
Enter handling and browser coverage
apps/web/src/components/settings/ThemeEditorPanel.tsx, apps/web/src/components/settings/ThemeEditorPanel.browser.test.tsx
The name input submits when Enter is unmodified, non-repeating, not prevented, not part of IME composition, and the trimmed name is nonempty. Browser tests cover ignored events, successful submission, panel closure, and cleanup.

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

Change: Bug fix

Suggested reviewers: juliusmarminge, omaribrahim6

Merge Risk: Minimal · up to 22088

Pressing Enter in the Theme name field now saves a nonblank theme through the same path as the Save button. Modified, repeated, IME-composing, and blank-name Enter presses are ignored. The change is small, covered by a browser test, and shows no concrete merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: plain Enter in the theme editor's Theme name field saves the theme. It matches the fix in ThemeEditorPanel.tsx and the regression test. The title uses the conventio…
Description check Passed The description follows the template sections: Problem, Change, Scope, and Verification. Problem gives the expected behavior and reproduction steps. Change explains the onKeyDown fix and its guards. S…
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 primary change: plain Enter in the theme editor's Theme name field saves the theme. It matches the fix in ThemeEditorPanel.tsx and the regression test. The title uses the conventional commit form the template requests.

Full details: Description check

Explanation

The description follows the template sections: Problem, Change, Scope, and Verification. Problem gives the expected behavior and reproduction steps. Change explains the onKeyDown fix and its guards. Scope gives a reason for no linked issue and notes the re-landed PR. Verification lists the focused browser test, the check run, and a macOS scenario with before/after screenshots. Minor gaps: the Scope section cites PR and commit references rather than a linked issue, and the template's Scope rule asks for a linked issue or a reason for none. The author gave a reason. The description also notes that Duplicate, Edit, real IME input, and the desktop app were not checked.

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 44add62 and 2208804.

Files selected for processing: 2

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

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

imetn added a commit to imetn/t4code that referenced this pull request Dec 1, 2026
…..772e3d4)

Ported 26 direct Bucket A upstream fixes from pingdotgg/t3code (39f75bc..772e3d4) plus independent Astra pre-merge blind-review fixes:
- Workflow runtime & editor reliability (pingdotgg#46216, pingdotgg#46378, pingdotgg#46394, pingdotgg#46431, pingdotgg#46436)
- Composer fences, markdown clipboard, file picker & preview UX (pingdotgg#46212, pingdotgg#46237, pingdotgg#46260, pingdotgg#46268, pingdotgg#46273, pingdotgg#46326, pingdotgg#46335, pingdotgg#46350, pingdotgg#46368, pingdotgg#46388, pingdotgg#46404)
- PR watch, Codex adapter, Cursor skills & link routing (pingdotgg#46234, pingdotgg#46287, pingdotgg#46311, pingdotgg#46321, pingdotgg#46336, pingdotgg#46338, pingdotgg#46374, pingdotgg#46380, pingdotgg#46416, pingdotgg#46417)
- Blind-review fixes: unregister workflows on folder move/delete, preserve indented tilde closing fences, tighten non-git PR link fallback, clear stale workflow overwrite warning on undo, clean pre-existing T3 Code copy.
…r-saves

# Conflicts:
#	apps/web/src/components/settings/ThemeEditorPanel.browser.test.tsx

This branch has not been deployed

No deployments
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.

1 participant