diff --git a/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx b/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx index 6c85dc0f63..8d438e9e87 100644 --- a/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx +++ b/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx @@ -185,7 +185,7 @@ export default function ExecuteCode({
                 
                   {highlighted ?? code}
diff --git a/client/src/components/Chat/Messages/Content/Parts/FileAuthoringCall.tsx b/client/src/components/Chat/Messages/Content/Parts/FileAuthoringCall.tsx
index 549bbd5970..72b33dae48 100644
--- a/client/src/components/Chat/Messages/Content/Parts/FileAuthoringCall.tsx
+++ b/client/src/components/Chat/Messages/Content/Parts/FileAuthoringCall.tsx
@@ -249,7 +249,7 @@ export default function FileAuthoringCall({
                 
                   
                     {highlighted ?? preview}
diff --git a/client/src/components/Chat/Messages/Content/Parts/ReadFileCall.tsx b/client/src/components/Chat/Messages/Content/Parts/ReadFileCall.tsx
index 23a9cdd00f..70a8ed104d 100644
--- a/client/src/components/Chat/Messages/Content/Parts/ReadFileCall.tsx
+++ b/client/src/components/Chat/Messages/Content/Parts/ReadFileCall.tsx
@@ -141,7 +141,7 @@ export default function ReadFileCall({
               )}
             >
               
-              
+              
                 
                   {highlighted ?? output}
                 
diff --git a/client/src/components/Chat/Messages/Content/ToolApproval.tsx b/client/src/components/Chat/Messages/Content/ToolApproval.tsx
index a75d05ecdf..cce54f4d30 100644
--- a/client/src/components/Chat/Messages/Content/ToolApproval.tsx
+++ b/client/src/components/Chat/Messages/Content/ToolApproval.tsx
@@ -1,4 +1,4 @@
-import { useContext, useEffect, useMemo } from 'react';
+import { useId, useEffect, useMemo } from 'react';
 import { Button, TextareaAutosize } from '@librechat/client';
 import { Check, X, Pencil, MessageSquare, ShieldQuestion, TriangleAlert } from 'lucide-react';
 import type { Agents } from 'librechat-data-provider';
@@ -89,6 +89,7 @@ export default function ToolApproval({
   surface?: 'thread' | 'composer';
 }) {
   const localize = useLocalize();
+  const invalidJsonId = useId();
   const { actionId, allowed_decisions: allowedDecisions, description } = approval;
   const conversationId = useContext(ChatContext)?.conversation?.conversationId;
   const composerPresents = useComposerPresentsApproval(conversationId, actionId);
@@ -239,11 +240,13 @@ export default function ToolApproval({
 
   return (
     
- {descriptionNode} + {safeDescription != null && safeDescription.length > 0 && ( +

{safeDescription}

+ )}
{allowedDecisions.map((decision) => { const Icon = DECISION_ICON[decision]; @@ -272,11 +275,15 @@ export default function ToolApproval({ onChange={(e) => updateDecisionDraft({ editText: e.target.value })} minRows={3} maxRows={16} - className={cn(fieldClasses, 'font-mono text-xs', !editIsValid && 'border-red-500')} + className={cn(fieldClasses, 'font-mono text-xs')} aria-label={localize('com_ui_edit')} + aria-invalid={!editIsValid} + aria-describedby={editIsValid ? undefined : invalidJsonId} /> {!editIsValid && ( - {localize('com_ui_invalid_json')} + + {localize('com_ui_invalid_json')} + )}
)} @@ -318,13 +325,13 @@ export default function ToolApproval({ {submitLabel} {status === 'expired' && ( - + )} {status === 'error' && ( - + diff --git a/client/src/components/Chat/Messages/Content/__tests__/ToolApproval.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/ToolApproval.test.tsx index 7938114a31..45f60ff99b 100644 --- a/client/src/components/Chat/Messages/Content/__tests__/ToolApproval.test.tsx +++ b/client/src/components/Chat/Messages/Content/__tests__/ToolApproval.test.tsx @@ -114,16 +114,15 @@ describe('ToolApproval', () => { } }); - test('invalid edit JSON replaces the field border rather than doubling it', () => { + test('invalid edit JSON marks the field invalid and names the error', () => { renderCards(); fireEvent.click(screen.getByRole('button', { name: 'Edit' })); const field = screen.getByRole('textbox', { name: 'Edit' }); fireEvent.change(field, { target: { value: '{' } }); - expect(field).toHaveClass('border-red-500'); - expect(field).not.toHaveClass('border-border-xheavy'); - expect(screen.getByText('Invalid JSON')).toBeInTheDocument(); + expect(field).toHaveAttribute('aria-invalid', 'true'); + expect(field).toHaveAccessibleDescription('Invalid JSON'); }); test('multiple paused calls share one Submit that requires every decision', () => { diff --git a/client/src/components/MCP/McpOAuthDialog.tsx b/client/src/components/MCP/McpOAuthDialog.tsx index 45049ab67c..7102829190 100644 --- a/client/src/components/MCP/McpOAuthDialog.tsx +++ b/client/src/components/MCP/McpOAuthDialog.tsx @@ -52,7 +52,7 @@ export default function McpOAuthDialog({
{iconUrl && !iconError && (