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

[UX] File and folder renaming fails silently on validation errors

Open Dakshx07 opened this issue 5 months ago • 2 comments

p5.js version

Latest (develop branch)

What is your operating system?

Mac OS

Web browser and version

Any (Chrome / Firefox / Safari)

Actual Behavior

When renaming a file or folder in the sidebar, if the new name violates validation rules (e.g. is empty, a folder containing a dot, or a file with an invalid/missing extension), the name silently reverts to its previous state without any explanation or notification to the user.

Expected Behavior

The editor should display a toast notification explaining the validation error (e.g., "Folder name cannot contain an extension", "Please enter a name", or "Invalid file type..."), rather than silently resetting the name.

Steps to reproduce

  1. Open a sketch in the p5.js Web Editor.
  2. Double-click an existing folder in the sidebar to rename it.
  3. Type a name containing a dot (e.g. assets.js) and press Enter or click away.
  4. Observe that the folder name silently reverts to the original name without any toast/notification.
  5. Alternatively, rename any file or folder to an empty name (or spaces only) and press Enter/click away, observing the same silent revert.

Dakshx07 avatar Jun 14 '26 12:06 Dakshx07

Hey @Dakshx07, it’s usually better to wait until the maintainer has reviewed before opening a PR. That way, the changes can be aligned with their feedback and avoid unnecessary revisions.

Jatin24062005 avatar Jun 17 '26 19:06 Jatin24062005

I would like to work on this issue if available.

VikasKSingh05 avatar Jun 21 '26 09:06 VikasKSingh05