[GH-ISSUE #2948] [Issue]: Deleting a theme or extension happens instantly with no confirmation #1524

Closed
opened 2026-10-21 05:37:56 +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/2948

Originally assigned to: @SpicyMarinara on GitHub.

What's wrong

The trash buttons for themes and extensions delete immediately on a single click — no confirmation, no undo. Everywhere else in the app, deleting something destructive (a character, a preset, a regex script, a function) pops a confirmation dialog first. Themes and extensions are the only two that skip it, so one stray click permanently destroys a hand-written theme or extension (including all its CSS/JS source) with nothing but a success toast.

How to reproduce (try it yourself)

  1. Settings → Theme Library, hover a theme, click the trash icon. (Or Settings → Extensions, click an extension's trash icon.)

You'll see: the item is deleted instantly, with only a "removed" toast — no "Delete this?" dialog.
Expected: a confirmation dialog, the same as deleting a character or preset.

Where it is

  • packages/client/src/components/panels/SettingsPanel.tsx:3697-3713 — theme delete button calls deleteTheme.mutateAsync(t.id) directly on click.
  • SettingsPanel.tsx:4185 — extension delete button calls deleteExtension.mutate(ext.id) directly on click.

For contrast, these all confirm first via showConfirmDialog (already imported in SettingsPanel.tsx:123): PresetsPanel.tsx:515 (presets), :762 (single preset), :1351 (regex script), :1514 (function); CharactersPanel.tsx:641 / :1363 (characters).

What's happening

These two delete handlers were just never wired to showConfirmDialog.

Suggested fix

Wrap both handlers in an unconditional confirm before mutating, matching the rest of the app:

if (!(await showConfirmDialog({ title: "Delete Theme", message: `Delete "${t.name}"?`, confirmLabel: "Delete", tone: "destructive" }))) return;

(and the equivalent for extensions). Note: there's a "Confirm before delete" setting floating around, but no delete handler in the app actually reads it — the other deletes confirm unconditionally — so don't gate on it here; just confirm unconditionally like everything else.


AI-investigated against v2.0.6; cited lines were read and the repro verified. Please confirm before fixing.

Originally created by @kolacheee on GitHub (Jun 28, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2948 Originally assigned to: @SpicyMarinara on GitHub. **What's wrong** The trash buttons for themes and extensions delete immediately on a single click — no confirmation, no undo. Everywhere else in the app, deleting something destructive (a character, a preset, a regex script, a function) pops a confirmation dialog first. Themes and extensions are the only two that skip it, so one stray click permanently destroys a hand-written theme or extension (including all its CSS/JS source) with nothing but a success toast. **How to reproduce (try it yourself)** 1. Settings → Theme Library, hover a theme, click the trash icon. (Or Settings → Extensions, click an extension's trash icon.) **You'll see:** the item is deleted instantly, with only a "removed" toast — no "Delete this?" dialog. **Expected:** a confirmation dialog, the same as deleting a character or preset. **Where it is** - `packages/client/src/components/panels/SettingsPanel.tsx:3697-3713` — theme delete button calls `deleteTheme.mutateAsync(t.id)` directly on click. - `SettingsPanel.tsx:4185` — extension delete button calls `deleteExtension.mutate(ext.id)` directly on click. For contrast, these all confirm first via `showConfirmDialog` (already imported in `SettingsPanel.tsx:123`): `PresetsPanel.tsx:515` (presets), `:762` (single preset), `:1351` (regex script), `:1514` (function); `CharactersPanel.tsx:641` / `:1363` (characters). **What's happening** These two delete handlers were just never wired to `showConfirmDialog`. **Suggested fix** Wrap both handlers in an unconditional confirm before mutating, matching the rest of the app: ``` if (!(await showConfirmDialog({ title: "Delete Theme", message: `Delete "${t.name}"?`, confirmLabel: "Delete", tone: "destructive" }))) return; ``` (and the equivalent for extensions). Note: there's a "Confirm before delete" setting floating around, but no delete handler in the app actually reads it — the other deletes confirm unconditionally — so don't gate on it here; just confirm unconditionally like everything else. --- *AI-investigated against v2.0.6; cited lines were read and the repro verified. Please confirm before fixing.*
Author
Owner

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

Fixed on staging: deleting themes and extensions now asks for confirmation before permanently removing saved CSS/JS.

<!-- gh-comment-id:4827784685 --> @SpicyMarinara commented on GitHub (Jun 28, 2026): Fixed on staging: deleting themes and extensions now asks for confirmation before permanently removing saved CSS/JS.
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#1524
No description provided.