Repository navigation
fix(theme): ask before deleting a custom theme in the app's own dialog - #32502
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the fix reuses the existing app-wide [DESIGN-REVIEWED] ba39a3e Description read[DESCRIPTION-READ] be4e06f21f4e36b49981156c1b0b833c099a7b36eb0046aa5039c3eedb061d2b That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader read the dialog, its message and the "Delete theme" confirm button correctly, and would dare use each one. All three are in the screenshots. Notes
[UX-REVIEWED] ba39a3e Description read[DESCRIPTION-READ] 35048ad29e9caa4f545bdd54b315ce6270fcf072657aa0238ac74bf17421cf4c That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The native Notes
What this change shipsInventory (7 items) — 6 justifiedIntent: when someone deletes a custom theme, they get the app's own confirmation dialog, and it says which theme will be deleted. FIX.
[FIRST-PRINCIPLES-REVIEWED] ba39a3e Description read[DESCRIPTION-READ] 8ded2955f07cc408f5e79d605d73df44c094531009f5a5f6926e60325fef8587 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (17 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: replaces the browser confirm() for deleting a custom theme with the in-app dialog that names the theme, with locale strings and tests.
Problem / Motivation
Goal: Deleting a custom theme asks in the app's own dialog, and the question names the theme.
Settings › Display › Theme: pressing Delete on a custom theme (in the theme list, or in the editor) raised the browser's native
confirm("Delete this custom theme?"). It does not say which theme, and it looks nothing like the rest of the dashboard. Deleting a chat folder already asks in an in-app dialog that names the folder.Why it matters
Anyone who deletes a custom theme gets a bare browser box that does not say what goes away. In the desktop app a native
confirm()is an OS dialog that freezes the renderer, and the window can stop taking input after it closes (seelib/appConfirm.ts).Not a goal
confirm()calls in the dashboard. Open PRs already move them (listed under Sibling sweep).deleteCustomThemeis untouched.What changed (motivation → approach → change)
The theme editor's
handleDeletecalled the browser'sconfirm(). It now asks throughaskAppConfirm(), the app-wide in-app dialog that the folder delete uses.confirm()The name is the theme's label as the theme list shows it (emoji plus name). A slug with no list entry is shown as the slug. Both delete buttons (the list row and the editor) go through the same
handleDelete.The editor is itself a Modal, and the confirmation opens on top of it. Both listen for Escape, so an Escape that cancels the delete closed the editor too.
useThemeEditornow reportsconfirmingDeletewhile the ask is open, and the editor's Modal inDisplayPanel.tsxadds it toguardAccidentalDismiss. Escape now closes only the confirmation.The two new strings are in all twelve catalogs, with each language's operand quotes. The old
delete_this_custom_themekey is removed. The new confirm key is pinned indestructiveConfirm.test.ts, so its quotes stay in every language.en-XA.jsonis regenerated.Backwards compatibility
Compatible: the delete still runs only after the user says yes; only the dialog changes.
Reader: website/src/components/themeEditor.tsx:handleDelete -- app -- the only reader of
components.themeEditor.delete_this_custom_theme, replaced here by the two new keys (git grep delete_this_custom_theme origin/main -- website/src ':!website/src/i18n/locales'finds no other)Tests
website/src/test/ThemeEditorCoverage.test.tsx:asks in the app, never the browser, and names the theme being deleted: the browser'sconfirmis never called, the in-app ask names “🌊 Ocean”, its button says Delete theme, and the delete runs. It fails on main (window.confirmcalled once).names a theme missing from the list by its slug.reports the confirmation as open until it is answered:confirmingDeleteis true while the ask waits and false after it.keeps the editor dialog open when Escape cancels the delete confirmation: the real editor in a real Modal with the realAppConfirmHost; Escape pressed from the focused confirmation leaves the editor open and deletes nothing.window.confirmspy.Proof: not provable -- frontend test (prove.py runs Python only)
Each new test was run against the code without its fix and failed: the native-confirm test on main's
themeEditor.tsx(window.confirmcalled once), the two Escape tests withoutconfirmingDelete(the editor closed). All pass with the fix, and the file passed three shuffled runs.Manual verification
In an isolated dev instance (headless Chromium), Settings › Display › Theme: created a theme named Everything, pressed Delete in the list and Delete Theme in the editor. Both show the in-app dialog with the theme's name, and no native dialog fired. Pressing Escape on the editor's confirmation closed the dialog and kept the editor open (before the guard, both closed). The headless browser has no emoji font, so the 🎨 in the name shows as a blank in the screenshots.
Screenshots / video
Delete from the theme list:
Delete from the theme editor, above the editor dialog:
After Escape, only the confirmation is gone:
Related Issues
Fixes #30400
Sibling sweep
Swept: git grep -nE "(window.)?confirm(" -- website/src ':!.test.'
Sibling: website/src/pages/ArtifactsPage.tsx -- tracked in #30515
Sibling: website/src/pages/ArtifactDetailPage.tsx -- tracked in #30515
Sibling: website/src/apps/meetings/MeetingsPage.tsx -- tracked in #30517
Sibling: website/src/apps/papyrus/ProjectList.tsx -- tracked in #30517
Sibling: website/src/apps/design-tweak/DesignTweakPage.tsx -- tracked in #30517
Sibling: website/src/apps/auto-improvement/AutoImprovementPage.tsx -- tracked in #30517
Sibling: website/src/apps/papyrus/PapyrusPage.tsx -- tracked in #30752
Pattern harvest
Rule candidate: semgrep
Pattern: a dashboard source file that calls the browser's
confirm()orwindow.confirm()instead ofuseConfirm()/askAppConfirm().Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)