Feat: Added Max Length Message Validation on File Upload's Description Input
Brief Title
Added Max Length Message Validation on File Upload's Description Input
Acceptance Criteria fulfillment
- [X] Add a maximum character limit for the file description.
- [X] Display a warning message when the description exceeds the limit.
- [X] The input field border and text color should change to indicate an error when the description is too long.
- [X] Prevent file upload submission if the description exceeds the limit.
Fixes #893
Video/Screenshots
https://github.com/user-attachments/assets/efee52eb-fe3b-400b-a31e-8ce03e1a9887
PR Test Details
Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-895 after approval. Contributors are requested to replace <pr_number> with the actual PR number.
How you are getting this limit ?
How you are getting this limit ?
We can find this messageLimit in packages/react/src/store/settingsStore.js. I'm fetching it from there.
This is the same messageLimit that we consider when sending a text message. If the user exceeds it, we ask them to send the message in the form of a .txt file instead of a simple text message. I also checked RC, and they use the same messageLimit for both cases.
Code: