-
Notifications
You must be signed in to change notification settings - Fork 287
fix(share-link): add character limit & counter to commentary field #5194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@edwinjojie is attempting to deploy a commit to the Daily Dev Team on Vercel. A member of the Team first needs to authorize it. |
rebelchris
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the package change?
| } | ||
|
|
||
| if ((commentary || '').length > MAX_COMMENTARY_LENGTH) { | ||
| return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would still be unclear to user right?
| }, | ||
| }; | ||
|
|
||
| const MAX_COMMENTARY_LENGTH = 250; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use this one and abstract it somewhere shared?
| const MAX_TITLE_LENGTH = 250; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback — I’ve updated the flow to remove the silent failure.
The submit action is now disabled when the commentary exceeds the limit, and a subtle inline hint is shown alongside the character counter so users can immediately understand why they can’t submit.
I’ve also aligned this with the shared post constraints to avoid duplication. Let me know if this matches the expected UX.
This touches shared code because the 250-character constraint already exists in the shared write flow. I’ll refactor it to reuse a single shared constant and update the submit path to provide explicit user feedback instead of a silent return. |
Moves the 250-character post constraints into a shared constant to avoid duplication and keep write flows consistent.
Disables the submit action when commentary exceeds the allowed character limit and adds a subtle inline hint alongside the character counter to explain the constraint to users.
Fixes daily.dev#2021
Adds frontend character limit enforcement and a character counter
to the “Share a link” commentary field, aligning it with the
existing “Write a post” behavior.