Skip to content

Renaming a file to an existing sibling name doesn’t prevent the rename #3456

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

Open
kammeows opened this issue Apr 16, 2025 · 0 comments
Open
Labels

Comments

@kammeows
Copy link
Contributor

p5.js version

1.11.1

What is your operating system?

Windows

Web browser and version

132.0.6834.160

Actual Behavior

When a user tries to rename a file or folder to a name that already exists in the same parent directory, the editor does not consistently prevent the action.

Image

Here, I'm renaming sketch.js to style.css and it lets me rename, which is an incorrect behavior:

Image

Similarly, it lets me create folders with same names and files within those folders with the same name:

Image

Expected Behavior

If a user attempts to rename a file/folder to a name already used by a sibling in the same folder:

  • The input should reject the change, and
  • The invalid name should not be accepted or committed under any circumstances

Steps to reproduce

Steps:

  1. Open the sidebar file tree in the p5.js Web Editor.
  2. Create two files/folders under the same parent folder (e.g., File1.js, File2.js).
  3. Double-click File1.js to rename it to File2.js
  4. Press "Enter" or click away.
  5. Observe that the rename is accepted incorrectly
@kammeows kammeows added the Bug label Apr 16, 2025
kammeows added a commit to kammeows/p5.js-web-editor that referenced this issue Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant