- Branch Name:
ux/studio-share-username-check
- PR Title:
[Feature] [Studio]: check for username before generating share link
Affected Apps / Packages
Is your feature request related to a problem?
Yes. When a user tries to create a public link for a document, the backend requires a username. If the user doesn't have one set, the API returns a 400 error and the client displays a generic toast: "Username required before sharing."
The user is forced to close the modal, navigate to their profile, and set a username. Instead, the ShareDocumentModal should check if the user is missing a username upfront, and display an inline error block with a direct action link to configure it in their Profile.
Describe the solution you'd like
- The modal should inspect the user's username (from
useUserStore).
- If
user.username is missing, the modal should show a warning state: "Username required: You need to set a username in your profile settings before you can share documents publicly."
- It should display a button "Go to Profile Settings" that redirects the user to the profile page, and disable the "Generate Public Link" form elements.
Describe alternatives you've considered
- Keep the form editable but throw a validation error inline on click. Checking upfront is cleaner.
Additional Context
- Subscribing to
useUserStore gives us the current user object.
ux/studio-share-username-check[Feature] [Studio]: check for username before generating share linkAffected Apps / Packages
Is your feature request related to a problem?
Yes. When a user tries to create a public link for a document, the backend requires a username. If the user doesn't have one set, the API returns a 400 error and the client displays a generic toast: "Username required before sharing."
The user is forced to close the modal, navigate to their profile, and set a username. Instead, the
ShareDocumentModalshould check if the user is missing a username upfront, and display an inline error block with a direct action link to configure it in their Profile.Describe the solution you'd like
useUserStore).user.usernameis missing, the modal should show a warning state: "Username required: You need to set a username in your profile settings before you can share documents publicly."Describe alternatives you've considered
Additional Context
useUserStoregives us the current user object.