Skip to content

improvement(chat-file-upload): add visual indication of file upload exceeding limit#1123

Merged
icecrasher321 merged 4 commits intostagingfrom
improvement/chat-file-upload
Aug 24, 2025
Merged

improvement(chat-file-upload): add visual indication of file upload exceeding limit#1123
icecrasher321 merged 4 commits intostagingfrom
improvement/chat-file-upload

Conversation

@icecrasher321
Copy link
Collaborator

Summary

No visual indication of upload error via chat tab when the file is over 10mb limit. This PR fixes that.

Type of Change

  • Bug fix

Testing

Screenshot 2025-08-23 at 4 39 06 PM

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Aug 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim Canceled Canceled Aug 24, 2025 0:10am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Aug 24, 2025 0:10am

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

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.ts for potential type safety considerations

3 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

@vercel vercel bot temporarily deployed to Preview – docs August 23, 2025 23:57 Inactive
@vercel vercel bot temporarily deployed to Preview – docs August 24, 2025 00:04 Inactive
@icecrasher321 icecrasher321 merged commit efc487a into staging Aug 24, 2025
4 of 5 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/chat-file-upload branch August 24, 2025 08:02
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
…xceeding limit (simstudioai#1123)

* improvement(chat-file-upload): add visual indication of file upload exceeding limit

* fix duplicate error + lint

* fix lint

* fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant