Skip to content

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

Open
@kammeows

Description

@kammeows

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions