fix(share-link): add character limit & counter to commentary field#5194
fix(share-link): add character limit & counter to commentary field#5194edwinjojie wants to merge 3 commits intodailydotdev:mainfrom
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.
Why the package change?
| } | ||
|
|
||
| if ((commentary || '').length > MAX_COMMENTARY_LENGTH) { | ||
| return null; |
There was a problem hiding this comment.
This would still be unclear to user right?
| }, | ||
| }; | ||
|
|
||
| const MAX_COMMENTARY_LENGTH = 250; |
There was a problem hiding this comment.
Can you use this one and abstract it somewhere shared?
There was a problem hiding this comment.
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.