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

Rework main menu to be easier for maintaining #209

Closed

Conversation

pecataToshev
Copy link
Contributor

Currently all of the code that prints the menu is hard to follow. There is a dict with the number to function, but some of them are hidden in a sub-menu. This is hard for maintaining and you need to change multiple things to get one more option.

This being said, I've reworked the menu to:

  1. Not use recursion. It was hard to follow and was checking only once for updates - on application start. This logic remains the same.
  2. Allow nested menues to be easier to read and maintain. In the proposed implementation the each menu item is represented as an list. The first argument is the title to display to the user, and the second one - either a function or an array of menu items. This way we represend the submenu.
  3. Added refresh function to allow only refreshing the process table without executing a function

@ElieTaillard ElieTaillard added the release notes Items are likely to be highlighted in the release notes. label Jan 4, 2024
@ElieTaillard ElieTaillard added this to the 6.7.0 milestone Jan 4, 2024
@pecataToshev pecataToshev deleted the fix-main-menu branch January 4, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes Items are likely to be highlighted in the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants