You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update ChatBar.tsx to allow for copy/paste and drag/drop file uploads (#7153)
<!--
## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"
If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):
## Notes for the reviewer
Anything important to call out? Be sure to also clarify these in your comments.
## How to test
Unit tests, playground, etc.
-->
<!-- start pr-codex -->
---
## PR-Codex overview
This PR enhances the `ChatBar` component by adding image upload validation, drag-and-drop functionality, and user feedback through toast notifications. It improves user experience by ensuring only valid images are uploaded and prompts users to sign in if they attempt to upload without permission.
### Detailed summary
- Added `showSigninToUploadImagesToast` function for user notifications.
- Introduced `isDragOver` state for drag-and-drop feedback.
- Updated `handleImageUpload` to validate file types and sizes.
- Implemented drag-and-drop event handlers for image uploads.
- Added clipboard paste support for image uploads.
- Modified `ImageUploadButton` to use validated files directly.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added support for image uploads via drag-and-drop and clipboard paste in the chat bar.
- Enhanced visual feedback during drag-and-drop image uploads.
- Added prompts for users to sign in when attempting image uploads without authorization.
- **Bug Fixes**
- Improved validation for image uploads, including file size and total image count limits.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
0 commit comments