From 1c648b3104fe022dd57739868b1d0f3f7ad88f2b Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Wed, 4 Mar 2026 22:26:00 +0100 Subject: [PATCH] style: update file upload handling and improve component structure across various files --- .../Chat/Input/Files/AttachFileMenu.tsx | 7 +- .../SidePanel/Agents/Code/ApiKeyDialog.tsx | 4 +- .../components/SidePanel/Builder/Images.tsx | 2 +- client/src/locales/en/translation.json | 1 - package-lock.json | 1 - .../client/src/components/AlertDialog.tsx | 2 +- .../client/src/components/FileInput.spec.tsx | 116 ++++++++++++++++++ packages/client/src/components/FileInput.tsx | 8 +- packages/client/src/components/FileUpload.tsx | 5 +- packages/client/src/components/index.ts | 3 - 10 files changed, 127 insertions(+), 22 deletions(-) create mode 100644 packages/client/src/components/FileInput.spec.tsx diff --git a/client/src/components/Chat/Input/Files/AttachFileMenu.tsx b/client/src/components/Chat/Input/Files/AttachFileMenu.tsx index 134a7cc876..531e4d239b 100644 --- a/client/src/components/Chat/Input/Files/AttachFileMenu.tsx +++ b/client/src/components/Chat/Input/Files/AttachFileMenu.tsx @@ -21,6 +21,7 @@ import { EToolResources, EModelEndpoint, defaultAgentCapabilities, + bedrockDocumentExtensions, isDocumentSupportedProvider, } from 'librechat-data-provider'; import type { EndpointFileConfig } from 'librechat-data-provider'; @@ -39,7 +40,7 @@ import { ephemeralAgentByConvoId } from '~/store'; import { MenuItemProps } from '~/common'; import { cn } from '~/utils'; -type FileUploadType = FileType; +type FileUploadType = FileType | 'image_document_extended'; interface AttachFileMenuProps { agentId?: string | null; @@ -95,7 +96,9 @@ const AttachFileMenu = ({ return; } inputRef.current.value = ''; - if (fileType && fileType in FILE_TYPE_MAP) { + if (fileType === 'image_document_extended') { + inputRef.current.accept = `image/*,.heif,.heic,${bedrockDocumentExtensions}`; + } else if (fileType && fileType in FILE_TYPE_MAP) { inputRef.current.accept = FILE_TYPE_MAP[fileType]; } else { inputRef.current.accept = ''; diff --git a/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx b/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx index 282f17b0d3..22e1e9bd8c 100644 --- a/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx +++ b/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx @@ -93,7 +93,7 @@ export default function ApiKeyDialog({ {localize('com_ui_librechat_code_api_key')} -