fix: Address Accessibility Issues (#10260)

* chore: add i18n localization comment for AlwaysMakeProd component

* feat: enhance accessibility by adding aria-label and aria-labelledby to Switch component

* feat: add aria-labels for accessibility in Agent and Assistant avatar buttons

* fix: add switch aria-labels for accessibility in various components

* feat: add aria-labels and localization keys for accessibility in DataTable, DataTableColumnHeader, and OGDialogTemplate components

* chore: refactor out nested ternary

* feat: add aria-label to DataTable filter button for My Files modal

* feat: add aria-labels for Buttons and localization strings

* feat: add aria-labels to Checkboxes in Agent Builder

* feat: enhance accessibility by adding aria-label and aria-labelledby to Checkbox component

* feat: add aria-label to FileSearchCheckbox in Agent Builder

* feat: add aria-label to Prompts text input area

* feat: enhance accessibility by adding aria-label and aria-labelledby to TextAreaAutosize component

* feat: remove improper role: "list" prop from List in Conversations.tsx to enhance accessibility and stop aria rules conflicting within react-virtualized component

* feat: enhance accessibility by allowing tab navigation and adding ring highlights for conversation title editing accept/reject buttons

* feat: add aria-label to Copy Link button in the conversation share modal

* feat: add title to QR code svg in conversation share modal to  describe the image content

* feat: enhance accessibility by making Agent Avatar upload keyboard navigable and round out highlight border on focus

* feat: enhance accessibility by adding aria attributes around alerting users with screen readers to invalid email address inputs in the Agent Builder

* feat: add aria-labels to buttons in Advanced panel of Agent Builder

* feat: enhance accessibility by making FileUpload and Clear All buttons in PresetItems keyboard navigable

* feat: enchance accessiblity by indexing view and delete button aria-labels in shared links management modal to their specific chat titles

* feat: add border highlighting on focus for AnimatedSearchInput

* feat: add category description to aria-labels for prompts in ListCard

* feat: add proper scoping to rows and columns in table headers

* feat: add localized aria-labelling to EditTextPart's TextAreaAutosize component and base dynamic paramters panel components and their supporting translation keys

* feat: add localized aria-labels and aria-labelledBy to Checkbox components without them

* feat: add localized aria-labeledBy for endpoint settings Sliders

* feat: add localized aria-labels for TextareaAutosize components

* chore: remove unused i18n string

* feat: add localized aria-label for BookmarkForm Checkbox

* fix: add stopPropagation onKeyDown for Preview and Edit menu items in prompts that was causing the prompts to inadvertently be sent when triggered with keyboard navigation when Auto-send Prompts was toggled on

* fix: switch TableCell to TableHead for title cells according to harvard issue #789

* fix: add more descriptive localization key for file filter button in DataTable

* chore: remove self-explanatory code comment from RenameForm

* fix: remove stray bg-yellow highlight that was left in during debugging

* fix: add aria-label to model configurator panel back button

* fix: undo incorrect hoist of tool name split for aria-label and span in MCPInput

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
Dustin Healy 2025-10-28 00:46:43 +01:00 committed by GitHub
parent 33d6b337bc
commit 0446d0e190
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
74 changed files with 427 additions and 131 deletions

View file

@ -58,6 +58,7 @@ const LabelController: React.FC<LabelControllerProps> = ({
checked={field.value} checked={field.value}
onCheckedChange={field.onChange} onCheckedChange={field.onChange}
value={field.value.toString()} value={field.value.toString()}
aria-label={label}
/> />
)} )}
/> />

View file

@ -129,7 +129,11 @@ const BookmarkForm = ({
</div> </div>
<div className="mt-4 grid w-full items-center gap-2"> <div className="mt-4 grid w-full items-center gap-2">
<Label htmlFor="bookmark-description" className="text-left text-sm font-medium"> <Label
id="bookmark-description-label"
htmlFor="bookmark-description"
className="text-left text-sm font-medium"
>
{localize('com_ui_bookmarks_description')} {localize('com_ui_bookmarks_description')}
</Label> </Label>
<TextareaAutosize <TextareaAutosize
@ -147,6 +151,7 @@ const BookmarkForm = ({
className={cn( className={cn(
'flex h-10 max-h-[250px] min-h-[100px] w-full resize-none rounded-lg border border-input bg-transparent px-3 py-2 text-sm ring-offset-background focus-visible:outline-none', 'flex h-10 max-h-[250px] min-h-[100px] w-full resize-none rounded-lg border border-input bg-transparent px-3 py-2 text-sm ring-offset-background focus-visible:outline-none',
)} )}
aria-labelledby="bookmark-description-label"
/> />
</div> </div>
{conversationId != null && conversationId && ( {conversationId != null && conversationId && (
@ -161,6 +166,7 @@ const BookmarkForm = ({
onCheckedChange={field.onChange} onCheckedChange={field.onChange}
className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer" className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer"
value={field.value?.toString()} value={field.value?.toString()}
aria-label={localize('com_ui_bookmarks_add_to_conversation')}
/> />
)} )}
/> />

View file

@ -12,6 +12,7 @@ import {
import { import {
useTextarea, useTextarea,
useAutoSave, useAutoSave,
useLocalize,
useRequiresKey, useRequiresKey,
useHandleKeyUp, useHandleKeyUp,
useQueryParams, useQueryParams,
@ -38,6 +39,7 @@ const ChatForm = memo(({ index = 0 }: { index?: number }) => {
const submitButtonRef = useRef<HTMLButtonElement>(null); const submitButtonRef = useRef<HTMLButtonElement>(null);
const textAreaRef = useRef<HTMLTextAreaElement>(null); const textAreaRef = useRef<HTMLTextAreaElement>(null);
useFocusChatEffect(textAreaRef); useFocusChatEffect(textAreaRef);
const localize = useLocalize();
const [isCollapsed, setIsCollapsed] = useState(false); const [isCollapsed, setIsCollapsed] = useState(false);
const [, setIsScrollable] = useState(false); const [, setIsScrollable] = useState(false);
@ -279,6 +281,7 @@ const ChatForm = memo(({ index = 0 }: { index?: number }) => {
setIsTextAreaFocused(true); setIsTextAreaFocused(true);
}} }}
onBlur={setIsTextAreaFocused.bind(null, false)} onBlur={setIsTextAreaFocused.bind(null, false)}
aria-label={localize('com_ui_message_input')}
onClick={handleFocusOrClick} onClick={handleFocusOrClick}
style={{ height: 44, overflowY: 'auto' }} style={{ height: 44, overflowY: 'auto' }}
className={cn( className={cn(

View file

@ -62,17 +62,28 @@ const FileUpload: React.FC<FileUploadProps> = ({
statusText = invalidText ?? localize('com_ui_upload_invalid'); statusText = invalidText ?? localize('com_ui_upload_invalid');
} }
const handleClick = () => {
const fileInput = document.getElementById(`file-upload-${id}`) as HTMLInputElement;
if (fileInput) {
fileInput.click();
}
};
return ( return (
<label <>
htmlFor={`file-upload-${id}`} <button
type="button"
onClick={handleClick}
className={cn( className={cn(
'mr-1 flex h-auto cursor-pointer items-center rounded bg-transparent px-2 py-1 text-xs font-normal transition-colors hover:bg-gray-100 hover:text-green-600 dark:bg-transparent dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-green-500', 'mr-1 flex h-auto cursor-pointer items-center rounded bg-transparent px-2 py-1 text-xs font-normal transition-colors hover:bg-gray-100 hover:text-green-600 focus:ring-ring dark:bg-transparent dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-green-500',
statusColor, statusColor,
containerClassName, containerClassName,
)} )}
aria-label={statusText}
> >
<FileUp className="mr-1 flex w-[22px] items-center stroke-1" /> <FileUp className="mr-1 flex w-[22px] items-center stroke-1" aria-hidden="true" />
<span className="flex text-xs">{statusText}</span> <span className="flex text-xs">{statusText}</span>
</button>
<input <input
id={`file-upload-${id}`} id={`file-upload-${id}`}
value="" value=""
@ -80,8 +91,9 @@ const FileUpload: React.FC<FileUploadProps> = ({
className={cn('hidden', className)} className={cn('hidden', className)}
accept=".json" accept=".json"
onChange={handleFileChange} onChange={handleFileChange}
tabIndex={-1}
/> />
</label> </>
); );
}; };

View file

@ -122,7 +122,11 @@ export default function DataTable<TData, TValue>({ columns, data }: DataTablePro
/> />
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger asChild> <DropdownMenuTrigger asChild>
<Button variant="outline" className={cn('min-w-[40px]', isSmallScreen && 'px-2 py-1')}> <Button
variant="outline"
aria-label={localize('com_files_filter_by')}
className={cn('min-w-[40px]', isSmallScreen && 'px-2 py-1')}
>
<ListFilter className="size-3.5 sm:size-4" /> <ListFilter className="size-3.5 sm:size-4" />
</Button> </Button>
</DropdownMenuTrigger> </DropdownMenuTrigger>

View file

@ -59,9 +59,10 @@ const PresetItems: FC<{
</label> </label>
<Dialog> <Dialog>
<DialogTrigger asChild> <DialogTrigger asChild>
<label <button
htmlFor="file-upload" type="button"
className="mr-1 flex h-[32px] cursor-pointer items-center rounded bg-transparent px-2 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-red-700 dark:bg-transparent dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-red-700" className="mr-1 flex h-[32px] cursor-pointer items-center rounded bg-transparent px-2 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-red-700 focus:ring-ring dark:bg-transparent dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-red-700"
aria-label={localize('com_ui_clear') + ' ' + localize('com_ui_all')}
> >
<svg <svg
width="24" width="24"
@ -70,11 +71,12 @@ const PresetItems: FC<{
fill="currentColor" fill="currentColor"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
className="mr-1 flex w-[22px] items-center" className="mr-1 flex w-[22px] items-center"
aria-hidden="true"
> >
<path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0M9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1M6.854 7.146 8 8.293l1.146-1.147a.5.5 0 1 1 .708.708L8.707 9l1.147 1.146a.5.5 0 0 1-.708.708L8 9.707l-1.146 1.147a.5.5 0 0 1-.708-.708L7.293 9 6.146 7.854a.5.5 0 1 1 .708-.708"></path> <path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0M9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1M6.854 7.146 8 8.293l1.146-1.147a.5.5 0 1 1 .708.708L8.707 9l1.147 1.146a.5.5 0 0 1-.708.708L8 9.707l-1.146 1.147a.5.5 0 0 1-.708-.708L7.293 9 6.146 7.854a.5.5 0 1 1 .708-.708"></path>
</svg> </svg>
{localize('com_ui_clear')} {localize('com_ui_all')} {localize('com_ui_clear')} {localize('com_ui_all')}
</label> </button>
</DialogTrigger> </DialogTrigger>
<DialogTemplate <DialogTemplate
showCloseButton={false} showCloseButton={false}

View file

@ -168,6 +168,7 @@ const EditMessage = ({
'max-h-[65vh] pr-3 md:max-h-[75vh] md:pr-4', 'max-h-[65vh] pr-3 md:max-h-[75vh] md:pr-4',
removeFocusRings, removeFocusRings,
)} )}
aria-label={localize('com_ui_message_input')}
dir={isRTL ? 'rtl' : 'ltr'} dir={isRTL ? 'rtl' : 'ltr'}
/> />
</div> </div>

View file

@ -170,6 +170,7 @@ const EditTextPart = ({
'max-h-[65vh] pr-3 md:max-h-[75vh] md:pr-4', 'max-h-[65vh] pr-3 md:max-h-[75vh] md:pr-4',
removeFocusRings, removeFocusRings,
)} )}
aria-label={localize('com_ui_editable_message')}
dir={isRTL ? 'rtl' : 'ltr'} dir={isRTL ? 'rtl' : 'ltr'}
/> />
</div> </div>

View file

@ -201,7 +201,6 @@ const Conversations: FC<ConversationsProps> = ({
overscanRowCount={10} overscanRowCount={10}
className="outline-none" className="outline-none"
style={{ outline: 'none' }} style={{ outline: 'none' }}
role="list"
aria-label="Conversations" aria-label="Conversations"
onRowsRendered={handleRowsRendered} onRowsRendered={handleRowsRendered}
tabIndex={-1} tabIndex={-1}

View file

@ -77,7 +77,13 @@ export default function ShareButton({
<div className="relative items-center rounded-lg p-2"> <div className="relative items-center rounded-lg p-2">
{showQR && ( {showQR && (
<div className="mb-4 flex flex-col items-center"> <div className="mb-4 flex flex-col items-center">
<QRCodeSVG value={sharedLink} size={200} marginSize={2} className="rounded-2xl" /> <QRCodeSVG
value={sharedLink}
size={200}
marginSize={2}
className="rounded-2xl"
title={localize('com_ui_share_qr_code_description')}
/>
</div> </div>
)} )}
@ -87,6 +93,7 @@ export default function ShareButton({
<Button <Button
size="sm" size="sm"
variant="outline" variant="outline"
aria-label={localize('com_ui_copy_link')}
onClick={() => { onClick={() => {
if (isCopying) { if (isCopying) {
return; return;

View file

@ -34,6 +34,8 @@ const RenameForm: React.FC<RenameFormProps> = ({
case 'Enter': case 'Enter':
onSubmit(titleInput); onSubmit(titleInput);
break; break;
case 'Tab':
break;
} }
}; };
@ -50,22 +52,23 @@ const RenameForm: React.FC<RenameFormProps> = ({
value={titleInput} value={titleInput}
onChange={(e) => setTitleInput(e.target.value)} onChange={(e) => setTitleInput(e.target.value)}
onKeyDown={handleKeyDown} onKeyDown={handleKeyDown}
onBlur={() => onSubmit(titleInput)}
maxLength={100} maxLength={100}
aria-label={localize('com_ui_new_conversation_title')} aria-label={localize('com_ui_new_conversation_title')}
/> />
<div className="flex gap-1" role="toolbar"> <div className="flex gap-1" role="toolbar">
<button <button
onClick={() => onCancel()} onClick={() => onCancel()}
className="p-1 hover:opacity-70 focus:outline-none focus:ring-2" className="rounded-md p-1 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-ring"
aria-label={localize('com_ui_cancel')} aria-label={localize('com_ui_cancel')}
type="button"
> >
<X className="h-4 w-4" aria-hidden="true" /> <X className="h-4 w-4" aria-hidden="true" />
</button> </button>
<button <button
onClick={() => onSubmit(titleInput)} onClick={() => onSubmit(titleInput)}
className="p-1 hover:opacity-70 focus:outline-none focus:ring-2" className="rounded-md p-1 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-ring"
aria-label={localize('com_ui_save')} aria-label={localize('com_ui_save')}
type="button"
> >
<Check className="h-4 w-4" aria-hidden="true" /> <Check className="h-4 w-4" aria-hidden="true" />
</button> </button>

View file

@ -151,6 +151,7 @@ export default function Settings({
min={0} min={0}
step={0.01} step={0.01}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="temp-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={optionEndpoint ?? ''} type="temp" side={ESide.Left} /> <OptionHover endpoint={optionEndpoint ?? ''} type="temp" side={ESide.Left} />
@ -160,7 +161,9 @@ export default function Settings({
<div className="flex justify-between"> <div className="flex justify-between">
<Label htmlFor="top-p-int" className="text-left text-sm font-medium"> <Label htmlFor="top-p-int" className="text-left text-sm font-medium">
{localize('com_endpoint_top_p')}{' '} {localize('com_endpoint_top_p')}{' '}
<small className="opacity-40">({localize('com_endpoint_default')}: 1)</small> <small className="opacity-40">
({localize('com_endpoint_default_with_num', { 0: '1' })})
</small>
</Label> </Label>
<InputNumber <InputNumber
id="top-p-int" id="top-p-int"
@ -189,6 +192,7 @@ export default function Settings({
min={0} min={0}
step={0.01} step={0.01}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="top-p-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={optionEndpoint ?? ''} type="topp" side={ESide.Left} /> <OptionHover endpoint={optionEndpoint ?? ''} type="topp" side={ESide.Left} />
@ -199,7 +203,9 @@ export default function Settings({
<div className="flex justify-between"> <div className="flex justify-between">
<Label htmlFor="freq-penalty-int" className="text-left text-sm font-medium"> <Label htmlFor="freq-penalty-int" className="text-left text-sm font-medium">
{localize('com_endpoint_frequency_penalty')}{' '} {localize('com_endpoint_frequency_penalty')}{' '}
<small className="opacity-40">({localize('com_endpoint_default')}: 0)</small> <small className="opacity-40">
({localize('com_endpoint_default_with_num', { 0: '0' })})
</small>
</Label> </Label>
<InputNumber <InputNumber
id="freq-penalty-int" id="freq-penalty-int"
@ -228,6 +234,7 @@ export default function Settings({
min={-2} min={-2}
step={0.01} step={0.01}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="freq-penalty-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={optionEndpoint ?? ''} type="freq" side={ESide.Left} /> <OptionHover endpoint={optionEndpoint ?? ''} type="freq" side={ESide.Left} />
@ -238,7 +245,9 @@ export default function Settings({
<div className="flex justify-between"> <div className="flex justify-between">
<Label htmlFor="pres-penalty-int" className="text-left text-sm font-medium"> <Label htmlFor="pres-penalty-int" className="text-left text-sm font-medium">
{localize('com_endpoint_presence_penalty')}{' '} {localize('com_endpoint_presence_penalty')}{' '}
<small className="opacity-40">({localize('com_endpoint_default')}: 0)</small> <small className="opacity-40">
({localize('com_endpoint_default_with_num', { 0: '0' })})
</small>
</Label> </Label>
<InputNumber <InputNumber
id="pres-penalty-int" id="pres-penalty-int"
@ -267,6 +276,7 @@ export default function Settings({
min={-2} min={-2}
step={0.01} step={0.01}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="pres-penalty-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={optionEndpoint ?? ''} type="pres" side={ESide.Left} /> <OptionHover endpoint={optionEndpoint ?? ''} type="pres" side={ESide.Left} />
@ -306,6 +316,7 @@ export default function Settings({
onCheckedChange={(checked: boolean) => setResendFiles(checked)} onCheckedChange={(checked: boolean) => setResendFiles(checked)}
disabled={readonly} disabled={readonly}
className="flex" className="flex"
aria-label={localize('com_endpoint_plug_resend_files')}
/> />
<OptionHover endpoint={optionEndpoint ?? ''} type="resend" side={ESide.Bottom} /> <OptionHover endpoint={optionEndpoint ?? ''} type="resend" side={ESide.Bottom} />
</HoverCardTrigger> </HoverCardTrigger>
@ -323,6 +334,7 @@ export default function Settings({
max={2} max={2}
min={0} min={0}
step={1} step={1}
aria-label={localize('com_endpoint_plug_image_detail')}
/> />
<OptionHover endpoint={optionEndpoint ?? ''} type="detail" side={ESide.Bottom} /> <OptionHover endpoint={optionEndpoint ?? ''} type="detail" side={ESide.Bottom} />
</HoverCardTrigger> </HoverCardTrigger>

View file

@ -53,7 +53,9 @@ export default function Settings({ conversation, setOption, models, readonly }:
<div className="flex justify-between"> <div className="flex justify-between">
<Label htmlFor="temp-int" className="text-left text-sm font-medium"> <Label htmlFor="temp-int" className="text-left text-sm font-medium">
{localize('com_endpoint_temperature')}{' '} {localize('com_endpoint_temperature')}{' '}
<small className="opacity-40">({localize('com_endpoint_default')}: 0)</small> <small className="opacity-40">
({localize('com_endpoint_default_with_num', { 0: '0' })})
</small>
</Label> </Label>
<InputNumber <InputNumber
id="temp-int" id="temp-int"
@ -82,6 +84,7 @@ export default function Settings({ conversation, setOption, models, readonly }:
min={0} min={0}
step={0.01} step={0.01}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="temp-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="temp" side={ESide.Left} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="temp" side={ESide.Left} />
@ -101,6 +104,7 @@ export default function Settings({ conversation, setOption, models, readonly }:
onCheckedChange={onCheckedChangeAgent} onCheckedChange={onCheckedChangeAgent}
disabled={readonly} disabled={readonly}
className="ml-4 mt-2" className="ml-4 mt-2"
aria-label={localize('com_endpoint_plug_use_functions')}
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="func" side={ESide.Bottom} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="func" side={ESide.Bottom} />
@ -119,6 +123,7 @@ export default function Settings({ conversation, setOption, models, readonly }:
onCheckedChange={onCheckedChangeSkip} onCheckedChange={onCheckedChangeSkip}
disabled={readonly} disabled={readonly}
className="ml-4 mt-2" className="ml-4 mt-2"
aria-label={localize('com_endpoint_plug_skip_completion')}
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="skip" side={ESide.Bottom} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="skip" side={ESide.Bottom} />

View file

@ -171,6 +171,7 @@ export default function Settings({ conversation, setOption, models, readonly }:
min={google.temperature.min} min={google.temperature.min}
step={google.temperature.step} step={google.temperature.step}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="temp-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="temp" side={ESide.Left} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="temp" side={ESide.Left} />
@ -211,6 +212,7 @@ export default function Settings({ conversation, setOption, models, readonly }:
min={google.topP.min} min={google.topP.min}
step={google.topP.step} step={google.topP.step}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="top-p-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="topp" side={ESide.Left} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="topp" side={ESide.Left} />
@ -252,6 +254,7 @@ export default function Settings({ conversation, setOption, models, readonly }:
min={google.topK.min} min={google.topK.min}
step={google.topK.step} step={google.topK.step}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="top-k-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="topk" side={ESide.Left} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="topk" side={ESide.Left} />
@ -296,6 +299,7 @@ export default function Settings({ conversation, setOption, models, readonly }:
min={google.maxOutputTokens.min} min={google.maxOutputTokens.min}
step={google.maxOutputTokens.step} step={google.maxOutputTokens.step}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="max-tokens-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover <OptionHover

View file

@ -256,6 +256,7 @@ export default function Settings({
min={0} min={0}
step={0.01} step={0.01}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="temp-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="temp" side={ESide.Left} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="temp" side={ESide.Left} />
@ -296,6 +297,7 @@ export default function Settings({
min={0} min={0}
step={0.01} step={0.01}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="top-p-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="topp" side={ESide.Left} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="topp" side={ESide.Left} />
@ -337,6 +339,7 @@ export default function Settings({
min={-2} min={-2}
step={0.01} step={0.01}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="freq-penalty-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="freq" side={ESide.Left} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="freq" side={ESide.Left} />
@ -378,6 +381,7 @@ export default function Settings({
min={-2} min={-2}
step={0.01} step={0.01}
className="flex h-4 w-full" className="flex h-4 w-full"
aria-labelledby="pres-penalty-int"
/> />
</HoverCardTrigger> </HoverCardTrigger>
<OptionHover endpoint={conversation.endpoint ?? ''} type="pres" side={ESide.Left} /> <OptionHover endpoint={conversation.endpoint ?? ''} type="pres" side={ESide.Left} />

View file

@ -124,13 +124,15 @@ export default function ExportModal({
disabled={!exportOptionsSupport} disabled={!exportOptionsSupport}
checked={includeOptions} checked={includeOptions}
onCheckedChange={setIncludeOptions} onCheckedChange={setIncludeOptions}
aria-labelledby="includeOptions-label"
/> />
<label <label
id="includeOptions-label"
htmlFor="includeOptions" htmlFor="includeOptions"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-gray-50" className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-gray-50"
> >
{exportOptionsSupport {exportOptionsSupport
? localize('com_nav_enabled') ? localize('com_nav_export_include_endpoint_options')
: localize('com_nav_not_supported')} : localize('com_nav_not_supported')}
</label> </label>
</div> </div>
@ -146,13 +148,15 @@ export default function ExportModal({
disabled={!exportBranchesSupport} disabled={!exportBranchesSupport}
checked={exportBranches} checked={exportBranches}
onCheckedChange={setExportBranches} onCheckedChange={setExportBranches}
aria-labelledby="exportBranches-label"
/> />
<label <label
id="exportBranches-label"
htmlFor="exportBranches" htmlFor="exportBranches"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-gray-50" className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-gray-50"
> >
{exportBranchesSupport {exportBranchesSupport
? localize('com_nav_enabled') ? localize('com_nav_export_all_message_branches')
: localize('com_nav_not_supported')} : localize('com_nav_not_supported')}
</label> </label>
</div> </div>
@ -163,8 +167,14 @@ export default function ExportModal({
{localize('com_nav_export_recursive_or_sequential')} {localize('com_nav_export_recursive_or_sequential')}
</Label> </Label>
<div className="flex h-[40px] w-full items-center space-x-3"> <div className="flex h-[40px] w-full items-center space-x-3">
<Checkbox id="recursive" checked={recursive} onCheckedChange={setRecursive} /> <Checkbox
id="recursive"
checked={recursive}
onCheckedChange={setRecursive}
aria-labelledby="recursive-label"
/>
<label <label
id="recursive-label"
htmlFor="recursive" htmlFor="recursive"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-gray-50" className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-gray-50"
> >

View file

@ -30,6 +30,7 @@ export default function SaveBadgesState({
onCheckedChange={handleCheckedChange} onCheckedChange={handleCheckedChange}
className="ml-4" className="ml-4"
data-testid="saveBadgesState" data-testid="saveBadgesState"
aria-label={localize('com_nav_save_badges_state')}
/> />
</div> </div>
); );

View file

@ -30,6 +30,7 @@ export default function SaveDraft({
onCheckedChange={handleCheckedChange} onCheckedChange={handleCheckedChange}
className="ml-4" className="ml-4"
data-testid="showThinking" data-testid="showThinking"
aria-label={localize('com_nav_show_thinking')}
/> />
</div> </div>
); );

View file

@ -13,7 +13,6 @@ import {
useMediaQuery, useMediaQuery,
OGDialogHeader, OGDialogHeader,
OGDialogTitle, OGDialogTitle,
TooltipAnchor,
DataTable, DataTable,
Spinner, Spinner,
Button, Button,
@ -246,24 +245,16 @@ export default function SharedLinks() {
}, },
cell: ({ row }) => ( cell: ({ row }) => (
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<TooltipAnchor
description={localize('com_ui_view_source')}
render={
<Button <Button
variant="ghost" variant="ghost"
className="h-8 w-8 p-0 hover:bg-surface-hover" className="h-8 w-8 p-0 hover:bg-surface-hover"
onClick={() => { onClick={() => {
window.open(`/c/${row.original.conversationId}`, '_blank'); window.open(`/c/${row.original.conversationId}`, '_blank');
}} }}
title={localize('com_ui_view_source')} aria-label={`${localize('com_ui_view_source')} - ${row.original.title || localize('com_ui_untitled')}`}
> >
<MessageSquare className="size-4" /> <MessageSquare className="size-4" aria-hidden="true" />
</Button> </Button>
}
/>
<TooltipAnchor
description={localize('com_ui_delete')}
render={
<Button <Button
variant="ghost" variant="ghost"
className="h-8 w-8 p-0 hover:bg-surface-hover" className="h-8 w-8 p-0 hover:bg-surface-hover"
@ -271,12 +262,10 @@ export default function SharedLinks() {
setDeleteRow(row.original); setDeleteRow(row.original);
setIsDeleteOpen(true); setIsDeleteOpen(true);
}} }}
title={localize('com_ui_delete')} aria-label={`${localize('com_ui_delete')} - ${row.original.title || localize('com_ui_untitled')}`}
> >
<TrashIcon className="size-4" /> <TrashIcon className="size-4" aria-hidden="true" />
</Button> </Button>
}
/>
</div> </div>
), ),
}, },

View file

@ -53,6 +53,7 @@ const LabelController: React.FC<LabelControllerProps> = ({
} }
}} }}
value={field.value.toString()} value={field.value.toString()}
aria-label={label}
/> />
)} )}
/> />
@ -216,7 +217,12 @@ const AdminSettings = () => {
))} ))}
</div> </div>
<div className="flex justify-end"> <div className="flex justify-end">
<Button type="submit" disabled={isSubmitting || isLoading} variant="submit"> <Button
type="submit"
disabled={isSubmitting || isLoading}
variant="submit"
aria-label={localize('com_ui_save')}
>
{localize('com_ui_save')} {localize('com_ui_save')}
</Button> </Button>
</div> </div>

View file

@ -28,7 +28,7 @@ export default function AlwaysMakeProd({
checked={alwaysMakeProd} checked={alwaysMakeProd}
onCheckedChange={handleCheckedChange} onCheckedChange={handleCheckedChange}
data-testid="alwaysMakeProd" data-testid="alwaysMakeProd"
aria-label="Always make prompt production" aria-label={localize('com_nav_always_make_prod')}
/> />
<div>{localize('com_nav_always_make_prod')} </div> <div>{localize('com_nav_always_make_prod')} </div>
</div> </div>

View file

@ -30,7 +30,7 @@ export default function AutoSendPrompt({
> >
<div> {localize('com_nav_auto_send_prompts')} </div> <div> {localize('com_nav_auto_send_prompts')} </div>
<Switch <Switch
aria-label="toggle-auto-send-prompts" aria-label={localize('com_nav_auto_send_prompts')}
id="autoSendPrompts" id="autoSendPrompts"
checked={autoSendPrompts} checked={autoSendPrompts}
onCheckedChange={handleCheckedChange} onCheckedChange={handleCheckedChange}

View file

@ -102,6 +102,9 @@ function ChatGroupItem({
e.stopPropagation(); e.stopPropagation();
setPreviewDialogOpen(true); setPreviewDialogOpen(true);
}} }}
onKeyDown={(e) => {
e.stopPropagation();
}}
className="w-full cursor-pointer rounded-lg text-text-primary hover:bg-surface-hover focus:bg-surface-hover disabled:cursor-not-allowed" className="w-full cursor-pointer rounded-lg text-text-primary hover:bg-surface-hover focus:bg-surface-hover disabled:cursor-not-allowed"
> >
<TextSearch className="mr-2 h-4 w-4 text-text-primary" aria-hidden="true" /> <TextSearch className="mr-2 h-4 w-4 text-text-primary" aria-hidden="true" />
@ -116,6 +119,9 @@ function ChatGroupItem({
e.stopPropagation(); e.stopPropagation();
onEditClick(e); onEditClick(e);
}} }}
onKeyDown={(e) => {
e.stopPropagation();
}}
> >
<EditIcon className="mr-2 h-4 w-4 text-text-primary" aria-hidden="true" /> <EditIcon className="mr-2 h-4 w-4 text-text-primary" aria-hidden="true" />
<span>{localize('com_ui_edit')}</span> <span>{localize('com_ui_edit')}</span>

View file

@ -151,6 +151,7 @@ const CreatePromptForm = ({
className="w-full rounded border border-border-medium px-2 py-1 focus:outline-none dark:bg-transparent dark:text-gray-200" className="w-full rounded border border-border-medium px-2 py-1 focus:outline-none dark:bg-transparent dark:text-gray-200"
minRows={6} minRows={6}
tabIndex={0} tabIndex={0}
aria-label={localize('com_ui_prompt_input_field')}
/> />
<div <div
className={`mt-1 text-sm text-red-500 ${ className={`mt-1 text-sm text-red-500 ${

View file

@ -34,6 +34,7 @@ export default function List({
variant="outline" variant="outline"
className={`w-full bg-transparent ${isChatRoute ? '' : 'mx-2'}`} className={`w-full bg-transparent ${isChatRoute ? '' : 'mx-2'}`}
onClick={() => navigate('/d/prompts/new')} onClick={() => navigate('/d/prompts/new')}
aria-label={localize('com_ui_create_prompt')}
> >
<Plus className="size-4" aria-hidden /> <Plus className="size-4" aria-hidden />
{localize('com_ui_create_prompt')} {localize('com_ui_create_prompt')}

View file

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import { Label } from '@librechat/client'; import { Label } from '@librechat/client';
import CategoryIcon from '~/components/Prompts/Groups/CategoryIcon'; import CategoryIcon from '~/components/Prompts/Groups/CategoryIcon';
import { useLocalize } from '~/hooks';
export default function ListCard({ export default function ListCard({
category, category,
@ -15,6 +16,7 @@ export default function ListCard({
onClick?: React.MouseEventHandler<HTMLDivElement | HTMLButtonElement>; onClick?: React.MouseEventHandler<HTMLDivElement | HTMLButtonElement>;
children?: React.ReactNode; children?: React.ReactNode;
}) { }) {
const localize = useLocalize();
const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement | HTMLButtonElement>) => { const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement | HTMLButtonElement>) => {
if (event.key === 'Enter' || event.key === ' ') { if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault(); event.preventDefault();
@ -31,7 +33,7 @@ export default function ListCard({
tabIndex={0} tabIndex={0}
aria-labelledby={`card-title-${name}`} aria-labelledby={`card-title-${name}`}
aria-describedby={`card-snippet-${name}`} aria-describedby={`card-snippet-${name}`}
aria-label={`Card for ${name}`} aria-label={`${name} Prompt, ${category ? `${localize('com_ui_category')}: ${category}` : ''}`}
> >
<div className="flex w-full justify-between gap-2"> <div className="flex w-full justify-between gap-2">
<div className="flex flex-row gap-2"> <div className="flex flex-row gap-2">

View file

@ -17,6 +17,7 @@ export default function NoPromptGroup() {
onClick={() => { onClick={() => {
navigate('/d/prompts'); navigate('/d/prompts');
}} }}
aria-label={localize('com_ui_back_to_prompts')}
> >
{localize('com_ui_back_to_prompts')} {localize('com_ui_back_to_prompts')}
</Button> </Button>

View file

@ -193,6 +193,7 @@ export default function VariableForm({
)} )}
placeholder={field.config.variable} placeholder={field.config.variable}
maxRows={8} maxRows={8}
aria-label={field.config.variable}
/> />
); );
}} }}
@ -201,7 +202,7 @@ export default function VariableForm({
))} ))}
</div> </div>
<div className="flex justify-end"> <div className="flex justify-end">
<Button type="submit" variant="submit"> <Button type="submit" variant="submit" aria-label={localize('com_ui_submit')}>
{localize('com_ui_submit')} {localize('com_ui_submit')}
</Button> </Button>
</div> </div>

View file

@ -118,6 +118,7 @@ const PromptEditor: React.FC<Props> = ({ name, isEditing, setIsEditing }) => {
setIsEditing(false); setIsEditing(false);
} }
}} }}
aria-label={localize('com_ui_prompt_input')}
/> />
) : ( ) : (
<div <div

View file

@ -370,7 +370,11 @@ export default function GenericGrantAccessDialog({
<div className="flex gap-2"> <div className="flex gap-2">
<PeoplePickerAdminSettings /> <PeoplePickerAdminSettings />
<OGDialogClose asChild> <OGDialogClose asChild>
<Button variant="outline" onClick={handleCancel}> <Button
variant="outline"
onClick={handleCancel}
aria-label={localize('com_ui_cancel')}
>
{localize('com_ui_cancel')} {localize('com_ui_cancel')}
</Button> </Button>
</OGDialogClose> </OGDialogClose>
@ -382,6 +386,7 @@ export default function GenericGrantAccessDialog({
(hasChanges && !hasAtLeastOneOwner) (hasChanges && !hasAtLeastOneOwner)
} }
className="min-w-[120px]" className="min-w-[120px]"
aria-label={localize('com_ui_save_changes')}
> >
{updatePermissionsMutation.isLoading ? ( {updatePermissionsMutation.isLoading ? (
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">

View file

@ -60,6 +60,7 @@ const LabelController: React.FC<LabelControllerProps> = ({
checked={field.value} checked={field.value}
onCheckedChange={field.onChange} onCheckedChange={field.onChange}
value={field.value.toString()} value={field.value.toString()}
aria-label={label}
/> />
)} )}
/> />
@ -158,6 +159,7 @@ const PeoplePickerAdminSettings = () => {
<Button <Button
variant={'outline'} variant={'outline'}
className="btn btn-neutral border-token-border-light relative gap-1 rounded-lg font-medium" className="btn btn-neutral border-token-border-light relative gap-1 rounded-lg font-medium"
aria-label={localize('com_ui_admin_settings')}
> >
<ShieldEllipsis className="cursor-pointer" aria-hidden="true" /> <ShieldEllipsis className="cursor-pointer" aria-hidden="true" />
{localize('com_ui_admin_settings')} {localize('com_ui_admin_settings')}

View file

@ -56,6 +56,7 @@ const LabelController: React.FC<LabelControllerProps> = ({
checked={field.value} checked={field.value}
onCheckedChange={field.onChange} onCheckedChange={field.onChange}
value={field.value.toString()} value={field.value.toString()}
aria-label={label}
/> />
)} )}
/> />
@ -152,6 +153,7 @@ const AdminSettings = () => {
size={'sm'} size={'sm'}
variant={'outline'} variant={'outline'}
className="btn btn-neutral border-token-border-light relative h-9 w-full gap-1 rounded-lg font-medium" className="btn btn-neutral border-token-border-light relative h-9 w-full gap-1 rounded-lg font-medium"
aria-label={localize('com_ui_admin_settings')}
> >
<ShieldEllipsis className="cursor-pointer" aria-hidden="true" /> <ShieldEllipsis className="cursor-pointer" aria-hidden="true" />
{localize('com_ui_admin_settings')} {localize('com_ui_admin_settings')}

View file

@ -17,6 +17,7 @@ const AdvancedButton: React.FC<AdvancedButtonProps> = ({ setActivePanel }) => {
variant={'outline'} variant={'outline'}
className="btn btn-neutral border-token-border-light relative h-9 w-full gap-1 rounded-lg font-medium" className="btn btn-neutral border-token-border-light relative h-9 w-full gap-1 rounded-lg font-medium"
onClick={() => setActivePanel(Panel.advanced)} onClick={() => setActivePanel(Panel.advanced)}
aria-label={localize('com_ui_advanced')}
> >
<Settings2 className="h-4 w-4 cursor-pointer" aria-hidden="true" /> <Settings2 className="h-4 w-4 cursor-pointer" aria-hidden="true" />
{localize('com_ui_advanced')} {localize('com_ui_advanced')}

View file

@ -31,6 +31,7 @@ export default function AdvancedPanel() {
onClick={() => { onClick={() => {
setActivePanel(Panel.builder); setActivePanel(Panel.builder);
}} }}
aria-label={localize('com_ui_back_to_builder')}
> >
<div className="advanced-panel-content flex w-full items-center justify-center gap-2"> <div className="advanced-panel-content flex w-full items-center justify-center gap-2">
<ChevronLeft /> <ChevronLeft />

View file

@ -146,6 +146,9 @@ const AgentChain: React.FC<AgentChainProps> = ({ field, currentAgentId }) => {
<button <button
className="rounded-xl p-1 transition hover:bg-surface-hover" className="rounded-xl p-1 transition hover:bg-surface-hover"
onClick={() => removeAgentAt(idx)} onClick={() => removeAgentAt(idx)}
aria-label={localize('com_ui_remove_agent_from_chain', {
0: getAgentDetails(agentId)?.name || localize('com_ui_agent'),
})}
> >
<X size={18} className="text-text-secondary" /> <X size={18} className="text-text-secondary" />
</button> </button>

View file

@ -186,7 +186,11 @@ function Avatar({
<Popover.Root open={menuOpen} onOpenChange={setMenuOpen}> <Popover.Root open={menuOpen} onOpenChange={setMenuOpen}>
<div className="flex w-full items-center justify-center gap-4"> <div className="flex w-full items-center justify-center gap-4">
<Popover.Trigger asChild> <Popover.Trigger asChild>
<button type="button" className="h-20 w-20"> <button
type="button"
className="f h-20 w-20 focus:rounded-full focus:ring-2 focus:ring-ring"
aria-label={localize('com_ui_upload_agent_avatar_label')}
>
{previewUrl ? <AgentAvatarRender url={previewUrl} progress={progress} /> : <NoImage />} {previewUrl ? <AgentAvatarRender url={previewUrl} progress={progress} /> : <NoImage />}
</button> </button>
</Popover.Trigger> </Popover.Trigger>

View file

@ -420,9 +420,16 @@ export default function AgentConfig({ createMutation }: Pick<AgentPanelProps, 'c
type="text" type="text"
placeholder={localize('com_ui_support_contact_name_placeholder')} placeholder={localize('com_ui_support_contact_name_placeholder')}
aria-label="Support contact name" aria-label="Support contact name"
aria-invalid={error ? 'true' : 'false'}
aria-describedby={error ? 'support-contact-name-error' : undefined}
/> />
{error && ( {error && (
<span className="text-sm text-red-500 transition duration-300 ease-in-out"> <span
id="support-contact-name-error"
className="text-sm text-red-500 transition duration-300 ease-in-out"
role="alert"
aria-live="polite"
>
{error.message} {error.message}
</span> </span>
)} )}
@ -455,9 +462,16 @@ export default function AgentConfig({ createMutation }: Pick<AgentPanelProps, 'c
type="email" type="email"
placeholder={localize('com_ui_support_contact_email_placeholder')} placeholder={localize('com_ui_support_contact_email_placeholder')}
aria-label="Support contact email" aria-label="Support contact email"
aria-invalid={error ? 'true' : 'false'}
aria-describedby={error ? 'support-contact-email-error' : undefined}
/> />
{error && ( {error && (
<span className="text-sm text-red-500 transition duration-300 ease-in-out"> <span
id="support-contact-email-error"
className="text-sm text-red-500 transition duration-300 ease-in-out"
role="alert"
aria-live="polite"
>
{error.message} {error.message}
</span> </span>
)} )}

View file

@ -283,6 +283,13 @@ export default function AgentPanel() {
setCurrentAgentId(undefined); setCurrentAgentId(undefined);
}} }}
disabled={agentQuery.isInitialLoading} disabled={agentQuery.isInitialLoading}
aria-label={
localize('com_ui_create') +
' ' +
localize('com_ui_new') +
' ' +
localize('com_ui_agent')
}
> >
<Plus className="mr-1 h-4 w-4" /> <Plus className="mr-1 h-4 w-4" />
{localize('com_ui_create') + {localize('com_ui_create') +

View file

@ -117,6 +117,7 @@ function SwitchItem({
className="ml-4" className="ml-4"
data-testid={id} data-testid={id}
disabled={disabled} disabled={disabled}
aria-label={label}
/> />
</div> </div>
</HoverCard> </HoverCard>

View file

@ -61,6 +61,7 @@ export default function Action({ authType = '', isToolAuthenticated = false }) {
className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer" className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer"
value={field.value.toString()} value={field.value.toString()}
disabled={runCodeIsEnabled ? false : !isToolAuthenticated} disabled={runCodeIsEnabled ? false : !isToolAuthenticated}
aria-label={localize('com_ui_run_code')}
/> />
)} )}
/> />
@ -81,7 +82,11 @@ export default function Action({ authType = '', isToolAuthenticated = false }) {
</button> </button>
<div className="ml-2 flex gap-2"> <div className="ml-2 flex gap-2">
{isUserProvided && (isToolAuthenticated || runCodeIsEnabled) && ( {isUserProvided && (isToolAuthenticated || runCodeIsEnabled) && (
<button type="button" onClick={() => setIsDialogOpen(true)}> <button
type="button"
onClick={() => setIsDialogOpen(true)}
aria-label={localize('com_ui_add_api_key')}
>
<KeyRoundIcon className="h-5 w-5 text-text-primary" /> <KeyRoundIcon className="h-5 w-5 text-text-primary" />
</button> </button>
)} )}

View file

@ -104,6 +104,7 @@ export default function ApiKeyDialog({
<Button <Button
onClick={onRevoke} onClick={onRevoke}
className="bg-destructive text-white transition-all duration-200 hover:bg-destructive/80" className="bg-destructive text-white transition-all duration-200 hover:bg-destructive/80"
aria-label={localize('com_ui_revoke')}
> >
{localize('com_ui_revoke')} {localize('com_ui_revoke')}
</Button> </Button>

View file

@ -32,6 +32,7 @@ function FileSearchCheckbox() {
onCheckedChange={field.onChange} onCheckedChange={field.onChange}
className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer" className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer"
value={field.value.toString()} value={field.value.toString()}
aria-label={localize('com_agents_enable_file_search')}
/> />
)} )}
/> />

View file

@ -104,15 +104,16 @@ export function AvatarMenu({
className="flex min-w-[100px] max-w-xs flex-col rounded-xl border border-gray-400 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-850 dark:text-white" className="flex min-w-[100px] max-w-xs flex-col rounded-xl border border-gray-400 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-850 dark:text-white"
sideOffset={5} sideOffset={5}
> >
<div <button
type="button"
role="menuitem" role="menuitem"
className="group m-1.5 flex cursor-pointer gap-2 rounded-lg p-2.5 text-sm hover:bg-gray-100 focus:ring-0 radix-disabled:pointer-events-none radix-disabled:opacity-50 dark:hover:bg-gray-800 dark:hover:bg-white/5" className="group m-1.5 flex cursor-pointer gap-2 rounded-lg p-2.5 text-sm hover:bg-gray-100 focus:ring-0 radix-disabled:pointer-events-none radix-disabled:opacity-50 dark:hover:bg-gray-800 dark:hover:bg-white/5"
tabIndex={-1} tabIndex={0}
data-orientation="vertical" data-orientation="vertical"
onClick={onItemClick} onClick={onItemClick}
> >
{localize('com_ui_upload_image')} {localize('com_ui_upload_image')}
</div> </button>
{/* <Popover.Close {/* <Popover.Close
role="menuitem" role="menuitem"
className="group m-1.5 flex cursor-pointer gap-2 rounded p-2.5 text-sm hover:bg-black/5 focus:ring-0 radix-disabled:pointer-events-none radix-disabled:opacity-50 dark:hover:bg-white/5" className="group m-1.5 flex cursor-pointer gap-2 rounded p-2.5 text-sm hover:bg-black/5 focus:ring-0 radix-disabled:pointer-events-none radix-disabled:opacity-50 dark:hover:bg-white/5"

View file

@ -210,10 +210,15 @@ export default function MCPInput({ mcp, agent_id, setMCP }: MCPInputProps) {
control={control} control={control}
rules={{ required: true }} rules={{ required: true }}
render={({ field }) => ( render={({ field }) => (
<Checkbox id="trust" checked={field.value} onCheckedChange={field.onChange} /> <Checkbox
id="trust-checkbox"
checked={field.value}
onCheckedChange={field.onChange}
aria-labelledby="trust-label"
/>
)} )}
/> />
<Label htmlFor="trust" className="flex flex-col"> <Label id="trust-label" htmlFor="trust-checkbox" className="flex flex-col">
{localize('com_ui_trust_app')} {localize('com_ui_trust_app')}
<span className="text-xs text-text-secondary"> <span className="text-xs text-text-secondary">
{localize('com_agents_mcp_trust_subtext')} {localize('com_agents_mcp_trust_subtext')}
@ -269,6 +274,10 @@ export default function MCPInput({ mcp, agent_id, setMCP }: MCPInputProps) {
checked={selectedTools.includes(tool)} checked={selectedTools.includes(tool)}
onCheckedChange={() => handleToolToggle(tool)} onCheckedChange={() => handleToolToggle(tool)}
className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer" className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer"
aria-label={tool
.split('_')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ')}
/> />
<span className="text-token-text-primary"> <span className="text-token-text-primary">
{tool {tool

View file

@ -162,6 +162,12 @@ export default function MCPTool({ serverInfo }: { serverInfo?: MCPServerInfo })
} }
}} }}
tabIndex={isExpanded ? 0 : -1} tabIndex={isExpanded ? 0 : -1}
aria-label={
selectedTools.length === serverInfo.tools?.length &&
selectedTools.length > 0
? localize('com_ui_deselect_all')
: localize('com_ui_select_all')
}
/> />
</div> </div>
@ -252,6 +258,7 @@ export default function MCPTool({ serverInfo }: { serverInfo?: MCPServerInfo })
className={cn( className={cn(
'relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer rounded border border-border-medium transition-[border-color] duration-200 hover:border-border-heavy focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background', 'relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer rounded border border-border-medium transition-[border-color] duration-200 hover:border-border-heavy focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background',
)} )}
aria-label={subTool.metadata.name}
/> />
<span className="text-token-text-primary select-none"> <span className="text-token-text-primary select-none">
{subTool.metadata.name} {subTool.metadata.name}

View file

@ -102,6 +102,7 @@ export default function ModelPanel({
onClick={() => { onClick={() => {
setActivePanel(Panel.builder); setActivePanel(Panel.builder);
}} }}
aria-label={localize('com_ui_back_to_builder')}
> >
<div className="model-panel-content flex w-full items-center justify-center gap-2"> <div className="model-panel-content flex w-full items-center justify-center gap-2">
<ChevronLeft /> <ChevronLeft />

View file

@ -69,6 +69,7 @@ export default function Action({
className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer" className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer"
value={field.value.toString()} value={field.value.toString()}
disabled={webSearchIsEnabled ? false : !isToolAuthenticated} disabled={webSearchIsEnabled ? false : !isToolAuthenticated}
aria-label={localize('com_ui_web_search')}
/> />
)} )}
/> />

View file

@ -250,7 +250,11 @@ export default function ApiKeyDialog({
}} }}
buttons={ buttons={
isToolAuthenticated && ( isToolAuthenticated && (
<Button onClick={onRevoke} className="bg-red-500 text-white hover:bg-red-600"> <Button
onClick={onRevoke}
className="bg-red-500 text-white hover:bg-red-600"
aria-label={localize('com_ui_revoke')}
>
{localize('com_ui_revoke')} {localize('com_ui_revoke')}
</Button> </Button>
) )

View file

@ -16,6 +16,7 @@ const VersionButton = ({ setActivePanel }: VersionButtonProps) => {
variant={'outline'} variant={'outline'}
className="btn btn-neutral border-token-border-light relative h-9 w-full gap-1 rounded-lg font-medium" className="btn btn-neutral border-token-border-light relative h-9 w-full gap-1 rounded-lg font-medium"
onClick={() => setActivePanel(Panel.version)} onClick={() => setActivePanel(Panel.version)}
aria-label={localize('com_ui_agent_version')}
> >
<History className="h-4 w-4 cursor-pointer" aria-hidden="true" /> <History className="h-4 w-4 cursor-pointer" aria-hidden="true" />
{localize('com_ui_agent_version')} {localize('com_ui_agent_version')}

View file

@ -112,6 +112,7 @@ const BookmarkTable = () => {
variant="outline" variant="outline"
size="sm" size="sm"
className="w-full gap-2 text-sm" className="w-full gap-2 text-sm"
aria-label={localize('com_ui_bookmarks_new')}
onClick={() => setOpen(!open)} onClick={() => setOpen(!open)}
> >
<BookmarkPlusIcon className="size-4" /> <BookmarkPlusIcon className="size-4" />

View file

@ -213,7 +213,11 @@ function Avatar({
<Popover.Root open={menuOpen} onOpenChange={setMenuOpen}> <Popover.Root open={menuOpen} onOpenChange={setMenuOpen}>
<div className="flex w-full items-center justify-center gap-4"> <div className="flex w-full items-center justify-center gap-4">
<Popover.Trigger asChild> <Popover.Trigger asChild>
<button type="button" className="h-20 w-20"> <button
type="button"
className="h-20 w-20"
aria-label={localize('com_ui_upload_avatar_label')}
>
{previewUrl ? <AssistantAvatar url={previewUrl} progress={progress} /> : <NoImage />} {previewUrl ? <AssistantAvatar url={previewUrl} progress={progress} /> : <NoImage />}
</button> </button>
</Popover.Trigger> </Popover.Trigger>

View file

@ -31,6 +31,7 @@ export default function Code({ version }: { version: number | string }) {
onCheckedChange={field.onChange} onCheckedChange={field.onChange}
className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer" className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer"
value={field.value.toString()} value={field.value.toString()}
aria-labelledby={Capabilities.code_interpreter}
/> />
)} )}
/> />
@ -44,6 +45,7 @@ export default function Code({ version }: { version: number | string }) {
} }
> >
<label <label
id={Capabilities.code_interpreter}
className="form-check-label text-token-text-primary w-full cursor-pointer" className="form-check-label text-token-text-primary w-full cursor-pointer"
htmlFor={Capabilities.code_interpreter} htmlFor={Capabilities.code_interpreter}
> >

View file

@ -21,10 +21,12 @@ export default function ImageVision() {
onCheckedChange={field.onChange} onCheckedChange={field.onChange}
className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer" className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer"
value={field.value.toString()} value={field.value.toString()}
aria-labelledby={Capabilities.image_vision}
/> />
)} )}
/> />
<label <label
id={Capabilities.image_vision}
className="form-check-label text-token-text-primary w-full cursor-pointer" className="form-check-label text-token-text-primary w-full cursor-pointer"
htmlFor={Capabilities.image_vision} htmlFor={Capabilities.image_vision}
onClick={() => onClick={() =>

View file

@ -60,11 +60,13 @@ export default function Retrieval({
onCheckedChange={field.onChange} onCheckedChange={field.onChange}
className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer" className="relative float-left mr-2 inline-flex h-4 w-4 cursor-pointer"
value={field.value.toString()} value={field.value.toString()}
aria-labelledby={Capabilities.retrieval}
/> />
)} )}
/> />
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
<label <label
id={Capabilities.retrieval}
className={cn( className={cn(
'form-check-label text-token-text-primary w-full select-none', 'form-check-label text-token-text-primary w-full select-none',
isDisabled ? 'cursor-no-drop opacity-50' : 'cursor-pointer', isDisabled ? 'cursor-no-drop opacity-50' : 'cursor-pointer',

View file

@ -17,6 +17,7 @@ export const columns: ColumnDef<TFile | undefined>[] = [
variant="ghost" variant="ghost"
className="hover:bg-surface-hover" className="hover:bg-surface-hover"
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')} onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
aria-label={localize('com_ui_name')}
> >
{localize('com_ui_name')} {localize('com_ui_name')}
<ArrowUpDown className="ml-2 h-4 w-4" /> <ArrowUpDown className="ml-2 h-4 w-4" />
@ -40,6 +41,7 @@ export const columns: ColumnDef<TFile | undefined>[] = [
variant="ghost" variant="ghost"
className="hover:bg-surface-hover" className="hover:bg-surface-hover"
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')} onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
aria-label={localize('com_ui_date')}
> >
{localize('com_ui_date')} {localize('com_ui_date')}
<ArrowUpDown className="ml-2 h-4 w-4" /> <ArrowUpDown className="ml-2 h-4 w-4" />

View file

@ -127,7 +127,12 @@ function MCPPanelContent() {
return ( return (
<div className="h-auto max-w-full space-y-4 overflow-x-hidden py-2"> <div className="h-auto max-w-full space-y-4 overflow-x-hidden py-2">
<Button variant="outline" onClick={handleGoBackToList} size="sm"> <Button
variant="outline"
onClick={handleGoBackToList}
size="sm"
aria-label={localize('com_ui_back')}
>
<ChevronLeft className="mr-1 h-4 w-4" /> <ChevronLeft className="mr-1 h-4 w-4" />
{localize('com_ui_back')} {localize('com_ui_back')}
</Button> </Button>
@ -166,6 +171,7 @@ function MCPPanelContent() {
size="sm" size="sm"
variant="destructive" variant="destructive"
onClick={() => handleConfigRevoke(selectedServerNameForEditing)} onClick={() => handleConfigRevoke(selectedServerNameForEditing)}
aria-label={localize('com_ui_oauth_revoke')}
> >
<Trash2 className="h-4 w-4" /> <Trash2 className="h-4 w-4" />
{localize('com_ui_oauth_revoke')} {localize('com_ui_oauth_revoke')}
@ -188,6 +194,7 @@ function MCPPanelContent() {
variant="outline" variant="outline"
className="flex-1 justify-start dark:hover:bg-gray-700" className="flex-1 justify-start dark:hover:bg-gray-700"
onClick={() => handleServerClickToEdit(server.serverName)} onClick={() => handleServerClickToEdit(server.serverName)}
aria-label={localize('com_ui_edit') + ' ' + server.serverName}
> >
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<span>{server.serverName}</span> <span>{server.serverName}</span>

View file

@ -39,6 +39,7 @@ const LabelController: React.FC<LabelControllerProps> = ({ control, memoryPerm,
checked={field.value} checked={field.value}
onCheckedChange={field.onChange} onCheckedChange={field.onChange}
value={field.value.toString()} value={field.value.toString()}
aria-label={label}
/> />
)} )}
/> />
@ -141,6 +142,7 @@ const AdminSettings = () => {
size={'sm'} size={'sm'}
variant={'outline'} variant={'outline'}
className="btn btn-neutral border-token-border-light relative h-9 w-full gap-1 rounded-lg font-medium" className="btn btn-neutral border-token-border-light relative h-9 w-full gap-1 rounded-lg font-medium"
aria-label={localize('com_ui_admin_settings')}
> >
<ShieldEllipsis className="cursor-pointer" aria-hidden="true" /> <ShieldEllipsis className="cursor-pointer" aria-hidden="true" />
{localize('com_ui_admin_settings')} {localize('com_ui_admin_settings')}

View file

@ -147,6 +147,7 @@ export default function MemoryCreateDialog({
onClick={handleSave} onClick={handleSave}
disabled={isLoading || !key.trim() || !value.trim()} disabled={isLoading || !key.trim() || !value.trim()}
className="text-white" className="text-white"
aria-label={localize('com_ui_create_memory')}
> >
{isLoading ? <Spinner className="size-4" /> : localize('com_ui_create')} {isLoading ? <Spinner className="size-4" /> : localize('com_ui_create')}
</Button> </Button>

View file

@ -192,6 +192,7 @@ export default function MemoryEditDialog({
type="button" type="button"
variant="submit" variant="submit"
onClick={handleSave} onClick={handleSave}
aria-label={localize('com_ui_save')}
disabled={isLoading || !key.trim() || !value.trim()} disabled={isLoading || !key.trim() || !value.trim()}
className="text-white" className="text-white"
> >

View file

@ -305,7 +305,11 @@ export default function MemoryViewer() {
<div className="flex w-full justify-end"> <div className="flex w-full justify-end">
<MemoryCreateDialog open={createDialogOpen} onOpenChange={setCreateDialogOpen}> <MemoryCreateDialog open={createDialogOpen} onOpenChange={setCreateDialogOpen}>
<OGDialogTrigger asChild> <OGDialogTrigger asChild>
<Button variant="outline" className="w-full bg-transparent"> <Button
variant="outline"
className="w-full bg-transparent"
aria-label={localize('com_ui_create_memory')}
>
<Plus className="size-4" aria-hidden /> <Plus className="size-4" aria-hidden />
{localize('com_ui_create_memory')} {localize('com_ui_create_memory')}
</Button> </Button>

View file

@ -76,6 +76,7 @@ function DynamicCheckbox({
checked={selectedValue} checked={selectedValue}
onCheckedChange={handleCheckedChange} onCheckedChange={handleCheckedChange}
className="mt-[2px] focus:ring-opacity-20 dark:border-gray-500 dark:bg-gray-700 dark:text-gray-50 dark:focus:ring-gray-600 dark:focus:ring-opacity-50 dark:focus:ring-offset-0" className="mt-[2px] focus:ring-opacity-20 dark:border-gray-500 dark:bg-gray-700 dark:text-gray-50 dark:focus:ring-gray-600 dark:focus:ring-opacity-50 dark:focus:ring-offset-0"
aria-label={localize(label as TranslationKeys)}
/> />
</div> </div>
</HoverCardTrigger> </HoverCardTrigger>

View file

@ -179,6 +179,7 @@ function DynamicSlider({
min={range ? range.min : 0} min={range ? range.min : 0}
step={range ? (range.step ?? 1) : 1} step={range ? (range.step ?? 1) : 1}
controls={false} controls={false}
aria-label={localize(label as TranslationKeys)}
className={cn( className={cn(
defaultTextProps, defaultTextProps,
cn( cn(
@ -192,6 +193,7 @@ function DynamicSlider({
id={`${settingKey}-dynamic-setting-input`} id={`${settingKey}-dynamic-setting-input`}
disabled={readonly} disabled={readonly}
value={getDisplayValue(selectedValue)} value={getDisplayValue(selectedValue)}
aria-label={localize(label as TranslationKeys)}
onChange={() => ({})} onChange={() => ({})}
className={cn( className={cn(
defaultTextProps, defaultTextProps,
@ -214,6 +216,7 @@ function DynamicSlider({
onValueChange={(value) => handleValueChange(value[0])} onValueChange={(value) => handleValueChange(value[0])}
onDoubleClick={() => setInputValue(defaultValue as string | number)} onDoubleClick={() => setInputValue(defaultValue as string | number)}
max={max} max={max}
aria-label={localize(label as TranslationKeys)}
min={range ? range.min : 0} min={range ? range.min : 0}
step={range ? (range.step ?? 1) : 1} step={range ? (range.step ?? 1) : 1}
className="flex h-4 w-full" className="flex h-4 w-full"

View file

@ -67,6 +67,9 @@ function DynamicSwitch({
onCheckedChange={handleCheckedChange} onCheckedChange={handleCheckedChange}
disabled={readonly} disabled={readonly}
className="flex" className="flex"
aria-label={
labelCode ? (localize(label as TranslationKeys) ?? label) : label || settingKey
}
/> />
</HoverCardTrigger> </HoverCardTrigger>
{description && ( {description && (

View file

@ -75,6 +75,7 @@ function DynamicTextarea({
disabled={readonly} disabled={readonly}
value={inputValue ?? ''} value={inputValue ?? ''}
onChange={setInputValue} onChange={setInputValue}
aria-label={localize(label as TranslationKeys)}
placeholder={ placeholder={
placeholderCode placeholderCode
? (localize(placeholder as TranslationKeys) ?? placeholder) ? (localize(placeholder as TranslationKeys) ?? placeholder)

View file

@ -386,6 +386,7 @@
"com_files_download_progress": "{{0}} of {{1}} files", "com_files_download_progress": "{{0}} of {{1}} files",
"com_files_downloading": "Downloading Files", "com_files_downloading": "Downloading Files",
"com_files_filter": "Filter files...", "com_files_filter": "Filter files...",
"com_files_filter_by": "Filter files by...",
"com_files_no_results": "No results.", "com_files_no_results": "No results.",
"com_files_number_selected": "{{0}} of {{1}} items(s) selected", "com_files_number_selected": "{{0}} of {{1}} items(s) selected",
"com_files_preparing_download": "Preparing download...", "com_files_preparing_download": "Preparing download...",
@ -458,7 +459,6 @@
"com_nav_delete_warning": "WARNING: This will permanently delete your account.", "com_nav_delete_warning": "WARNING: This will permanently delete your account.",
"com_nav_enable_cache_tts": "Enable cache TTS", "com_nav_enable_cache_tts": "Enable cache TTS",
"com_nav_enable_cloud_browser_voice": "Use cloud-based voices", "com_nav_enable_cloud_browser_voice": "Use cloud-based voices",
"com_nav_enabled": "Enabled",
"com_nav_engine": "Engine", "com_nav_engine": "Engine",
"com_nav_enter_to_send": "Press Enter to send messages", "com_nav_enter_to_send": "Press Enter to send messages",
"com_nav_export": "Export", "com_nav_export": "Export",
@ -632,6 +632,7 @@
"com_ui_action_button": "Action Button", "com_ui_action_button": "Action Button",
"com_ui_active": "Active", "com_ui_active": "Active",
"com_ui_add": "Add", "com_ui_add": "Add",
"com_ui_add_api_key": "Add API Key",
"com_ui_add_mcp": "Add MCP", "com_ui_add_mcp": "Add MCP",
"com_ui_add_mcp_server": "Add MCP Server", "com_ui_add_mcp_server": "Add MCP Server",
"com_ui_add_model_preset": "Add a model or preset for an additional response", "com_ui_add_model_preset": "Add a model or preset for an additional response",
@ -786,6 +787,7 @@
"com_ui_copy_link": "Copy link", "com_ui_copy_link": "Copy link",
"com_ui_copy_to_clipboard": "Copy to clipboard", "com_ui_copy_to_clipboard": "Copy to clipboard",
"com_ui_copy_url_to_clipboard": "Copy URL to clipboard", "com_ui_copy_url_to_clipboard": "Copy URL to clipboard",
"com_ui_copy_stack_trace": "Copy stack trace",
"com_ui_create": "Create", "com_ui_create": "Create",
"com_ui_create_link": "Create link", "com_ui_create_link": "Create link",
"com_ui_create_memory": "Create Memory", "com_ui_create_memory": "Create Memory",
@ -849,6 +851,7 @@
"com_ui_download_backup": "Download Backup Codes", "com_ui_download_backup": "Download Backup Codes",
"com_ui_download_backup_tooltip": "Before you continue, download your backup codes. You will need them to regain access if you lose your authenticator device", "com_ui_download_backup_tooltip": "Before you continue, download your backup codes. You will need them to regain access if you lose your authenticator device",
"com_ui_download_error": "Error downloading file. The file may have been deleted.", "com_ui_download_error": "Error downloading file. The file may have been deleted.",
"com_ui_download_error_logs": "Download error logs",
"com_ui_drag_drop": "Drop any file here to add it to the conversation", "com_ui_drag_drop": "Drop any file here to add it to the conversation",
"com_ui_dropdown_variables": "Dropdown variables:", "com_ui_dropdown_variables": "Dropdown variables:",
"com_ui_dropdown_variables_info": "Create custom dropdown menus for your prompts: `{{variable_name:option1|option2|option3}}`", "com_ui_dropdown_variables_info": "Create custom dropdown menus for your prompts: `{{variable_name:option1|option2|option3}}`",
@ -856,6 +859,7 @@
"com_ui_duplication_error": "There was an error duplicating the conversation", "com_ui_duplication_error": "There was an error duplicating the conversation",
"com_ui_duplication_processing": "Duplicating conversation...", "com_ui_duplication_processing": "Duplicating conversation...",
"com_ui_duplication_success": "Successfully duplicated conversation", "com_ui_duplication_success": "Successfully duplicated conversation",
"com_ui_editable_message": "Editable Message",
"com_ui_edit": "Edit", "com_ui_edit": "Edit",
"com_ui_edit_editing_image": "Editing image", "com_ui_edit_editing_image": "Editing image",
"com_ui_edit_mcp_server": "Edit MCP Server", "com_ui_edit_mcp_server": "Edit MCP Server",
@ -1015,6 +1019,7 @@
"com_ui_memory_updated_items": "Updated Memories", "com_ui_memory_updated_items": "Updated Memories",
"com_ui_memory_would_exceed": "Cannot save - would exceed limit by {{tokens}} tokens. Delete existing memories to make space.", "com_ui_memory_would_exceed": "Cannot save - would exceed limit by {{tokens}} tokens. Delete existing memories to make space.",
"com_ui_mention": "Mention an endpoint, assistant, or preset to quickly switch to it", "com_ui_mention": "Mention an endpoint, assistant, or preset to quickly switch to it",
"com_ui_message_input": "Message input",
"com_ui_min_tags": "Cannot remove more values, a minimum of {{0}} are required.", "com_ui_min_tags": "Cannot remove more values, a minimum of {{0}} are required.",
"com_ui_minimal": "Minimal", "com_ui_minimal": "Minimal",
"com_ui_misc": "Misc.", "com_ui_misc": "Misc.",
@ -1075,10 +1080,12 @@
"com_ui_privacy_policy_url": "Privacy Policy URL", "com_ui_privacy_policy_url": "Privacy Policy URL",
"com_ui_prompt": "Prompt", "com_ui_prompt": "Prompt",
"com_ui_prompt_groups": "Prompt Groups List", "com_ui_prompt_groups": "Prompt Groups List",
"com_ui_prompt_input": "Prompt input",
"com_ui_prompt_name": "Prompt Name", "com_ui_prompt_name": "Prompt Name",
"com_ui_prompt_name_required": "Prompt Name is required", "com_ui_prompt_name_required": "Prompt Name is required",
"com_ui_prompt_preview_not_shared": "The author has not allowed collaboration for this prompt.", "com_ui_prompt_preview_not_shared": "The author has not allowed collaboration for this prompt.",
"com_ui_prompt_text": "Text", "com_ui_prompt_text": "Text",
"com_ui_prompt_input_field": "Prompt text input field",
"com_ui_prompt_text_required": "Text is required", "com_ui_prompt_text_required": "Text is required",
"com_ui_prompt_update_error": "There was an error updating the prompt", "com_ui_prompt_update_error": "There was an error updating the prompt",
"com_ui_prompts": "Prompts", "com_ui_prompts": "Prompts",
@ -1093,6 +1100,7 @@
"com_ui_reference_saved_memories_description": "Allow the assistant to reference and use your saved memories when responding", "com_ui_reference_saved_memories_description": "Allow the assistant to reference and use your saved memories when responding",
"com_ui_refresh": "Refresh", "com_ui_refresh": "Refresh",
"com_ui_refresh_link": "Refresh link", "com_ui_refresh_link": "Refresh link",
"com_ui_refresh_page": "Refresh page",
"com_ui_regenerate": "Regenerate", "com_ui_regenerate": "Regenerate",
"com_ui_regenerate_backup": "Regenerate Backup Codes", "com_ui_regenerate_backup": "Regenerate Backup Codes",
"com_ui_regenerating": "Regenerating...", "com_ui_regenerating": "Regenerating...",
@ -1234,6 +1242,7 @@
"com_ui_update_mcp_success": "Successfully created or updated MCP", "com_ui_update_mcp_success": "Successfully created or updated MCP",
"com_ui_upload": "Upload", "com_ui_upload": "Upload",
"com_ui_upload_agent_avatar": "Successfully updated agent avatar", "com_ui_upload_agent_avatar": "Successfully updated agent avatar",
"com_ui_upload_agent_avatar_label": "Upload agent avatar image",
"com_ui_upload_avatar_label": "Upload avatar image", "com_ui_upload_avatar_label": "Upload avatar image",
"com_ui_upload_code_files": "Upload for Code Interpreter", "com_ui_upload_code_files": "Upload for Code Interpreter",
"com_ui_upload_delay": "Uploading \"{{0}}\" is taking more time than anticipated. Please wait while the file finishes indexing for retrieval.", "com_ui_upload_delay": "Uploading \"{{0}}\" is taking more time than anticipated. Please wait while the file finishes indexing for retrieval.",
@ -1299,5 +1308,8 @@
"com_ui_zoom_in": "Zoom in", "com_ui_zoom_in": "Zoom in",
"com_ui_zoom_level": "Zoom level", "com_ui_zoom_level": "Zoom level",
"com_ui_zoom_out": "Zoom out", "com_ui_zoom_out": "Zoom out",
"com_ui_share_qr_code_description": "QR code for sharing this conversation link",
"com_ui_back_to_builder": "Back to builder",
"com_ui_remove_agent_from_chain": "Remove {{0}} from chain",
"com_user_message": "You" "com_user_message": "You"
} }

View file

@ -1,6 +1,7 @@
/* eslint-disable i18next/no-literal-string */ /* eslint-disable i18next/no-literal-string */
import { Button } from '@librechat/client'; import { Button } from '@librechat/client';
import { useRouteError } from 'react-router-dom'; import { useRouteError } from 'react-router-dom';
import { useLocalize } from '~/hooks';
import logger from '~/utils/logger'; import logger from '~/utils/logger';
interface UserAgentData { interface UserAgentData {
@ -71,6 +72,7 @@ const getBrowserInfo = async () => {
}; };
export default function RouteErrorBoundary() { export default function RouteErrorBoundary() {
const localize = useLocalize();
const typedError = useRouteError() as { const typedError = useRouteError() as {
message?: string; message?: string;
stack?: string; stack?: string;
@ -164,6 +166,7 @@ export default function RouteErrorBoundary() {
size="sm" size="sm"
onClick={handleCopyStack} onClick={handleCopyStack}
className="ml-2 px-2 py-1 text-xs" className="ml-2 px-2 py-1 text-xs"
aria-label={localize('com_ui_copy_stack_trace')}
> >
Copy Copy
</Button> </Button>
@ -210,11 +213,17 @@ export default function RouteErrorBoundary() {
variant="submit" variant="submit"
onClick={() => window.location.reload()} onClick={() => window.location.reload()}
className="w-full sm:w-auto" className="w-full sm:w-auto"
aria-label={localize('com_ui_refresh_page')}
> >
Refresh Page {localize('com_ui_refresh_page')}
</Button> </Button>
<Button variant="outline" onClick={handleDownloadLogs} className="w-full sm:w-auto"> <Button
Download Error Logs variant="outline"
onClick={handleDownloadLogs}
className="w-full sm:w-auto"
aria-label={localize('com_ui_download_error_logs')}
>
{localize('com_ui_download_error_logs')}
</Button> </Button>
</div> </div>
</div> </div>

View file

@ -36,7 +36,7 @@ const AnimatedSearchInput = ({
value={value} value={value}
onChange={onChange} onChange={onChange}
placeholder={placeholder} placeholder={placeholder}
className={`peer relative z-20 w-full rounded-lg bg-surface-secondary px-10 py-2 outline-none ring-0 backdrop-blur-sm transition-all duration-500 ease-in-out placeholder:text-gray-400 focus:outline-none focus:ring-0`} className={`peer relative z-20 w-full rounded-lg bg-surface-secondary px-10 py-2 outline-none backdrop-blur-sm transition-all duration-500 ease-in-out placeholder:text-gray-400 focus:ring-ring`}
/> />
{/* Gradient overlay */} {/* Gradient overlay */}

View file

@ -3,10 +3,25 @@ import { Check } from 'lucide-react';
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'; import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
import { cn } from '~/utils'; import { cn } from '~/utils';
const Checkbox = React.forwardRef< type BaseCheckboxProps = Omit<
React.ElementRef<typeof CheckboxPrimitive.Root>, React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> 'aria-label' | 'aria-labelledby'
>(({ className = '', ...props }, ref) => ( > & {
asChild?: boolean;
};
export type CheckboxProps =
| (BaseCheckboxProps & {
'aria-label': string;
'aria-labelledby'?: never;
})
| (BaseCheckboxProps & {
'aria-labelledby': string;
'aria-label'?: never;
});
const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(
({ className = '', ...props }, ref) => (
<CheckboxPrimitive.Root <CheckboxPrimitive.Root
ref={ref} ref={ref}
className={cn( className={cn(
@ -19,7 +34,8 @@ const Checkbox = React.forwardRef<
<Check className="h-4 w-4" /> <Check className="h-4 w-4" />
</CheckboxPrimitive.Indicator> </CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root> </CheckboxPrimitive.Root>
)); ),
);
Checkbox.displayName = CheckboxPrimitive.Root.displayName; Checkbox.displayName = CheckboxPrimitive.Root.displayName;
export { Checkbox }; export { Checkbox };

View file

@ -15,8 +15,8 @@ import {
import type { Table as TTable } from '@tanstack/react-table'; import type { Table as TTable } from '@tanstack/react-table';
import { Table, TableRow, TableBody, TableCell, TableHead, TableHeader } from './Table'; import { Table, TableRow, TableBody, TableCell, TableHead, TableHeader } from './Table';
import AnimatedSearchInput from './AnimatedSearchInput'; import AnimatedSearchInput from './AnimatedSearchInput';
import { useMediaQuery, useLocalize } from '~/hooks';
import { TrashIcon, Spinner } from '~/svgs'; import { TrashIcon, Spinner } from '~/svgs';
import { useMediaQuery } from '~/hooks';
import { Skeleton } from './Skeleton'; import { Skeleton } from './Skeleton';
import { Checkbox } from './Checkbox'; import { Checkbox } from './Checkbox';
import { Button } from './Button'; import { Button } from './Button';
@ -118,6 +118,24 @@ const TableRowComponent = <TData, TValue>({
); );
} }
if (cell.column.id === 'title') {
return (
<TableHead
key={cell.id}
className="w-0 max-w-0 px-2 py-1 align-middle text-xs transition-all duration-300 sm:px-4 sm:py-2 sm:text-sm"
style={getColumnStyle(
cell.column.columnDef as TableColumn<TData, TValue>,
isSmallScreen,
)}
scope="row"
>
<div className="overflow-hidden text-ellipsis">
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</div>
</TableHead>
);
}
return ( return (
<TableCell <TableCell
key={cell.id} key={cell.id}
@ -156,11 +174,13 @@ const DeleteButton = memo(
isDeleting, isDeleting,
disabled, disabled,
isSmallScreen, isSmallScreen,
ariaLabel,
}: { }: {
onDelete?: () => Promise<void>; onDelete?: () => Promise<void>;
isDeleting: boolean; isDeleting: boolean;
disabled: boolean; disabled: boolean;
isSmallScreen: boolean; isSmallScreen: boolean;
ariaLabel: string;
}) => { }) => {
if (!onDelete) { if (!onDelete) {
return null; return null;
@ -171,6 +191,7 @@ const DeleteButton = memo(
onClick={onDelete} onClick={onDelete}
disabled={disabled} disabled={disabled}
className={cn('min-w-[40px] transition-all duration-200', isSmallScreen && 'px-2 py-1')} className={cn('min-w-[40px] transition-all duration-200', isSmallScreen && 'px-2 py-1')}
aria-label={ariaLabel}
> >
{isDeleting ? ( {isDeleting ? (
<Spinner className="size-4" /> <Spinner className="size-4" />
@ -202,6 +223,7 @@ export default function DataTable<TData, TValue>({
isLoading, isLoading,
enableSearch = true, enableSearch = true,
}: DataTableProps<TData, TValue>) { }: DataTableProps<TData, TValue>) {
const localize = useLocalize();
const isSmallScreen = useMediaQuery('(max-width: 768px)'); const isSmallScreen = useMediaQuery('(max-width: 768px)');
const tableContainerRef = useRef<HTMLDivElement>(null); const tableContainerRef = useRef<HTMLDivElement>(null);
@ -359,6 +381,7 @@ export default function DataTable<TData, TValue>({
isDeleting={isDeleting} isDeleting={isDeleting}
disabled={!table.getFilteredSelectedRowModel().rows.length || isDeleting} disabled={!table.getFilteredSelectedRowModel().rows.length || isDeleting}
isSmallScreen={isSmallScreen} isSmallScreen={isSmallScreen}
ariaLabel={localize('com_ui_delete_selected_items')}
/> />
)} )}
{filterColumn !== undefined && table.getColumn(filterColumn) && enableSearch && ( {filterColumn !== undefined && table.getColumn(filterColumn) && enableSearch && (
@ -400,6 +423,7 @@ export default function DataTable<TData, TValue>({
? header.column.getToggleSortingHandler() ? header.column.getToggleSortingHandler()
: undefined : undefined
} }
scope="col"
> >
{header.isPlaceholder {header.isPlaceholder
? null ? null

View file

@ -7,6 +7,7 @@ import {
DropdownMenuSeparator, DropdownMenuSeparator,
DropdownMenuTrigger, DropdownMenuTrigger,
} from './DropdownMenu'; } from './DropdownMenu';
import { useLocalize } from '~/hooks';
import { Button } from './Button'; import { Button } from './Button';
import { cn } from '~/utils'; import { cn } from '~/utils';
@ -20,6 +21,19 @@ export function DataTableColumnHeader<TData, TValue>({
title, title,
className = '', className = '',
}: DataTableColumnHeaderProps<TData, TValue>) { }: DataTableColumnHeaderProps<TData, TValue>) {
const localize = useLocalize();
const getSortIcon = () => {
const sortDirection = column.getIsSorted();
if (sortDirection === 'desc') {
return <ArrowDownIcon className="ml-2 h-4 w-4" />;
}
if (sortDirection === 'asc') {
return <ArrowUpIcon className="ml-2 h-4 w-4" />;
}
return <CaretSortIcon className="ml-2 h-4 w-4" />;
};
if (!column.getCanSort()) { if (!column.getCanSort()) {
return <div className={cn(className)}>{title}</div>; return <div className={cn(className)}>{title}</div>;
} }
@ -28,15 +42,14 @@ export function DataTableColumnHeader<TData, TValue>({
<div className={cn('flex items-center space-x-2', className)}> <div className={cn('flex items-center space-x-2', className)}>
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger asChild> <DropdownMenuTrigger asChild>
<Button variant="ghost" size="sm" className="-ml-3 h-8 data-[state=open]:bg-accent"> <Button
variant="ghost"
size="sm"
className="-ml-3 h-8 data-[state=open]:bg-accent"
aria-label={localize('com_ui_filter_by', { title })}
>
<span>{title}</span> <span>{title}</span>
{column.getIsSorted() === 'desc' ? ( {getSortIcon()}
<ArrowDownIcon className="ml-2 h-4 w-4" />
) : column.getIsSorted() === 'asc' ? (
<ArrowUpIcon className="ml-2 h-4 w-4" />
) : (
<CaretSortIcon className="ml-2 h-4 w-4" />
)}
</Button> </Button>
</DropdownMenuTrigger> </DropdownMenuTrigger>
<DropdownMenuContent align="start" className="z-[1001]"> <DropdownMenuContent align="start" className="z-[1001]">

View file

@ -85,7 +85,9 @@ const OGDialogTemplate = forwardRef((props: DialogTemplateProps, ref: Ref<HTMLDi
<div className="flex h-auto gap-3 max-sm:w-full max-sm:flex-col sm:flex-row"> <div className="flex h-auto gap-3 max-sm:w-full max-sm:flex-col sm:flex-row">
{showCancelButton && ( {showCancelButton && (
<OGDialogClose asChild> <OGDialogClose asChild>
<Button variant="outline">{localize('com_ui_cancel')}</Button> <Button variant="outline" aria-label={localize('com_ui_cancel')}>
{localize('com_ui_cancel')}
</Button>
</OGDialogClose> </OGDialogClose>
)} )}
{buttons != null ? buttons : null} {buttons != null ? buttons : null}

View file

@ -2,10 +2,23 @@ import * as React from 'react';
import * as SwitchPrimitives from '@radix-ui/react-switch'; import * as SwitchPrimitives from '@radix-ui/react-switch';
import { cn } from '~/utils'; import { cn } from '~/utils';
const Switch = React.forwardRef< type BaseSwitchProps = Omit<
React.ElementRef<typeof SwitchPrimitives.Root>, React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> 'aria-label' | 'aria-labelledby'
>(({ className, ...props }, ref) => ( >;
type SwitchProps =
| (BaseSwitchProps & {
'aria-label': string;
'aria-labelledby'?: never;
})
| (BaseSwitchProps & {
'aria-labelledby': string;
'aria-label'?: never;
});
const Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitives.Root>, SwitchProps>(
({ className, ...props }, ref) => (
<SwitchPrimitives.Root <SwitchPrimitives.Root
className={cn( className={cn(
'peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-unchecked', 'peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-unchecked',
@ -20,7 +33,8 @@ const Switch = React.forwardRef<
)} )}
/> />
</SwitchPrimitives.Root> </SwitchPrimitives.Root>
)); ),
);
Switch.displayName = SwitchPrimitives.Root.displayName; Switch.displayName = SwitchPrimitives.Root.displayName;
export { Switch }; export { Switch };

View file

@ -4,7 +4,19 @@ import ReactTextareaAutosize from 'react-textarea-autosize';
import type { TextareaAutosizeProps } from 'react-textarea-autosize'; import type { TextareaAutosizeProps } from 'react-textarea-autosize';
import { chatDirectionAtom } from '~/store'; import { chatDirectionAtom } from '~/store';
export const TextareaAutosize = forwardRef<HTMLTextAreaElement, TextareaAutosizeProps>( type BaseTextareaAutosizeProps = Omit<TextareaAutosizeProps, 'aria-label' | 'aria-labelledby'>;
export type TextareaAutosizePropsWithAria =
| (BaseTextareaAutosizeProps & {
'aria-label': string;
'aria-labelledby'?: never;
})
| (BaseTextareaAutosizeProps & {
'aria-labelledby': string;
'aria-label'?: never;
});
export const TextareaAutosize = forwardRef<HTMLTextAreaElement, TextareaAutosizePropsWithAria>(
(props, ref) => { (props, ref) => {
const [, setIsRerendered] = useState(false); const [, setIsRerendered] = useState(false);
const chatDirection = useAtomValue(chatDirectionAtom).toLowerCase(); const chatDirection = useAtomValue(chatDirectionAtom).toLowerCase();

View file

@ -1,4 +1,7 @@
{ {
"com_ui_cancel": "Cancel", "com_ui_cancel": "Cancel",
"com_ui_no_options": "No options available" "com_ui_no_options": "No options available",
"com_ui_delete_selected_items": "Delete selected items",
"com_ui_filter_by": "Filter by {{title}}",
"com_ui_cancel_dialog": "Cancel dialog"
} }