Skip to content

Fix: Prevent duplicate file renaming in sidebar #3455

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
wants to merge 7 commits into
base: develop
Choose a base branch
from

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
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
1 participant