Skip to content

Conversation

@kammeows
Copy link
Contributor

@kammeows kammeows commented Apr 13, 2025

Fixes #3454 and #3456

Changes:

  • Imported useSelector from react-redux to access the global files state from the Redux store to read the current list of files and folders in the editor
  • Added a function named checkDuplicate that checks if there are any sibling files with same name in the parent folder and returns a boolean value.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

@kammeows kammeows changed the title Branch kamakshi Fix: Prevent duplicate file renaming in sidebar Apr 16, 2025
@kammeows
Copy link
Contributor Author

@raclim Currently, if a user tries to rename a file to a name that already exists in the same directory, the name simply reverts to the original without any visual feedback. No error message or dialog is shown.
Please let me know if a warning message, inline error text, or a dialog would be preferred to inform the user when renaming isn’t allowed.

@kammeows kammeows marked this pull request as draft April 16, 2025 12:28
@kammeows kammeows marked this pull request as ready for review April 16, 2025 13:24
Copy link
Collaborator

@raclim raclim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding these issues and suggesting these fixes for them! I really like the renaming on double-click implementation!

In terms of giving some sort of visual feedback or warning—I think maybe we can try what you currently have here for now and see how folks respond. Thanks so much again for your work on this!

@raclim raclim merged commit f9689fe into processing:develop Apr 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable file renaming via double-click in the sidebar

2 participants