p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

Clicking on the user-menu button breaks the screen layout

Open aadityasingh9601 opened this issue 7 months ago • 9 comments

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

  1. Open the v6 sandbox editor
  2. Click on the user-menu button
  3. See the unstable layout.

aadityasingh9601 avatar Apr 22 '26 10:04 aadityasingh9601

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?

skyyash avatar May 17 '26 13:05 skyyash

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.

aadityasingh9601 avatar May 18 '26 05:05 aadityasingh9601

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.

shubham09-patel avatar May 23 '26 14:05 shubham09-patel

Go for it @shubham09-patel !

clairep94 avatar Oct 02 '26 17:10 clairep94

is anyone is working on this issue ?

ShivCodes911 avatar Oct 03 '26 19:10 ShivCodes911

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!

07mastermind avatar Oct 10 '26 06:10 07mastermind

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

Image Image

07mastermind avatar Oct 10 '26 07:10 07mastermind

i think we can just truncate the username.

something like this:

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

skyyash avatar Oct 10 '26 07:10 skyyash

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. Image I'm ready with pr. should I create ?

07mastermind avatar Oct 10 '26 10:10 07mastermind