diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-12-30 13:30:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-30 11:30:35 +0000 |
| commit | 7a76216e5c971a300e9db32c93509b0376f6f47e (patch) | |
| tree | 2e383482c7dbfb127c2c3c725125ad253c6b4aa0 /apps/web/lib | |
| parent | b20ba9cfccd22159bf8263165cca76aab3147d9c (diff) | |
| download | karakeep-7a76216e5c971a300e9db32c93509b0376f6f47e.tar.zst | |
feat: Add bulk remove from list (#2279)
* feat: Add bulk remove from list action in list context
- Add "Remove from List" button in bulk actions menu
- Only visible when in a manual list context with editor/owner role
- Includes confirmation dialog before removal
- Uses same concurrency pattern as bulk add (50 concurrent operations)
- Displays success count in toast notification
- Add translation key "actions.remove" for consistency
This complements the existing bulk add to list functionality and allows
users to efficiently remove multiple bookmarks from a list at once.
* fmt
* fix list context
* add remove from list
---------
Co-authored-by: Claude <noreply@anthropic.com>
Diffstat (limited to 'apps/web/lib')
| -rw-r--r-- | apps/web/lib/bulkActions.ts | 7 | ||||
| -rw-r--r-- | apps/web/lib/i18n/locales/en/translation.json | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/apps/web/lib/bulkActions.ts b/apps/web/lib/bulkActions.ts index 34a236c6..ef814331 100644 --- a/apps/web/lib/bulkActions.ts +++ b/apps/web/lib/bulkActions.ts @@ -2,6 +2,7 @@ import { create } from "zustand"; import type { ZBookmark } from "@karakeep/shared/types/bookmarks"; +import { ZBookmarkList } from "@karakeep/shared/types/lists"; interface BookmarkState { selectedBookmarks: ZBookmark[]; @@ -13,12 +14,15 @@ interface BookmarkState { selectAll: () => void; unSelectAll: () => void; isEverythingSelected: () => boolean; + setListContext: (listContext: ZBookmarkList | undefined) => void; + listContext: ZBookmarkList | undefined; } const useBulkActionsStore = create<BookmarkState>((set, get) => ({ selectedBookmarks: [], visibleBookmarks: [], isBulkEditEnabled: false, + listContext: undefined, toggleBookmark: (bookmark: ZBookmark) => { const selectedBookmarks = get().selectedBookmarks; @@ -57,6 +61,9 @@ const useBulkActionsStore = create<BookmarkState>((set, get) => ({ visibleBookmarks, }); }, + setListContext: (listContext: ZBookmarkList | undefined) => { + set({ listContext }); + }, })); export default useBulkActionsStore; diff --git a/apps/web/lib/i18n/locales/en/translation.json b/apps/web/lib/i18n/locales/en/translation.json index 87851324..7077a36b 100644 --- a/apps/web/lib/i18n/locales/en/translation.json +++ b/apps/web/lib/i18n/locales/en/translation.json @@ -86,6 +86,7 @@ "remove_from_list": "Remove from List", "save": "Save", "add": "Add", + "remove": "Remove", "edit": "Edit", "confirm": "Confirm", "open_editor": "Open Editor", |
