From 115a968f1376cbef1687ed3ec422dadb15c426d2 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Fri, 19 Jun 2026 23:39:18 +0200 Subject: [PATCH] refactor: migrate remaining alert banners and error states to tokens Migrate the last banners to the Alert component: ResetPassword success, MessageContent connection error, and MemoryInfo storage-full errors. Tokenize the Agents ErrorDisplay error state in place (icon badge, headings, message, retry button) since it's a full error state, not a compact callout. Also tokenize ResetPassword field-validation errors to text-text-destructive (fixes the low-contrast dark:text-red-900). --- client/src/components/Agents/ErrorDisplay.tsx | 13 ++++++------- client/src/components/Auth/ResetPassword.tsx | 17 +++++++---------- .../Chat/Messages/Content/MemoryInfo.tsx | 10 ++++------ .../Chat/Messages/Content/MessageContent.tsx | 6 +++--- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/client/src/components/Agents/ErrorDisplay.tsx b/client/src/components/Agents/ErrorDisplay.tsx index 84acdce6bb..dcb9a9a4a9 100644 --- a/client/src/components/Agents/ErrorDisplay.tsx +++ b/client/src/components/Agents/ErrorDisplay.tsx @@ -181,11 +181,11 @@ export const ErrorDisplay: React.FC = ({ error, onRetry, cont
= ({ error, onRetry, cont {/* Error content with proper headings and structure */}
-

+

{title}

{message}

= ({ error, onRetry, cont variant="outline" size="sm" className={cn( - 'border-red-300 text-red-700 hover:bg-red-50 focus:ring-2 focus:ring-red-500', - 'dark:border-red-600 dark:text-red-400 dark:hover:bg-red-900/20 dark:focus:ring-red-400', + 'border-status-error text-status-error hover:bg-status-error-subtle', )} aria-describedby="error-message error-suggestion" aria-label={`Retry action. ${message}`} diff --git a/client/src/components/Auth/ResetPassword.tsx b/client/src/components/Auth/ResetPassword.tsx index e86a499adc..0be0d7c76a 100644 --- a/client/src/components/Auth/ResetPassword.tsx +++ b/client/src/components/Auth/ResetPassword.tsx @@ -1,5 +1,5 @@ import { useForm } from 'react-hook-form'; -import { Spinner, Button, SecretInput } from '@librechat/client'; +import { Spinner, Button, SecretInput, Alert } from '@librechat/client'; import { useOutletContext } from 'react-router-dom'; import { useNavigate, useSearchParams } from 'react-router-dom'; import { useResetPasswordMutation } from 'librechat-data-provider/react-query'; @@ -41,10 +41,7 @@ function ResetPassword() { if (resetPassword.isSuccess) { return ( <> -

+

{localize('com_auth_login_with_new_password')}

-
+ ); } @@ -107,7 +104,7 @@ function ResetPassword() {
{errors.password && ( - + {errors.password.message} )} @@ -130,17 +127,17 @@ function ResetPassword() { />
{errors.confirm_password && ( - + {errors.confirm_password.message} )} {errors.token && ( - + {errors.token.message} )} {errors.userId && ( - + {errors.userId.message} )} diff --git a/client/src/components/Chat/Messages/Content/MemoryInfo.tsx b/client/src/components/Chat/Messages/Content/MemoryInfo.tsx index d00fac68c6..9bf4fd5f6a 100644 --- a/client/src/components/Chat/Messages/Content/MemoryInfo.tsx +++ b/client/src/components/Chat/Messages/Content/MemoryInfo.tsx @@ -1,5 +1,6 @@ import type { MemoryArtifact } from 'librechat-data-provider'; import { useMemo } from 'react'; +import { Alert } from '@librechat/client'; import { useLocalize } from '~/hooks'; export default function MemoryInfo({ memoryArtifacts }: { memoryArtifacts: MemoryArtifact[] }) { @@ -89,17 +90,14 @@ export default function MemoryInfo({ memoryArtifacts }: { memoryArtifacts: Memor {errorMessages.length > 0 && (
-

+

{localize('com_ui_memory_storage_full')}

{errorMessages.map((errorMessage) => ( -
+ {errorMessage} -
+ ))}
diff --git a/client/src/components/Chat/Messages/Content/MessageContent.tsx b/client/src/components/Chat/Messages/Content/MessageContent.tsx index 0e2e7faa2c..014c1a486a 100644 --- a/client/src/components/Chat/Messages/Content/MessageContent.tsx +++ b/client/src/components/Chat/Messages/Content/MessageContent.tsx @@ -1,6 +1,6 @@ import { memo, Suspense, useMemo } from 'react'; import { useRecoilValue } from 'recoil'; -import { DelayedRender } from '@librechat/client'; +import { Alert, DelayedRender } from '@librechat/client'; import type { TMessage } from 'librechat-data-provider'; import type { TMessageContentProps, TDisplayProps } from '~/common'; import Error from '~/components/Messages/Content/Error'; @@ -64,9 +64,9 @@ const ConnectionError = ({ message }: { message?: TMessage }) => { }> -
+ {localize('com_ui_error_connection')} -
+