atom / tree-view

🌳 Explore and open project files in Atom
MIT License
561 stars 364 forks source link

Add popup explaining root cannot be renamed, and add tests to verify fix. #1383

Closed BlaiseAJohnson closed 3 years ago

BlaiseAJohnson commented 3 years ago

Requirements

Description of the Change

In the method removeSelectedEntries (tree-view.coffee: 616) there is a piece of logic which opens a confirmation box explaining that a root directory cannot be deleted. This pull request would implement that logic in the method moveSelectedEntry (tree-view.coffee: 554) explaining that a root directory cannot be named. Before this pull request's changes, upon attempting to rename a root directory, simply nothing happens.

Alternate Designs

In my initial research of the code base, I attempted to find out if there was a way to make a root directory able to be renamed. During my research I came to the conclusion that it wasn't possible for similar reasons that a root directory cannot be deleted, and instead opted to provide feedback to the user on there attempt.

Benefits

Feedback will be given to the user when he or she attempts to rename a root directory. Before this pull requests changes, no such feedback was given, contributing to the feeling that the feature was bugged since there was no explanation as to why no action was being taken. This pull request should eliminate that feeling.

Possible Drawbacks

This pull request is not impactful enough to affect the code base in any negative way that I can imagine. The only drawback I can think of would be on the side of the user.

Applicable Issues

179