Skip to content

📦 feat(client): add FileInput component and improve dialog layout consistency - #11582

Closed
berry-13 wants to merge 4 commits into
devfrom
feat/client-package-components
Closed

berry-13 wants to merge 4 commits into
devfrom
feat/client-package-components

Conversation

@berry-13

Copy link
Copy Markdown
Collaborator

Summary

Introduces a new reusable FileInput component to the @librechat/client package for standardized file upload handling across the application. Refactors OGDialogFooter layout for improved consistency and responsiveness. Updates SecretInput styling for better UI alignment. Components are now used in Chat attachments, Agent images, and MCP icon uploads

Change Type

  • Style
  • New feature (non-breaking change which adds functionality)
  • Refactor

Testing

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.

@berry-13
berry-13 changed the base branch from main to dev January 31, 2026 11:14
@berry-13 berry-13 added 🎨 design UI/UX improvements ✨ enhancement New feature or request labels Jan 31, 2026
@berry-13
berry-13 marked this pull request as ready for review February 1, 2026 10:24
@berry-13 berry-13 assigned berry-13 and unassigned berry-13 Feb 1, 2026
@berry-13
berry-13 marked this pull request as draft February 1, 2026 10:53
@berry-13
berry-13 force-pushed the feat/client-package-components branch from 17909f5 to 1874189 Compare March 4, 2026 20:14
Copilot AI review requested due to automatic review settings March 4, 2026 20:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (with FILE_TYPE_MAP + acceptTypes) and adopt it in multiple upload entry points.
  • Standardize dialog footer layout via OGDialogFooter/DialogFooter class updates and refactor select dialogs to use the newer dialog primitives.
  • Update MCP delete dialog copy and bump @librechat/client version.

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.

Comment thread client/src/locales/en/translation.json Outdated
"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?",

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"com_ui_delete_mcp_server": "Delete MCP Server?",

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +51
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: '*',
};

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +193 to +198
<OGDialogFooter>
<Button disabled={isCreateLoading} variant="submit" onClick={createShareLink}>
{!isCreateLoading && localize('com_ui_create_link')}
{isCreateLoading && <Spinner className="size-4" />}
</Button>
</OGDialogFooter>

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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>

Copilot uses AI. Check for mistakes.
@berry-13
berry-13 deleted the feat/client-package-components branch August 22, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 design UI/UX improvements ✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants