Description
Context
QueryFavorites.tsx:189-195 (context menu has onClick: () => deleteCategory(cat)); favoritesStore.ts:117-123 (silently reassigns to Uncategorized).
Problem
The "Delete Category" context menu entry fires deleteCategory(cat) immediately. The store action silently reassigns all favorites in that category to Uncategorized — the favorites aren't lost, but the user's mental model is "I deleted the folder, the queries inside are gone". For a user with 50 favorites in Reports, clicking Delete (perhaps to rename it) destroys a minute of organizational work. The store has the right data shape to undo (we know fav.category was the deleted string), but there is no undo.
Files
- src/components/favorites/QueryFavorites.tsx:189-195
- src/stores/favoritesStore.ts:117-123
Expected
Right-click a category → Delete Category → confirmation dialog shows count → confirm → category disappears; the favorites are visibly in Uncategorized.
Proposed fix
Scope S — wrap the "Delete Category" click in a ConfirmDialog that reads "Delete category 'Reports'? 50 favorites will be moved to Uncategorized." with Confirm/Cancel. Optionally add an undo toast that re-creates the category with the same favorites within 5 seconds.
Acceptance
Right-click a category → Delete Category → confirmation dialog shows count → confirm → category disappears; the favorites are visibly in Uncategorized.
Needs human verify
no
Activity
fix(favorites): confirm before overwriting dirty editor tab (#341)