From 2250b3c2ae3e1e3452d02cf547821f48c0a76204 Mon Sep 17 00:00:00 2001
From: Marco Beretta <81851188+berry-13@users.noreply.github.com>
Date: Thu, 8 Jan 2026 03:02:13 +0100
Subject: [PATCH] style: remove DeleteBookmarkButton and EditBookmarkButton
components; update translations for bookmark deletion confirmation
---
.../Bookmarks/DeleteBookmarkButton.tsx | 87 -------------------
.../Bookmarks/EditBookmarkButton.tsx | 46 ----------
client/src/components/Bookmarks/index.ts | 6 +-
.../Bookmarks/BookmarkCardActions.tsx | 27 +++---
.../MCPBuilder/MCPServerDialog/index.tsx | 2 +-
client/src/locales/en/translation.json | 4 +-
6 files changed, 17 insertions(+), 155 deletions(-)
delete mode 100644 client/src/components/Bookmarks/DeleteBookmarkButton.tsx
delete mode 100644 client/src/components/Bookmarks/EditBookmarkButton.tsx
diff --git a/client/src/components/Bookmarks/DeleteBookmarkButton.tsx b/client/src/components/Bookmarks/DeleteBookmarkButton.tsx
deleted file mode 100644
index e63feb7621..0000000000
--- a/client/src/components/Bookmarks/DeleteBookmarkButton.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import { useCallback, useState } from 'react';
-import {
- Button,
- TrashIcon,
- Label,
- OGDialog,
- OGDialogTrigger,
- TooltipAnchor,
- OGDialogTemplate,
- useToastContext,
-} from '@librechat/client';
-import type { FC } from 'react';
-import { useDeleteConversationTagMutation } from '~/data-provider';
-import { NotificationSeverity } from '~/common';
-import { useLocalize } from '~/hooks';
-
-const DeleteBookmarkButton: FC<{
- bookmark: string;
- tabIndex?: number;
- onFocus?: () => void;
- onBlur?: () => void;
-}> = ({ bookmark, tabIndex = 0, onFocus, onBlur }) => {
- const localize = useLocalize();
- const { showToast } = useToastContext();
- const [open, setOpen] = useState(false);
-
- const deleteBookmarkMutation = useDeleteConversationTagMutation({
- onSuccess: () => {
- showToast({
- message: localize('com_ui_bookmarks_delete_success'),
- });
- },
- onError: () => {
- showToast({
- message: localize('com_ui_bookmarks_delete_error'),
- severity: NotificationSeverity.ERROR,
- });
- },
- });
-
- const confirmDelete = useCallback(async () => {
- await deleteBookmarkMutation.mutateAsync(bookmark);
- }, [bookmark, deleteBookmarkMutation]);
-
- return (
- <>
-
-
- setOpen(!open)}
- className="h-8 w-8 p-0"
- >
-
-
- }
- />
-
-
- {localize('com_ui_bookmark_delete_confirm')} {bookmark}
-
- }
- selection={{
- selectHandler: confirmDelete,
- selectClasses:
- 'bg-red-700 dark:bg-red-600 hover:bg-red-800 dark:hover:bg-red-800 text-white',
- selectText: localize('com_ui_delete'),
- }}
- />
-
- >
- );
-};
-
-export default DeleteBookmarkButton;
diff --git a/client/src/components/Bookmarks/EditBookmarkButton.tsx b/client/src/components/Bookmarks/EditBookmarkButton.tsx
deleted file mode 100644
index 7c4355be81..0000000000
--- a/client/src/components/Bookmarks/EditBookmarkButton.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { useState } from 'react';
-import { TooltipAnchor, OGDialogTrigger, EditIcon, Button } from '@librechat/client';
-import type { TConversationTag } from 'librechat-data-provider';
-import type { FC } from 'react';
-import BookmarkEditDialog from './BookmarkEditDialog';
-import { useLocalize } from '~/hooks';
-
-const EditBookmarkButton: FC<{
- bookmark: TConversationTag;
- tabIndex?: number;
- onFocus?: () => void;
- onBlur?: () => void;
-}> = ({ bookmark, tabIndex = 0, onFocus, onBlur }) => {
- const localize = useLocalize();
- const [open, setOpen] = useState(false);
-
- return (
-
-
- setOpen(!open)}
- className="h-8 w-8 p-0"
- >
-
-
- }
- />
-
-
- );
-};
-
-export default EditBookmarkButton;
diff --git a/client/src/components/Bookmarks/index.ts b/client/src/components/Bookmarks/index.ts
index 8b26e892c8..f499633154 100644
--- a/client/src/components/Bookmarks/index.ts
+++ b/client/src/components/Bookmarks/index.ts
@@ -1,6 +1,4 @@
-export { default as DeleteBookmarkButton } from './DeleteBookmarkButton';
-export { default as EditBookmarkButton } from './EditBookmarkButton';
-export { default as BookmarkEditDialog } from './BookmarkEditDialog';
-export { default as BookmarkItems } from './BookmarkItems';
export { default as BookmarkItem } from './BookmarkItem';
export { default as BookmarkForm } from './BookmarkForm';
+export { default as BookmarkItems } from './BookmarkItems';
+export { default as BookmarkEditDialog } from './BookmarkEditDialog';
diff --git a/client/src/components/SidePanel/Bookmarks/BookmarkCardActions.tsx b/client/src/components/SidePanel/Bookmarks/BookmarkCardActions.tsx
index 1df7d35c36..93e7a54ac7 100644
--- a/client/src/components/SidePanel/Bookmarks/BookmarkCardActions.tsx
+++ b/client/src/components/SidePanel/Bookmarks/BookmarkCardActions.tsx
@@ -1,14 +1,15 @@
import { useState, useRef, useCallback } from 'react';
import { Pencil, Trash2 } from 'lucide-react';
-import type { TConversationTag } from 'librechat-data-provider';
import {
Button,
+ Spinner,
OGDialog,
+ TooltipAnchor,
OGDialogTrigger,
OGDialogTemplate,
- TooltipAnchor,
useToastContext,
} from '@librechat/client';
+import type { TConversationTag } from 'librechat-data-provider';
import { useDeleteConversationTagMutation } from '~/data-provider';
import { BookmarkEditDialog } from '~/components/Bookmarks';
import { NotificationSeverity } from '~/common';
@@ -42,7 +43,9 @@ export default function BookmarkCardActions({ bookmark }: BookmarkCardActionsPro
},
});
- const confirmDelete = useCallback(async () => {
+ const isDeleting = deleteBookmarkMutation.isLoading;
+
+ const handleDelete = useCallback(async () => {
await deleteBookmarkMutation.mutateAsync(bookmark.tag);
}, [bookmark.tag, deleteBookmarkMutation]);
@@ -97,20 +100,14 @@ export default function BookmarkCardActions({ bookmark }: BookmarkCardActionsPro
/>
- {localize('com_ui_bookmark_delete_confirm')} {bookmark.tag}
-
+ className="w-11/12 max-w-md"
+ description={localize('com_ui_bookmark_delete_confirm', { 0: bookmark.tag })}
+ selection={
+
}
- selection={{
- selectHandler: confirmDelete,
- selectClasses:
- 'bg-destructive text-white transition-all duration-200 hover:bg-destructive/80',
- selectText: localize('com_ui_delete'),
- }}
/>
diff --git a/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/index.tsx b/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/index.tsx
index 41adc6ef22..8a07246e2d 100644
--- a/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/index.tsx
+++ b/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/index.tsx
@@ -116,7 +116,7 @@ export default function MCPServerDialog({
className="w-11/12 max-w-md"
description={localize('com_ui_mcp_server_delete_confirm', { 0: server?.serverName })}
selection={
-