-
Notifications
You must be signed in to change notification settings - Fork 11.4k
fix: UI Breaks When Entering a Long Username in Profile Settings #16304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@C-W-D-Harshit is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (08/21/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (08/21/24)1 label was added to this PR based on Keith Williams's automation. |
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
Amit91848
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! In addition to this, it gets all wonky when you have extra long current username, can you fix that as well @C-W-D-Harshit
|
Hi @Amit91848 I am currently working on that. |
|
Hi @Amit91848 I have fixed the issue. https://www.loom.com/share/94881202752344708a164c69a192b28a?sid=743f630b-2df3-467a-8255-2b7ba1a0be1d |
| <div className="max-w-96 w-fit"> | ||
| <p className="text-subtle">{t("current_username")}</p> | ||
| <Tooltip content={currentUsername}> | ||
| <p | ||
| className="text-emphasis mt-1 max-w-md overflow-hidden text-ellipsis" | ||
| className="text-emphasis mt-1 w-full max-w-md overflow-hidden text-ellipsis" | ||
| data-testid="current-username"> | ||
| {currentUsername} | ||
| </p> | ||
| </Tooltip> | ||
| </div> | ||
| <div> | ||
| <div className="max-w-96 w-fit"> | ||
| <p className="text-subtle" data-testid="new-username"> | ||
| {t("new_username")} | ||
| </p> | ||
| <Tooltip content={inputUsernameValue}> | ||
| <p className="text-emphasis mt-1 max-w-md overflow-hidden text-ellipsis"> | ||
| <p className="text-emphasis mt-1 w-full overflow-hidden text-ellipsis"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes are unnecessary. You can easily fix it by breaking the text onto the next line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anikdhabal Yes you can also fix that by adding a new line, but what if someone just entered a very very long username 😅. The issue would still persist.
I think there should be some kind of character limit with zod validation in the username field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still manages and doesn’t break. What do we mean by a very, very long username? Are we thinking about one million letters? 😅
Also, you can't see the text that is outside the area, so it's better to show the full username before saving, instead of just hiding some parts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still manages and doesn’t break. What do we mean by a very, very long username? Are we thinking about one million words? 😅
Nah mate 😅. I like your approach, it is a lot simpler. My approach was to just fix the code way it was.
E2E results are ready! |
|
Shouldn't these changes be made in |
Yeah, we need to make changes there as well. @C-W-D-Harshit pls do |
…meTextfield components
….com into fixUsernameBug
|
Hi @Amit91848, I have made the changes in PremiumTextfield.tsx. |
anikdhabal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good !
Amit91848
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @C-W-D-Harshit


What does this PR do?
This PR addresses a UI bug on the update username modal at https://app.cal.com/settings/my-account/profile, where entering a very long username would break the layout. The fix includes applying a character limit on the username input field and ensuring long usernames are truncated with an ellipsis to prevent UI issues.
Loom Video: https://www.loom.com/share/5112a72ae42d4aae9bf42bf2aa4d20c3?sid=09aa27f8-b4f9-46b7-92be-e3a87aff80fe
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?