Skip to content

feat: Add customizable chat input and file upload components #8237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 29, 2025

Conversation

Cristhianzl
Copy link
Member

This pull request introduces a set of customizations to the frontend codebase, primarily focusing on replacing existing file upload and chat input functionalities with customizable alternatives. The changes aim to enhance modularity and adaptability for specific use cases.

Customization for Chat Input:

  • Addition of CustomChatInput Component: Introduced a new CustomChatInput component that wraps the existing ChatInput component, allowing customization of chat input behavior. (src/frontend/src/customization/components/custom-chat-input.tsx)
  • Replacement in ChatView: Replaced the original ChatInput component with CustomChatInput in the ChatView component to integrate the new customizable chat input functionality. (src/frontend/src/modals/IOModal/components/chatView/components/chat-view.tsx)

Customization for File Upload:

  • Custom Hook for File Upload: Added customPostUploadFileV2 as a wrapper around the existing usePostUploadFileV2 hook to enable customization of file upload operations. (src/frontend/src/customization/hooks/use-custom-post-upload-file.ts)
  • Integration with Existing Components: Updated multiple components and pages (FileRendererComponent, FilesPage, etc.) to use customPostUploadFileV2 instead of the original usePostUploadFileV2. This ensures all file upload operations now use the customizable hook. (src/frontend/src/modals/fileManagerModal/components/filesRendererComponent/components/fileRendererComponent/index.tsx, src/frontend/src/pages/MainPage/pages/filesPage/index.tsx) [1] [2] [3] [4]

Utility Enhancements:

  • Custom Hook for File Handling: Added customUseFileHandler as a wrapper around the existing useFileHandler hook, enabling customization of file handling logic. (src/frontend/src/customization/hooks/use-custom-use-file-handler.ts)

These changes collectively improve the flexibility of the frontend components and hooks, making them more adaptable to different requirements.

…to customize chat input functionality

✨ (use-custom-post-upload-file.ts): introduce a custom hook customPostUploadFileV2 to handle file uploads with customization
✨ (use-custom-use-file-handler.ts): introduce a custom hook customUseFileHandler to handle file operations with customization
♻️ (use-upload-file.ts): refactor useUploadFile to use customPostUploadFileV2 for file uploads with customization
♻️ (chat-view.tsx): refactor ChatView component to use CustomChatInput instead of ChatInput for customization
♻️ (fileRendererComponent/index.tsx): refactor FileRendererComponent to use customPostUploadFileV2 for file uploads with customization
♻️ (index.tsx): refactor MainPage filesPage to use customPostUploadFileV2 for file uploads with customization
@Cristhianzl Cristhianzl self-assigned this May 27, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels May 27, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels May 27, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 27, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels May 28, 2025
@Cristhianzl Cristhianzl added this pull request to the merge queue May 29, 2025
Merged via the queue into main with commit 2bf7e96 May 29, 2025
22 checks passed
@Cristhianzl Cristhianzl deleted the cz/add-custom-image branch May 29, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants