Skip to content

[FEATURE]: Add Username edit section to Profile page with locked-once validation #104

@Gautam25Raj

Description

@Gautam25Raj

Affected Apps / Packages

Studio (apps/studio)

Is your feature request related to a problem?

Yes. The backend database schema and endpoints support setting a unique user username via PUT /me/username, which is a hard prerequisite for creating public share links (under /share/[username]/[slug]).

Currently, there is no UI section or input field in the Profile page allowing users to view or set their username. Furthermore, the backend enforces a constraint where a username can only be set once (returns 409 if modified again). The UI must implement this field with clear warnings and handle the edit lock.

  • Branch Name: feat/studio-profile-username-setup
  • PR Title: [Feature] [Studio]: add username configuration section to profile

Describe the solution you'd like

  • A "Username" section should be displayed in the ProfileDataPanel.tsx.
  • If no username is set, it should show a warning/note: "Username can only be set once and cannot be changed later." and an "Edit" button.
  • Clicking "Edit" opens a modal EditProfileUsernameModal where the user can check availability and set it.
  • If a username is already set, clicking "Edit" should open a modal that states: "Username is locked and cannot be changed. Please contact our support team if you need assistance."

Describe alternatives you've considered

  • Leaving the username unset or forcing manual setting through DB scripting, which locks users out of the share feature.
  • Allowing changing the username in the UI, which would result in failed requests since the backend rejects modifications.

Additional Context

  • Database field: User.username (unique string).
  • Backend service logic: UserService.updateUsername(userId, username) raises 409 "Username is locked and cannot be changed" if current.username is already set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfrontendUI/client-side codehelp wantedExtra attention is needed
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions