Skip to content

feat: Added max length validation in file upload modal in file description#1037

Merged
Spiral-Memory merged 7 commits intoRocketChat:developfrom
srijnabhargav:feat/add-max-char-count-file-desc
Mar 21, 2026
Merged

feat: Added max length validation in file upload modal in file description#1037
Spiral-Memory merged 7 commits intoRocketChat:developfrom
srijnabhargav:feat/add-max-char-count-file-desc

Conversation

@srijnabhargav
Copy link
Copy Markdown
Contributor

Brief Title

Acceptance Criteria fulfillment

  • Added a 5000-character limit for the file description

  • Show an alert message when the description exceeds the limit

  • Display the character counter below the description input (left: alert, right: counter)

Fixes #1036

final1.mp4

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-<pr_number> after approval. Contributors are requested to replace <pr_number> with the actual PR number.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 11, 2025

CLA assistant check
All committers have signed the CLA.

import TypingUsers from '../TypingUsers/TypingUsers';
import useSearchMentionUser from '../../hooks/useSearchMentionUser';

const DEFAULT_CHAR_LIMIT = 5000;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Probably, the limit is set in the RC server. We have to make sure we read these settings from the RC server instead of hardcoding 5000; we can use this as a fallback though.

@srijnabhargav
Copy link
Copy Markdown
Contributor Author

Hello @Spiral-Memory, I’ve addressed your review comment Could you please check it again


const useSettingsStore = create((set) => ({
messageLimit: 5000,
messageLimit: null, // Will be fetched from RC server (Message_MaxAllowedSize)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can set 5000 incase server fails to respond as fallback

const [isPending, setIsPending] = useState(false);
const messageRef = useRef(null);

// Mention UI states
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove comments

@srijnabhargav
Copy link
Copy Markdown
Contributor Author

Addressed the review points @Spiral-Memory please check

@srijnabhargav
Copy link
Copy Markdown
Contributor Author

Hello @Spiral-Memory Resolved Prettier fixed the formatting please check

const useSettingsStore = create((set) => ({
messageLimit: 5000,
setMessageLimit: (messageLimit) => set(() => ({ messageLimit })),
// Default fallback value; will be overridden from RC server (Message_MaxAllowedSize) when available
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove the comments

Copy link
Copy Markdown
Collaborator

@Spiral-Memory Spiral-Memory left a comment

Choose a reason for hiding this comment

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

LGTM! Please resolve the comments

@Spiral-Memory
Copy link
Copy Markdown
Collaborator

Please resolve lint issues

@Spiral-Memory Spiral-Memory added nudge minor tweaks suggested testing labels Mar 13, 2026
@srijnabhargav srijnabhargav force-pushed the feat/add-max-char-count-file-desc branch from c2c36e5 to c672b8b Compare March 13, 2026 06:31
@srijnabhargav srijnabhargav force-pushed the feat/add-max-char-count-file-desc branch from c672b8b to 112809c Compare March 13, 2026 06:33
@srijnabhargav
Copy link
Copy Markdown
Contributor Author

Hello @Spiral-Memory I have resolved all the comments and lint check is also passing , ready to merge.
Thankyou

@Spiral-Memory Spiral-Memory merged commit 2ccf190 into RocketChat:develop Mar 21, 2026
3 checks passed
github-actions bot added a commit that referenced this pull request Mar 21, 2026
@Spiral-Memory Spiral-Memory removed nudge minor tweaks suggested testing labels Mar 21, 2026
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.

Add Character Limit Validation & UI Feedback to File Description Input

3 participants