EdJoPaTo / grammy-inline-menu

Inline Menus for Telegram made simple. Successor of telegraf-inline-menu.
MIT License
354 stars 46 forks source link

Using a menu as its own submenu for unlimited or unknown levels of multi level choice #129

Closed eedea closed 3 years ago

eedea commented 4 years ago

Is your feature request related to a problem? Please describe. There are some cases we need to ask user for similar data several times (Ie. user wants to choose from a list of categories and subcategories of selected category and goes down as much as they want. In these cases we cannot make several hard coded menus since number if submenus are unknown. Describe the solution you'd like I think it would be easier being able to use same menu (with dynamic function for its unique string) as its own submenu (maybe with an argument for setting its unique string or using context.match data for that reason) Describe alternatives you've considered I didn't check this solution yet, but I think it's possible to use a generate a submenu and return it as an argument for chooseToSubmenu method. Additional context the case I described is something like this tree:

Products Menu Show all products > products list
                     Category1
                    |
                    Category2
                    .               |
                    .              Show products of this category > products list
                    .               |
                                    SubCat1
                                    |
                                    SubCat2
                                     .             |
                                     .            Show products of this category > products list
                                     .             |
                                                   SubSubCat1
                                                   |
                                                   SubSubCat2
                                                   .                   |
                                                   .                   .
                                                   .                   .
                                                                       .
EdJoPaTo commented 4 years ago

Just do spread an idea here: How about two menus for this? One is a selection menu, One is the info menu of the selection. This way you do not have a high depth and the user can see everything in one place.

When the user first enters the menu it displays the Category selection. When the user clicks on one category the selection hides and instead a "clear category x" appears. Below is now shown a subcat selection (when available).

At the end the can be the product list applying for the selected category, subcategory and so on. Deep menus always tend towards being not as easy to get by users. "Where am I?" as they only see one message, not a tree structure.

Maybe that idea already solves this kind of problem?

eedea commented 4 years ago

For "Where am I?" question, I would add a path in body of menu (something like "you are in 'Foods>Main dishes>FastFood" That aside, I think your suggestion will be useful for this specific example of mine and I cannot think of any other scenario in which It doesn't work.

EdJoPaTo commented 3 years ago

I'll just close this due to inactivity. If you have any questions feel free to ask ahead!