Skip to content

fix: allow renaming custom theme without updating colors (@fehmer) - #8530

Merged
Miodec merged 3 commits into
masterfrom
feature/fix-theme-rename
Oct 27, 2026
Merged

Miodec merged 3 commits into
masterfrom
feature/fix-theme-rename

Conversation

@fehmer

@fehmer fehmer commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

  updateColors: {
    type: "checkbox",
+   initVal: false,
    label: "Update custom theme to current colors",
  },

A checkbox with no initVal is seeded undefined by SimpleModal. The required z.boolean() schema rejects undefined on submit, so renaming a custom theme without ticking the color-update checkbox was blocked ("Please fill in all fields"). Seed false (same convention as the DevOptions generate-data modal) so the field is a real boolean from birth.

Evidence

  • Before (browser, dev server): rename a custom theme, checkbox left untouched → update blocked: "Please fill in all fields", modal stays open, name unchanged
    After (browser, dev server): same action → modal closes, "Updated" notification, name persisted; checked-box path also verified. No new console errors
  • z.boolean().safeParse(undefined) → success: false vs safeParse(false) → success: true (the value the untouched field now holds)
  • oxlint --format agent on Theme.tsx — clean
  • oxlint --type-aware --type-check — one pre-existing finding in vitest.config.ts, untouched here
  • oxfmt --check — clean

Merge Danger

Door: two-way

One-line form seed, no schema change, no persisted data. Revert restores the old block.

Blast Radius: minimal

Only the "Update custom theme" modal. The checkbox renders unchecked exactly as before; checked/unchecked values are unchanged.

Closes #8527

The update modal's checkbox had no initVal, so SimpleModal seeded the field with undefined. The required z.boolean() schema rejected undefined on submit, so renaming a custom theme without ticking the color-update checkbox died with 'Please fill in all fields'. Seed false (same convention as the DevOptions generate-data modal) so the field is a real boolean from birth.
@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Oct 26, 2026
@fehmer
fehmer marked this pull request as draft October 26, 2026 22:52
@fehmer

fehmer commented Oct 26, 2026 •

Copy link
Copy Markdown
Member Author

Browser check on the dev server (account: quick-login user_131):

Before (parent commit, no initVal): update modal with the checkbox left untouched — the update is blocked and the theme is never renamed.

After (this PR): the same rename lands — modal closes, "Updated" notification, name persists; checked-box path verified too. Restored the theme to its original name afterwards.

@fehmer
fehmer marked this pull request as ready for review October 26, 2026 23:16
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label Oct 26, 2026
@github-actions github-actions Bot removed the waiting for review Pull requests that require a review before continuing label Oct 27, 2026
@Miodec
Miodec merged commit 983561a into master Oct 27, 2026
14 checks passed
@Miodec
Miodec deleted the feature/fix-theme-rename branch October 27, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rename theme modal not working unless checkbox is clicked

3 participants