Skip to content

[UX]: Improve username configuration checks in Share Document Modal #106

@Gautam25Raj

Description

@Gautam25Raj
  • Branch Name: ux/studio-share-username-check
  • PR Title: [Feature] [Studio]: check for username before generating share link

Affected Apps / Packages

  • Studio (apps/studio)

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.

Metadata

Metadata

Labels

frontendUI/client-side codeui/uxDesign or user experience improvements
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions