You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P0/bug] SaveFavoriteDialog does not validate against duplicate names #332
SaveFavoriteDialog.handleSave (src/components/favorites/SaveFavoriteDialog.tsx:39-51) and favoritesStore.addFavorite (src/stores/favoritesStore.ts:80-95) have no dedup check.
Problem
Saving two favorites with the same name creates two entries, both rendering with the same label in the sidebar. The user has to inspect them one by one to delete the duplicate. The store action doesn't dedup either, so the bug is reproducible from any code path.
Submitting the dialog with a duplicate name shows an inline error and does not close the dialog; the store does not gain a new entry; the existing entry is untouched.
Proposed fix
Scope S — add a getByName(name: string) selector to favoritesStore; in SaveFavoriteDialog.handleSave, do if (store.getByName(name.trim()).length > 0) { showError('A favorite with this name already exists'); return; }. Or change the message to "exists in category X; click here to overwrite" as a smarter UX.
Acceptance
Submitting the dialog with a duplicate name shows an inline error and does not close the dialog; the store does not gain a new entry; the existing entry is untouched.
Activity