Skip to content

fix: improve theme profile import validation error message#309

Open
Kirtan-pc wants to merge 1 commit into
SamXop123:mainfrom
Kirtan-pc:fix/improve-theme-import-error-message
Open

fix: improve theme profile import validation error message#309
Kirtan-pc wants to merge 1 commit into
SamXop123:mainfrom
Kirtan-pc:fix/improve-theme-import-error-message

Conversation

@Kirtan-pc

Copy link
Copy Markdown
Contributor

Description

This PR improves the error message shown to the user when importing a theme profile whose filename contains reserved or disallowed characters.

Previously, if a user imported a theme profile with an invalid filename (e.g. my[profile].json), it would fail silently or surface a generic and unhelpful error message: Failed to import theme: Invalid profile name: the filename contains reserved or disallowed characters..

Fixes Issue #281

Changes

  • Improved Error Message: Updated the validation error in main.js to explicitly state:
    Invalid profile name: The filename contains unsupported characters. Please rename the file using only letters, numbers, spaces, hyphens, underscores, and parentheses (maximum 64 characters).
  • This provides the user with clear instructions and actionable guidance on how to fix the filename and import it successfully.

Testing

  1. Export any existing theme profile.
  2. Rename the exported .json file to include brackets (e.g., my[test].json).
  3. Click the Import button in Settings → Theme Profiles and select my[test].json.
  4. Verification: The error toast correctly shows:
    Failed to import theme: Invalid profile name: The filename contains unsupported characters. Please rename the file using only letters, numbers, spaces, hyphens, underscores, and parentheses (maximum 64 characters).

When importing a theme profile, if the filename fails validation (e.g.
it contains disallowed characters like brackets or unsupported Unicode),
the returned error is now descriptive and actionable.

Instead of a generic:
'Invalid profile name: the filename contains reserved or disallowed characters.'

It now returns:
'Invalid profile name: The filename contains unsupported characters. Please rename the file using only letters, numbers, spaces, hyphens, underscores, and parentheses (maximum 64 characters).'
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

@Kirtan-pc is attempting to deploy a commit to the Dot_NotSam's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3971bde1-9808-4e85-953d-9b23601f31c8

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant