Conversation
…mp client version to 0.4.4
…layout consistency
…across various components
17909f5 to
1874189
Compare
There was a problem hiding this comment.
Pull request overview
Adds a reusable file upload input to @librechat/client and refactors several dialogs/menus to standardize footer layout and file-picker behavior across the app.
Changes:
- Introduce
FileInput(withFILE_TYPE_MAP+acceptTypes) and adopt it in multiple upload entry points. - Standardize dialog footer layout via
OGDialogFooter/DialogFooterclass updates and refactor select dialogs to use the newer dialog primitives. - Update MCP delete dialog copy and bump
@librechat/clientversion.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/client/src/components/index.ts | Re-export FileInput, FILE_TYPE_MAP, and FileType from the client component barrel. |
| packages/client/src/components/SecretInput.tsx | Adjust input border styling for alignment/consistency. |
| packages/client/src/components/OriginalDialog.tsx | Update DialogFooter/OGDialogFooter layout classes for consistent spacing/responsiveness. |
| packages/client/src/components/OGDialogTemplate.tsx | Adjust button layout classes (removes small-screen ordering/width classes). |
| packages/client/src/components/FileUpload.tsx | Migrate hidden file input implementation to the new FileInput + acceptTypes. |
| packages/client/src/components/FileInput.tsx | New reusable file input component + predefined accept mappings. |
| packages/client/package.json | Bump @librechat/client version. |
| package-lock.json | Update lockfile for new client version. |
| client/src/locales/en/translation.json | Add/adjust MCP delete strings and confirmation text. |
| client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/TrustSection.tsx | Import ordering/type import placement cleanup. |
| client/src/components/SidePanel/MCPBuilder/MCPServerDialog/index.tsx | Minor delete button sizing + updated delete confirmation copy usage. |
| client/src/components/SidePanel/Builder/Images.tsx | Use FileInput for avatar upload and localize the upload label. |
| client/src/components/SidePanel/Agents/MCPIcon.tsx | Use FileInput for MCP icon upload. |
| client/src/components/SidePanel/Agents/Images.tsx | Use FileInput for agent avatar upload. |
| client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx | Refactor to use OGDialog* primitives + SecretInput for consistent dialog layout. |
| client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsx | Use OGDialogFooter in delete dialog; wrap “create link” action in footer component. |
| client/src/components/Conversations/ConvoOptions/DeleteButton.tsx | Replace custom footer div with OGDialogFooter for consistency. |
| client/src/components/Chat/Input/Files/AttachFileMenu.tsx | Replace inline accept-string logic with shared FILE_TYPE_MAP. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "com_ui_delete_tool": "Delete Tool", | ||
| "com_ui_delete_tool_confirm": "Are you sure you want to delete this tool?", | ||
| "com_ui_delete_tool_save_reminder": "Tool removed. Save the agent to apply changes.", | ||
| "com_ui_delete_mcp_server": "Delete MCP Server?", |
There was a problem hiding this comment.
com_ui_delete_mcp_server is defined twice in en/translation.json. Duplicate JSON keys are error-prone and can hide changes (only the last value is used). Remove one of the entries (keep a single canonical definition).
| "com_ui_delete_mcp_server": "Delete MCP Server?", |
| const FILE_TYPE_MAP: Record<FileType, string> = { | ||
| image: 'image/*,.heif,.heic', | ||
| document: '.pdf,application/pdf,.doc,.docx,.txt,.md,.csv,.xls,.xlsx', | ||
| video: 'video/*', | ||
| audio: 'audio/*', | ||
| image_document: 'image/*,.heif,.heic,.pdf,application/pdf', | ||
| image_document_extended: | ||
| 'image/*,.heif,.heic,.pdf,.csv,.doc,.docx,.xls,.xlsx,.html,.htm,.txt,.md,application/pdf,text/csv,application/csv,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/html,text/plain,text/markdown', | ||
| image_document_video_audio: 'image/*,.heif,.heic,.pdf,application/pdf,video/*,audio/*', | ||
| all: '*', | ||
| }; |
There was a problem hiding this comment.
FILE_TYPE_MAP.all is set to '*', but accept expects a comma-separated list of MIME types and/or extensions (e.g. image/*, .pdf). For “all files”, the most compatible behavior is to omit the accept attribute entirely (return undefined) or set it to an empty string, rather than '*' which is not a valid accept token in many browsers.
| <OGDialogFooter> | ||
| <Button disabled={isCreateLoading} variant="submit" onClick={createShareLink}> | ||
| {!isCreateLoading && localize('com_ui_create_link')} | ||
| {isCreateLoading && <Spinner className="size-4" />} | ||
| </Button> | ||
| </OGDialogFooter> |
There was a problem hiding this comment.
OGDialogFooter is used outside of a dialog (for the “Create link” button). Since OGDialogFooter now includes layout styles like w-full and flex-col-reverse, it can unexpectedly affect the surrounding toolbar layout. Prefer a local wrapper (div with appropriate flex classes) for non-dialog button rows, and reserve OGDialogFooter for dialog content.
| <OGDialogFooter> | |
| <Button disabled={isCreateLoading} variant="submit" onClick={createShareLink}> | |
| {!isCreateLoading && localize('com_ui_create_link')} | |
| {isCreateLoading && <Spinner className="size-4" />} | |
| </Button> | |
| </OGDialogFooter> | |
| <div className="flex items-center"> | |
| <Button disabled={isCreateLoading} variant="submit" onClick={createShareLink}> | |
| {!isCreateLoading && localize('com_ui_create_link')} | |
| {isCreateLoading && <Spinner className="size-4" />} | |
| </Button> | |
| </div> |
…ross various files
Summary
Introduces a new reusable
FileInputcomponent to the@librechat/clientpackage for standardized file upload handling across the application. RefactorsOGDialogFooterlayout for improved consistency and responsiveness. UpdatesSecretInputstyling for better UI alignment. Components are now used in Chat attachments, Agent images, and MCP icon uploadsChange Type
Testing
Checklist