improvement(chat-file-upload): add visual indication of file upload exceeding limit#1123
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Greptile Summary
This PR addresses a user experience issue where file upload errors in the chat interface were not visually communicated to users. Previously, when files exceeded the 10MB size limit or failed other validation checks (duplicate files, maximum file count), the errors were only logged to the console, leaving users unaware of why their uploads failed.
The implementation follows a callback pattern to propagate errors from child components up to the parent chat interface. The ChatFileUpload component now accepts an optional onError callback prop that receives an array of validation error messages. The chat component manages an uploadErrors state and displays these errors through a red Notice component with specific error messages.
The error handling covers multiple scenarios: file size validation (10MB limit), duplicate file detection, maximum file count limits, and both drag-and-drop and file picker workflows. The error state is properly managed - errors are cleared when new files are successfully selected or when messages are sent, ensuring the UI doesn't show stale error messages.
The workflow execution hook was also updated to support error callbacks, allowing the upload process to communicate failures back to the UI layer. This maintains proper separation of concerns between the execution logic and the user interface while enabling comprehensive error feedback.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it only adds error handling and visual feedback
- Score reflects well-structured error handling implementation with proper state management and UI integration
- Pay close attention to the error callback integration in
use-workflow-execution.tsfor potential type safety considerations
3 files reviewed, 1 comment
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts
Outdated
Show resolved
Hide resolved
…xceeding limit (simstudioai#1123) * improvement(chat-file-upload): add visual indication of file upload exceeding limit * fix duplicate error + lint * fix lint * fix lint
Summary
No visual indication of upload error via chat tab when the file is over 10mb limit. This PR fixes that.
Type of Change
Testing
Checklist