Skip to content
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

Press "d" to remove version in menu #590

Merged
merged 5 commits into from
Oct 23, 2019

Conversation

thomasruiz
Copy link
Contributor

Pull Request

Problem

It is quite hard to remove a bunch of previously installed versions without using prune. If I want to keep multiple versions, I cannot do that easily.

Solution

You can now press d to remove versions in the menu. You cannot remove the currently active node.

ChangeLog

You can now press d to remove versions in the menu. You cannot remove the currently active node.

@shadowspawn
Copy link
Collaborator

Saw suggested in this old issue: #139

@shadowspawn
Copy link
Collaborator

shadowspawn commented Oct 13, 2019

Is there a reason to prevent deleting the active version? It complicates the code and description, and I don't think is needed. (In older versions of n there was some code to prevent deleting the active version using n rm because it caused drawing errors in the menu, but the drawing problems have been fixed.)

@shadowspawn
Copy link
Collaborator

(Disclaimer: I have not tried running the code yet! Opening the discussion after reading the code. Thanks.)

@thomasruiz
Copy link
Contributor Author

Is there a reason to prevent deleting the active version? It complicates the code and description, and I don't think is needed. (In older versions of n there was some code to prevent deleting the active version using n rm because it caused drawing errors in the menu, but the drawing problems have been fixed.)

Well, there's a bit of a bug when you delete the active version, as you can see on the gif below. After I delete node 10 (which is the active version), no version is selected, and you have to press down or up two times to get to the top or bottom of the list. However, I can change the code to select the previous/next version automatically.

Besides, if you delete all the versions, you end up on an empty screen. Then again, the code can be changed to exit when there is no installed version anymore.
n-delete-current-version

@shadowspawn
Copy link
Collaborator

Ah, I was wondering what the post-delete behaviour was, now I see the

display_versions_with_selected "${g_active_node}"

However, I can change the code to select the previous/next version automatically.

I think that is going to be nicer all the time. If for example you are deleting a bunch of 8 versions now 10 is out. Scroll to the 8s and hit d a few times and don't have to keep scrolling after each delete to get back to the old versions.

@thomasruiz
Copy link
Contributor Author

@shadowspawn It's all done. The UX is much better now!

I can rebase this PR to contain only 1 commit if you want.

@shadowspawn
Copy link
Collaborator

I gave it a bit of a try and liking it. I'll merge it in sometime this week. Thanks.

@shadowspawn shadowspawn merged commit 4e6ee60 into tj:develop Oct 23, 2019
@thomasruiz thomasruiz deleted the feat/rm-on-menu branch October 23, 2019 08:01
@shadowspawn
Copy link
Collaborator

FYI @thomasruiz: I am planning to do a release this weekend with this new feature.

@shadowspawn
Copy link
Collaborator

Released 6.1.0. Thanks @thomasruiz for your contributions.

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.

2 participants