Skip to content

Conversation

@edwinjojie
Copy link

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.

  • Enforces 250 character limit
  • Prevents invalid submission
  • Avoids backend validation error toast

@vercel
Copy link

vercel bot commented Dec 23, 2025

@edwinjojie is attempting to deploy a commit to the Daily Dev Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@rebelchris rebelchris left a 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;
Copy link
Contributor

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;
Copy link
Contributor

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?

Copy link
Author

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.

@edwinjojie
Copy link
Author

@edwinjojie is attempting to deploy a commit to the Daily Dev Team on Vercel.

A member of the Team first needs to authorize it.

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.
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.

2 participants