Clicking on the user-menu button breaks the screen layout
p5.js version
No response
What is your operating system?
Windows
Web browser and version
Brave, Chrome & MS Edge
Actual Behavior
Clicking on the user menu button breaks the screen layout.
https://github.com/user-attachments/assets/1656160b-f2fa-40b3-901f-29341c8f40a6
Expected Behavior
Screen layout should be stable on clicking the user menu button.
https://github.com/user-attachments/assets/3012ec20-b20b-4b4f-8f49-fb535cfc2251
Steps to reproduce
- Open the v6 sandbox editor
- Click on the user-menu button
- See the unstable layout.
hi @aadityasingh9601, thank you for reporting this.
i tried reproducing the issue and found that it does not appear to be CM6-specific. the root cause seems to be that the username text in the user menu button is not properly truncated, which causes the dropdown position to shift depending on the username length.
for example:
- with smaller usernames such as "test", the toggle button shifts to the right, causing horizontal scrolling.
- with longer usernames, the user menu button becomes wider and the dropdown shifts to the left instead.
the user menu button should ideally have a uniform width, with the username text truncated appropriately.
also, could you please remove "[CodeMirror v6]" from the issue title, since this does not seem related specifically to CM6?
hi @aadityasingh9601, thank you for reporting this.
i tried reproducing the issue and found that it does not appear to be CM6-specific. the root cause seems to be that the username text in the user menu button is not properly truncated, which causes the dropdown position to shift depending on the username length.
for example:
- with smaller usernames such as "test", the toggle button shifts to the right, causing horizontal scrolling.
- with longer usernames, the user menu button becomes wider and the dropdown shifts to the left instead.
the user menu button should ideally have a uniform width, with the username text truncated appropriately.
also, could you please remove "[CodeMirror v6]" from the issue title, since this does not seem related specifically to CM6?
Hi @skyash-dev, thanks for looking into this properly.
Now I get what might be the issue here, let me remove the "[CodeMirror v6]" from the issue title.
Hi, I’d like to work on this issue if it’s approved by the maintainers.
Based on the investigation above, I can try fixing the user menu button width and truncating the username text so the layout does not shift for short or long usernames.
Go for it @shubham09-patel !
is anyone is working on this issue ?
Hi @shubham09-patel! & @clairep94 I'd be happy to contribute to this issue as my first contribution to the p5.js Web Editor. I've read the discussion and understood that the likely cause is that the username isn't being truncated correctly, causing the usermenu button's width. I have been waiting for a weak,as I noticed that the issue is assigned to you, so I wanted to check whether it's still actively being worked on or whether it would be okay for me to work on a focused solution., Thanks!
so basically I THINK we can do ANY ONE FROM two fixes, 1: user-name minLength:4 2: providing some more margin-right for user-main div, WHICH IS BETTER OR IS THERE ANY OTHER BETTER APPROACH.. @skyyash
i think we can just truncate the username.
something like this:
.truncate {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}
really appreatiate your help and quick response❤️ brother @skyyash @clairep94 , i tried my best to get your approach, but i couldn't. and i think there is not much need of ellipsis, as the problem is with short names,
https://files.catbox.moe/nolznp.mp4
Although i got really good idea which is working very fine without disturbing other things, diffrent from those 2 which i said before. just adding min-width to usermenu nav_right.
I'm ready with pr. should I create ?