EmbeddedChat icon indicating copy to clipboard operation
EmbeddedChat copied to clipboard

Feat: Added Max Length Message Validation on File Upload's Description Input

Open dhairyashiil opened this issue 11 months ago • 2 comments

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.

dhairyashiil avatar Jan 14 '25 11:01 dhairyashiil

How you are getting this limit ?

Spiral-Memory avatar Jan 27 '25 16:01 Spiral-Memory

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: image

dhairyashiil avatar Jan 28 '25 20:01 dhairyashiil