Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/shared/src/components/post/write/ShareLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const confirmSharingAgainPrompt = {
},
};

const MAX_COMMENTARY_LENGTH = 250;
Copy link
Copy Markdown
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
Copy Markdown
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.


export function ShareLink({
squad,
className,
Expand Down Expand Up @@ -109,6 +111,10 @@ export function ShareLink({
return null;
}

if ((commentary || '').length > MAX_COMMENTARY_LENGTH) {
return null;
Copy link
Copy Markdown
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?

}

if (!isCreatingPost) {
return onUpdateSubmit(e);
}
Expand Down Expand Up @@ -169,6 +175,7 @@ export function ShareLink({
enabledCommand={{ mention: true }}
showMarkdownGuide={false}
onValueUpdate={setCommentary}
maxInputLength={MAX_COMMENTARY_LENGTH}
/>
<WriteFooter
isLoading={isPosting || isPostingModeration || isPendingCreation}
Expand Down