Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
🛂 fix: Address Accessibility Issues - Axe Rating: Serious (#10607)
Dustin Healy39cecc97bdcb
diff --git a/client/src/components/Auth/AuthLayout.tsx b/client/src/components/Auth/AuthLayout.tsxindex f2290350ce..1aad9a94e7 100644--- a/client/src/components/Auth/AuthLayout.tsx+++ b/client/src/components/Auth/AuthLayout.tsx@@ -73,7 +73,7 @@ function AuthLayout({<ThemeSelector /></div>- <div className="flex flex-grow items-center justify-center">+ <main className="flex flex-grow items-center justify-center"><div className="w-authPageWidth overflow-hidden bg-white px-6 py-4 dark:bg-gray-900 sm:max-w-md sm:rounded-lg">{!hasStartupConfigError && !isFetching && header && (<h1@@ -89,7 +89,7 @@ function AuthLayout({<SocialLoginRender startupConfig={startupConfig} />)}</div>- </div>+ </main><Footer startupConfig={startupConfig} /></div>);diff --git a/client/src/components/Bookmarks/BookmarkItem.tsx b/client/src/components/Bookmarks/BookmarkItem.tsxindex b12a5b5ac5..d967e50633 100644--- a/client/src/components/Bookmarks/BookmarkItem.tsx+++ b/client/src/components/Bookmarks/BookmarkItem.tsx@@ -40,10 +40,10 @@ const BookmarkItem: FC<MenuItemProps> = ({ tag, selected, handleSubmit, icon, ..}if (selected) {- return <BookmarkFilledIcon className="size-4" />;+ return <BookmarkFilledIcon aria-hidden="true" className="size-4" />;}- return <BookmarkIcon className="size-4" />;+ return <BookmarkIcon aria-hidden="true" className="size-4" />;};return (diff --git a/client/src/components/Chat/Footer.tsx b/client/src/components/Chat/Footer.tsxindex babf9ff028..72aa04be57 100644--- a/client/src/components/Chat/Footer.tsx+++ b/client/src/components/Chat/Footer.tsx@@ -20,6 +20,9 @@ export default function Footer({ className }: { className?: string }) {rel="noreferrer">{localize('com_ui_privacy_policy')}+ {privacyPolicy.openNewTab === true && (+ <span className="sr-only">{' ' + localize('com_ui_opens_new_tab')}</span>+ )}</a>);@@ -31,6 +34,9 @@ export default function Footer({ className }: { className?: string }) {rel="noreferrer">{localize('com_ui_terms_of_service')}+ {termsOfService.openNewTab === true && (+ <span className="sr-only">{' ' + localize('com_ui_opens_new_tab')}</span>+ )}</a>);@@ -66,6 +72,7 @@ export default function Footer({ className }: { className?: string }) {{...otherProps}>{children}+ <span className="sr-only">{' ' + localize('com_ui_opens_new_tab')}</span></a>);},diff --git a/client/src/components/Chat/Input/Files/ImagePreview.tsx b/client/src/components/Chat/Input/Files/ImagePreview.tsxindex 37d4e79008..943de4a970 100644--- a/client/src/components/Chat/Input/Files/ImagePreview.tsx+++ b/client/src/components/Chat/Input/Files/ImagePreview.tsx@@ -1,4 +1,4 @@-import { useState, useEffect, useCallback } from 'react';+import { useState, useEffect, useCallback, useRef } from 'react';import { Maximize2 } from 'lucide-react';import { FileSources } from 'librechat-data-provider';import { OGDialog, OGDialogContent } from '@librechat/client';@@ -13,11 +13,6 @@ type styleProps = {backgroundRepeat?: string;};-interface CloseModalEvent {- stopPropagation: () => void;- preventDefault: () => void;-}-const ImagePreview = ({imageBase64,url,@@ -35,53 +30,32 @@ const ImagePreview = ({}) => {const [isModalOpen, setIsModalOpen] = useState(false);const [isHovered, setIsHovered] = useState(false);- const [previousActiveElement, setPreviousActiveElement] = useState<Element | null>(null);+ const triggerRef = useRef<HTMLButtonElement>(null);const openModal = useCallback(() => {- setPreviousActiveElement(document.activeElement);setIsModalOpen(true);}, []);- const closeModal = useCallback(- (e: CloseModalEvent): void => {- setIsModalOpen(false);- e.stopPropagation();- e.preventDefault();-- if (- previousActiveElement instanceof HTMLElement &&- !previousActiveElement.closest('[data-skip-refocus="true"]')- ) {- previousActiveElement.focus();- }- },- [previousActiveElement],- );-- const handleKeyDown = useCallback(- (e: KeyboardEvent) => {- if (e.key === 'Escape') {- closeModal(e);- }- },- [closeModal],- );+ const handleOpenChange = useCallback((open: boolean) => {+ setIsModalOpen(open);+ if (!open && triggerRef.current) {+ requestAnimationFrame(() => {+ triggerRef.current?.focus({ preventScroll: true });+ });+ }+ }, []);useEffect(() => {if (isModalOpen) {- document.addEventListener('keydown', handleKeyDown);document.body.style.overflow = 'hidden';- const closeButton = document.querySelector('[aria-label="Close full view"]') as HTMLElement;- if (closeButton) {- setTimeout(() => closeButton.focus(), 0);- }+ } else {+ document.body.style.overflow = 'unset';}return () => {- document.removeEventListener('keydown', handleKeyDown);document.body.style.overflow = 'unset';};- }, [isModalOpen, handleKeyDown]);+ }, [isModalOpen]);const baseStyle: styleProps = {backgroundSize: 'cover',@@ -117,6 +91,7 @@ const ImagePreview = ({onMouseLeave={() => setIsHovered(false)}><button+ ref={triggerRef}type="button"className="size-full overflow-hidden rounded-xl"style={style}@@ -158,7 +133,7 @@ const ImagePreview = ({<SourceIcon source={source} aria-label={source ? `Source: ${source}` : undefined} /></div>- <OGDialog open={isModalOpen} onOpenChange={setIsModalOpen}>+ <OGDialog open={isModalOpen} onOpenChange={handleOpenChange}><OGDialogContentshowCloseButton={false}className="w-11/12 overflow-x-auto bg-transparent p-0 sm:w-auto"diff --git a/client/src/components/Chat/Input/Files/Table/Columns.tsx b/client/src/components/Chat/Input/Files/Table/Columns.tsxindex 2c23b55e30..3cdeaff232 100644--- a/client/src/components/Chat/Input/Files/Table/Columns.tsx+++ b/client/src/components/Chat/Input/Files/Table/Columns.tsx@@ -79,7 +79,7 @@ export const columns: ColumnDef<TFile>[] = [<div className="flex gap-2"><ImagePreviewurl={file.filepath}- className="relative h-10 w-10 shrink-0 overflow-hidden rounded-md"+ className="relative h-10 w-10 shrink-0 overflow-visible rounded-md"source={file.source}/><span className="self-center truncate">{file.filename}</span>diff --git a/client/src/components/Chat/Input/Files/Table/DataTable.tsx b/client/src/components/Chat/Input/Files/Table/DataTable.tsxindex 38d4a44f91..87a1fc481f 100644--- a/client/src/components/Chat/Input/Files/Table/DataTable.tsx+++ b/client/src/components/Chat/Input/Files/Table/DataTable.tsx@@ -158,8 +158,8 @@ export default function DataTable<TData, TValue>({ columns, data }: DataTablePro{headerGroup.headers.map((header, index) => {const style: Style = {};if (index === 0 && header.id === 'select') {- style.width = '35px';- style.minWidth = '35px';+ style.width = '36px';+ style.minWidth = '36px';} else if (header.id === 'filename') {style.width = isSmallScreen ? '60%' : '40%';} else {@@ -204,7 +204,10 @@ export default function DataTable<TData, TValue>({ columns, data }: DataTableProreturn (<TableCellkey={cell.id}- className="align-start overflow-x-auto px-2 py-1 text-xs sm:px-4 sm:py-2 sm:text-sm [tr[data-disabled=true]_&]:opacity-50"+ className={cn(+ 'align-start px-2 py-1 text-xs sm:px-4 sm:py-2 sm:text-sm [tr[data-disabled=true]_&]:opacity-50',+ cell.column.id === 'select' ? 'overflow-visible' : 'overflow-x-auto',+ )}style={style}>{flexRender(cell.column.columnDef.cell, cell.getContext())}diff --git a/client/src/components/Chat/Menus/OpenSidebar.tsx b/client/src/components/Chat/Menus/OpenSidebar.tsxindex 5d7f418708..8f25975d6b 100644--- a/client/src/components/Chat/Menus/OpenSidebar.tsx+++ b/client/src/components/Chat/Menus/OpenSidebar.tsx@@ -30,7 +30,7 @@ export default function OpenSidebar({})}>- <Sidebar />+ <Sidebar aria-hidden="true" /></Button>}/>diff --git a/client/src/components/Chat/TemporaryChat.tsx b/client/src/components/Chat/TemporaryChat.tsxindex 8d4d28c2de..75799516c0 100644--- a/client/src/components/Chat/TemporaryChat.tsx+++ b/client/src/components/Chat/TemporaryChat.tsx@@ -42,6 +42,7 @@ export function TemporaryChat() {<buttononClick={handleBadgeToggle}aria-label={localize(temporaryBadge.label)}+ aria-pressed={isTemporary}className={cn('inline-flex size-10 flex-shrink-0 items-center justify-center rounded-xl border border-border-light text-text-primary transition-all ease-in-out hover:bg-surface-tertiary',isTemporarydiff --git a/client/src/components/Conversations/ConvoLink.tsx b/client/src/components/Conversations/ConvoLink.tsxindex 68c16594a5..e75c6bc2e7 100644--- a/client/src/components/Conversations/ConvoLink.tsx+++ b/client/src/components/Conversations/ConvoLink.tsx@@ -30,7 +30,10 @@ const ConvoLink: React.FC<ConvoLinkProps> = ({>{children}<div- className="relative flex-1 grow overflow-hidden whitespace-nowrap"+ className={cn(+ 'relative flex-1 grow overflow-hidden whitespace-nowrap',+ isActiveConvo && 'italic',+ )}style={{ textOverflow: 'clip' }}onDoubleClick={(e) => {if (isSmallScreen) {diff --git a/client/src/components/Nav/Bookmarks/BookmarkNav.tsx b/client/src/components/Nav/Bookmarks/BookmarkNav.tsxindex 27d558ba85..423d1f6a5f 100644--- a/client/src/components/Nav/Bookmarks/BookmarkNav.tsx+++ b/client/src/components/Nav/Bookmarks/BookmarkNav.tsx@@ -42,9 +42,9 @@ const BookmarkNav: FC<BookmarkNavProps> = ({ tags, setTags, isSmallScreen }: Boodata-testid="bookmark-menu">{tags.length > 0 ? (- <BookmarkFilledIcon className="icon-lg text-text-primary" aria-hidden="true" />+ <BookmarkFilledIcon aria-hidden="true" className="icon-lg text-text-primary" />) : (- <BookmarkIcon className="icon-lg text-text-primary" aria-hidden="true" />+ <BookmarkIcon aria-hidden="true" className="icon-lg text-text-primary" />)}</MenuButton>}diff --git a/client/src/components/Nav/Bookmarks/BookmarkNavItems.tsx b/client/src/components/Nav/Bookmarks/BookmarkNavItems.tsxindex b13821dbef..07d242ce67 100644--- a/client/src/components/Nav/Bookmarks/BookmarkNavItems.tsx+++ b/client/src/components/Nav/Bookmarks/BookmarkNavItems.tsx@@ -41,7 +41,7 @@ const BookmarkNavItems: FC<{data-testid="bookmark-item-clear"handleSubmit={clear}selected={false}- icon={<CrossCircledIcon className="size-4" />}+ icon={<CrossCircledIcon aria-hidden="true" className="size-4" />}/><BookmarkItemtag={localize('com_ui_no_bookmarks')}@@ -65,7 +65,7 @@ const BookmarkNavItems: FC<{data-testid="bookmark-item-clear"handleSubmit={clear}selected={false}- icon={<CrossCircledIcon className="size-4" />}+ icon={<CrossCircledIcon aria-hidden="true" className="size-4" />}/>}/>diff --git a/client/src/components/Nav/NewChat.tsx b/client/src/components/Nav/NewChat.tsxindex 026f115103..74e35a4360 100644--- a/client/src/components/Nav/NewChat.tsx+++ b/client/src/components/Nav/NewChat.tsx@@ -59,8 +59,11 @@ export default function NewChat({className="rounded-full border-none bg-transparent p-2 hover:bg-surface-hover md:rounded-xl"onClick={toggleNav}>- <Sidebar className="max-md:hidden" />- <MobileSidebar className="m-1 inline-flex size-10 items-center justify-center md:hidden" />+ <Sidebar aria-hidden="true" className="max-md:hidden" />+ <MobileSidebar+ aria-hidden="true"+ className="m-1 inline-flex size-10 items-center justify-center md:hidden"+ /></Button>}/>diff --git a/client/src/components/Nav/SearchBar.tsx b/client/src/components/Nav/SearchBar.tsxindex 893a3d98f2..39db0d3b49 100644--- a/client/src/components/Nav/SearchBar.tsx+++ b/client/src/components/Nav/SearchBar.tsx@@ -110,11 +110,14 @@ const SearchBar = forwardRef((props: SearchBarProps, ref: React.Ref<HTMLDivEleme<divref={ref}className={cn(- 'group relative mt-1 flex h-10 cursor-pointer items-center gap-3 rounded-lg border-border-medium px-3 py-2 text-text-primary transition-colors duration-200 focus-within:bg-surface-hover hover:bg-surface-hover',+ 'group relative mt-1 flex h-10 cursor-pointer items-center gap-3 rounded-lg border-2 border-transparent px-3 py-2 text-text-primary transition-all duration-200 focus-within:border-ring-primary focus-within:bg-surface-hover hover:bg-surface-hover',isSmallScreen === true ? 'mb-2 h-14 rounded-xl' : '',)}>- <Search className="absolute left-3 h-4 w-4 text-text-secondary group-focus-within:text-text-primary group-hover:text-text-primary" />+ <Search+ aria-hidden="true"+ className="absolute left-3 h-4 w-4 text-text-secondary group-focus-within:text-text-primary group-hover:text-text-primary"+ /><inputtype="text"ref={inputRef}diff --git a/client/src/components/Nav/SettingsTabs/General/ArchivedChatsTable.tsx b/client/src/components/Nav/SettingsTabs/General/ArchivedChatsTable.tsxindex f82826aa10..c451069bf6 100644--- a/client/src/components/Nav/SettingsTabs/General/ArchivedChatsTable.tsx+++ b/client/src/components/Nav/SettingsTabs/General/ArchivedChatsTable.tsx@@ -229,6 +229,7 @@ export default function ArchivedChatsTable({})}title={localize('com_ui_unarchive')}+ aria-label={localize('com_ui_unarchive')}disabled={unarchiveMutation.isLoading}>{unarchiveMutation.isLoading ? (@@ -250,6 +251,7 @@ export default function ArchivedChatsTable({setIsDeleteOpen(true);}}title={localize('com_ui_delete')}+ aria-label={localize('com_ui_delete')}><TrashIcon className="size-4" aria-hidden="true" /></Button>diff --git a/client/src/components/Prompts/AdvancedSwitch.tsx b/client/src/components/Prompts/AdvancedSwitch.tsxindex d8d6c219fc..531d14b381 100644--- a/client/src/components/Prompts/AdvancedSwitch.tsx+++ b/client/src/components/Prompts/AdvancedSwitch.tsx@@ -30,6 +30,8 @@ const AdvancedSwitch = () => {setAlwaysMakeProd(true);setMode(PromptsEditorMode.SIMPLE);}}+ aria-pressed={mode === PromptsEditorMode.SIMPLE}+ aria-label={localize('com_ui_simple')}className={`relative z-10 flex-1 rounded-xl px-3 py-2 text-sm font-medium transition-all duration-300 md:px-6 ${mode === PromptsEditorMode.SIMPLE? 'text-text-primary'@@ -43,6 +45,8 @@ const AdvancedSwitch = () => {<buttontype="button"onClick={() => setMode(PromptsEditorMode.ADVANCED)}+ aria-pressed={mode === PromptsEditorMode.ADVANCED}+ aria-label={localize('com_ui_advanced')}className={`relative z-10 flex-1 rounded-xl px-3 py-2 text-sm font-medium transition-all duration-300 md:px-6 ${mode === PromptsEditorMode.ADVANCED? 'text-text-primary'diff --git a/client/src/components/Prompts/Groups/PanelNavigation.tsx b/client/src/components/Prompts/Groups/PanelNavigation.tsxindex 421d053aa2..ee03865345 100644--- a/client/src/components/Prompts/Groups/PanelNavigation.tsx+++ b/client/src/components/Prompts/Groups/PanelNavigation.tsx@@ -23,7 +23,7 @@ function PanelNavigation({return (<div className="flex items-center justify-between">- <div className="flex gap-2">+ <div className="flex gap-2 pl-1">{!isChatRoute && <ThemeSelector returnThemeOnly={true} />}{children}</div>diff --git a/client/src/components/Prompts/PromptEditor.tsx b/client/src/components/Prompts/PromptEditor.tsxindex eeeab60d5b..ea0d1ef15c 100644--- a/client/src/components/Prompts/PromptEditor.tsx+++ b/client/src/components/Prompts/PromptEditor.tsx@@ -55,7 +55,8 @@ const PromptEditor: React.FC<Props> = ({ name, isEditing, setIsEditing }) => {return (<div className="flex max-h-[85vh] flex-col sm:max-h-[85vh]">- <h2 className="flex items-center justify-between rounded-t-xl border border-border-light py-1.5 pl-3 text-sm font-semibold text-text-primary sm:py-2 sm:pl-4 sm:text-base">+ <h2 className="sr-only">{localize('com_ui_control_bar')}</h2>+ <div className="flex items-center justify-between rounded-t-xl border border-border-light py-1.5 pl-3 text-sm font-semibold text-text-primary sm:py-2 sm:pl-4 sm:text-base"><span className="max-w-[200px] truncate sm:max-w-none">{localize('com_ui_prompt_text')}</span>@@ -78,7 +79,7 @@ const PromptEditor: React.FC<Props> = ({ name, isEditing, setIsEditing }) => {/></button></div>- </h2>+ </div><divrole="button"className={cn(diff --git a/client/src/components/Prompts/PromptForm.tsx b/client/src/components/Prompts/PromptForm.tsxindex 8ccf895540..cde24dbc2a 100644--- a/client/src/components/Prompts/PromptForm.tsx+++ b/client/src/components/Prompts/PromptForm.tsx@@ -387,6 +387,7 @@ const PromptForm = () => {return (<FormProvider {...methods}><form className="mt-4 flex w-full" onSubmit={handleSubmit((data) => onSave(data.prompt))}>+ <h1 className="sr-only">{localize('com_ui_edit_prompt_page')}</h1><div className="relative w-full"><divclassName="h-full w-full"diff --git a/client/src/components/Prompts/PromptVersions.tsx b/client/src/components/Prompts/PromptVersions.tsxindex cce643edcd..600d30fe8e 100644--- a/client/src/components/Prompts/PromptVersions.tsx+++ b/client/src/components/Prompts/PromptVersions.tsx@@ -51,8 +51,8 @@ const VersionTags = ({ tags }: { tags: string[] }) => {className={cn('w-24 justify-center border border-transparent',tag === 'production'- ? 'bg-green-100 text-green-500 dark:border-green-500 dark:bg-transparent dark:text-green-500'- : 'bg-blue-100 text-blue-500 dark:border-blue-500 dark:bg-transparent dark:text-blue-500',+ ? 'bg-green-100 text-green-700 dark:border-green-400 dark:bg-transparent dark:text-green-400'+ : 'bg-blue-100 text-blue-700 dark:border-blue-400 dark:bg-transparent dark:text-blue-400',)}labelClassName="flex items-center m-0 justify-center gap-1"LabelNode={(() => {@@ -105,7 +105,7 @@ const VersionCard = ({className={cn('group relative w-full rounded-lg border border-border-light p-4 transition-all duration-300',isSelected- ? 'bg-surface-hover shadow-xl'+ ? 'bg-surface-secondary shadow-xl ring-2 ring-gray-400': 'bg-surface-primary shadow-sm hover:bg-surface-secondary',)}onClick={onClick}diff --git a/client/src/components/SidePanel/Memories/MemoryViewer.tsx b/client/src/components/SidePanel/Memories/MemoryViewer.tsxindex f9f9c45b08..f6b581159b 100644--- a/client/src/components/SidePanel/Memories/MemoryViewer.tsx+++ b/client/src/components/SidePanel/Memories/MemoryViewer.tsx@@ -236,13 +236,21 @@ export default function MemoryViewer() {return (<div className="flex h-full w-full flex-col overflow-hidden"><div role="region" aria-label={localize('com_ui_memories')} className="mt-2 space-y-2">- <div className="flex items-center gap-4">+ <div className="relative"><Input- placeholder={localize('com_ui_memories_filter')}+ id="memory-search"+ placeholder=" "value={searchQuery}onChange={(e) => setSearchQuery(e.target.value)}aria-label={localize('com_ui_memories_filter')}+ className="peer"/>+ <Label+ htmlFor="memory-search"+ className="pointer-events-none absolute -top-1 left-3 w-auto origin-[0] translate-y-3 scale-100 rounded bg-background px-1 text-base text-text-secondary transition-transform duration-200 peer-placeholder-shown:translate-y-3 peer-placeholder-shown:scale-100 peer-focus:-translate-y-2 peer-focus:scale-75 peer-focus:text-text-primary peer-[:not(:placeholder-shown)]:-translate-y-2 peer-[:not(:placeholder-shown)]:scale-75"+ >+ {localize('com_ui_memories_filter')}+ </Label></div>{/* Memory Usage and Toggle Display */}{(memData?.tokenLimit || hasOptOutAccess) && (diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.jsonindex a82e931072..42415638d1 100644--- a/client/src/locales/en/translation.json+++ b/client/src/locales/en/translation.json@@ -797,6 +797,7 @@"com_ui_context": "Context","com_ui_continue": "Continue","com_ui_continue_oauth": "Continue with OAuth",+ "com_ui_control_bar": "Control bar","com_ui_controls": "Controls","com_ui_convo_delete_error": "Failed to delete conversation","com_ui_convo_delete_success": "Conversation successfully deleted",@@ -883,6 +884,7 @@"com_ui_edit_editing_image": "Editing image","com_ui_edit_mcp_server": "Edit MCP Server","com_ui_edit_memory": "Edit Memory",+ "com_ui_edit_prompt_page": "Edit Prompt Page","com_ui_editable_message": "Editable Message","com_ui_editor_instructions": "Drag the image to reposition • Use zoom slider or buttons to adjust size","com_ui_empty_category": "-",@@ -1241,6 +1243,7 @@"com_ui_temporary": "Temporary Chat","com_ui_terms_and_conditions": "Terms and Conditions","com_ui_terms_of_service": "Terms of service",+ "com_ui_opens_new_tab": "(opens in new tab)","com_ui_thinking": "Thinking...","com_ui_thoughts": "Thoughts","com_ui_token": "token",diff --git a/packages/client/src/components/Toast.tsx b/packages/client/src/components/Toast.tsxindex 5b8311b077..0b815d1de7 100644--- a/packages/client/src/components/Toast.tsx+++ b/packages/client/src/components/Toast.tsx@@ -7,7 +7,7 @@ export function Toast() {const severityClassName = {[NotificationSeverity.INFO]: 'border-gray-500 bg-gray-500',[NotificationSeverity.SUCCESS]: 'border-green-500 bg-green-500',- [NotificationSeverity.WARNING]: 'border-orange-500 bg-orange-500',+ [NotificationSeverity.WARNING]: 'border-orange-600 bg-orange-600',[NotificationSeverity.ERROR]: 'border-red-500 bg-red-500',};