[GH-ISSUE #2953] [Issue]: Theme JSON import says 'No valid themes found' with no clue what was wrong #1529

Closed
opened 2026-10-21 05:38:01 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Jun 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2953

Originally assigned to: @SpicyMarinara on GitHub.

What's wrong

When you import a theme JSON file, entries that parse but have an empty/missing css field, or the wrong shape, are dropped silently — they aren't counted as skipped or failed. So if every entry is like that, you get the generic toast "No valid themes found in file." even though the JSON parsed fine, with no hint that the css was the problem. The extension importer, by contrast, reports per-entry reasons, so this is an inconsistency that leaves theme-import users guessing.

How to reproduce (try it yourself)

  1. Make theme.json = {"name":"X","css":""} (or {"foo":"bar"}).
  2. Settings → Theme Library → Import File, pick it.

You'll see: toast "No valid themes found in file." with no indication that the css was empty/missing or the shape was wrong.
Expected: a per-entry diagnostic like "1 theme skipped — empty/missing css", the way the extension importer reports skips.

Where it is

packages/client/src/components/panels/SettingsPanel.tsx — handleImportThemeFile, the JSON branch at lines 3417-3442. The bare continue at 3419 (non-object / wrong shape) and at 3424 (empty css) drop entries without incrementing skipped or failed, so imported / skipped / failed all stay 0 and collapse into the generic toast at line 3470. (Duplicates, at 3426, are counted — only the empty-css and wrong-shape cases are silent.) Contrast the extension importer (~3960-4011), which tracks skipped plus failureMessages.

What's happening

Those two continues drop entries without counting them, and there's no per-entry message channel like the extension importer has, so the summary can't say what went wrong.

Suggested fix

Count and surface skipped entries with reasons (empty css, wrong shape) in the summary toast, mirroring the extension importer's failureMessages handling.


AI-investigated against v2.0.6; cited lines read. Please confirm before fixing.

Originally created by @kolacheee on GitHub (Jun 28, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2953 Originally assigned to: @SpicyMarinara on GitHub. **What's wrong** When you import a theme JSON file, entries that parse but have an empty/missing `css` field, or the wrong shape, are dropped silently — they aren't counted as skipped or failed. So if every entry is like that, you get the generic toast "No valid themes found in file." even though the JSON parsed fine, with no hint that the `css` was the problem. The extension importer, by contrast, reports per-entry reasons, so this is an inconsistency that leaves theme-import users guessing. **How to reproduce (try it yourself)** 1. Make `theme.json` = `{"name":"X","css":""}` (or `{"foo":"bar"}`). 2. Settings → Theme Library → Import File, pick it. **You'll see:** toast "No valid themes found in file." with no indication that the `css` was empty/missing or the shape was wrong. **Expected:** a per-entry diagnostic like "1 theme skipped — empty/missing css", the way the extension importer reports skips. **Where it is** `packages/client/src/components/panels/SettingsPanel.tsx` — `handleImportThemeFile`, the JSON branch at lines 3417-3442. The bare `continue` at 3419 (non-object / wrong shape) and at 3424 (empty css) drop entries without incrementing `skipped` or `failed`, so `imported` / `skipped` / `failed` all stay 0 and collapse into the generic toast at line 3470. (Duplicates, at 3426, *are* counted — only the empty-css and wrong-shape cases are silent.) Contrast the extension importer (~3960-4011), which tracks `skipped` plus `failureMessages`. **What's happening** Those two `continue`s drop entries without counting them, and there's no per-entry message channel like the extension importer has, so the summary can't say what went wrong. **Suggested fix** Count and surface skipped entries with reasons (empty css, wrong shape) in the summary toast, mirroring the extension importer's `failureMessages` handling. --- *AI-investigated against v2.0.6; cited lines read. Please confirm before fixing.*
Author
Owner

@SpicyMarinara commented on GitHub (Jun 28, 2026):

Fixed on staging: theme JSON import now counts and reports wrong-shape entries, missing/empty CSS, duplicates, and per-entry failures instead of only showing the generic no-valid-themes toast.

<!-- gh-comment-id:4827784969 --> @SpicyMarinara commented on GitHub (Jun 28, 2026): Fixed on staging: theme JSON import now counts and reports wrong-shape entries, missing/empty CSS, duplicates, and per-entry failures instead of only showing the generic no-valid-themes toast.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1529
No description provided.