From b850d40db859ffde73b12560cb1a6a1deb81e9cc Mon Sep 17 00:00:00 2001 From: Danielle Maywood Date: Tue, 10 Mar 2026 10:32:27 +0000 Subject: [PATCH] fix(site): remove redundant success toasts from agents feature (#22884) --- site/src/pages/AgentsPage/AgentsPage.tsx | 6 ------ site/src/pages/AgentsPage/WebPushButton.tsx | 9 ++------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/site/src/pages/AgentsPage/AgentsPage.tsx b/site/src/pages/AgentsPage/AgentsPage.tsx index c07b4038e3..b3fd16b96a 100644 --- a/site/src/pages/AgentsPage/AgentsPage.tsx +++ b/site/src/pages/AgentsPage/AgentsPage.tsx @@ -171,7 +171,6 @@ const AgentsPage: FC = () => { ...archiveChatBase, onSuccess: (_data, chatId) => { clearChatErrorReason(chatId); - toast.success("Agent archived."); }, onError: (error, chatId, context) => { archiveChatBase.onError(error, chatId, context); @@ -194,8 +193,6 @@ const AgentsPage: FC = () => { clearChatErrorReason(chatId); await queryClient.invalidateQueries({ queryKey: chatsKey }); await queryClient.invalidateQueries({ queryKey: chatKey(chatId) }); - toast.success("Agent archived."); - toast.success("Workspace deletion initiated."); }, onError: (error) => { toast.error(getErrorMessage(error, "Failed to archive agent.")); @@ -204,9 +201,6 @@ const AgentsPage: FC = () => { const unarchiveChatBase = unarchiveChat(queryClient); const unarchiveAgentMutation = useMutation({ ...unarchiveChatBase, - onSuccess: () => { - toast.success("Agent unarchived."); - }, onError: (error, chatId, context) => { unarchiveChatBase.onError(error, chatId, context); toast.error(getErrorMessage(error, "Failed to unarchive agent.")); diff --git a/site/src/pages/AgentsPage/WebPushButton.tsx b/site/src/pages/AgentsPage/WebPushButton.tsx index c482902b40..f98c35ef2f 100644 --- a/site/src/pages/AgentsPage/WebPushButton.tsx +++ b/site/src/pages/AgentsPage/WebPushButton.tsx @@ -22,17 +22,12 @@ export const WebPushButton: FC = () => { try { if (webPush.subscribed) { await webPush.unsubscribe(); - toast.success("Notifications disabled."); } else { await webPush.subscribe(); - toast.success("Notifications enabled."); } } catch (error) { - if (webPush.subscribed) { - toast.error(getErrorMessage(error, "Failed to disable notifications.")); - } else { - toast.error(getErrorMessage(error, "Failed to enable notifications.")); - } + const action = webPush.subscribed ? "disable" : "enable"; + toast.error(getErrorMessage(error, `Failed to ${action} notifications.`)); } };