You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For my scrabbler TUI, I wrote an internal bubble called gridmenu, which as the name implies, renders a list of elements as a multidimensional grid, intended to be used as a selection "menu".
I think this could be a nice addition to this repo, instead of sitting in the internal/ package of my own project.
I'd be interested to get some feedbacks from the community and maintainers about the current implementation, which could most certainly be improved and refactored to be more generic to be used by others.
I'd be willing to work on the eventual refactors needed if that's something that you might get interested int.
The current implementation comes with several features:
The grid size is configurable, both in terms of column and width size.
The grid is "reactive", it adapts automatically to the size of the window, and will shrink accordingly if the number of rows requested cannot be rendered (length of items to render taken into account).
The grid is navigable with arrows keys.
Some edge ares are covered, such as uneven elements on the last lines: navigating from position (ax y/x) 4/4 to 5/4 (for a 4x5 grid) will take into account that there might be no element into that position if the last line contains less than 4 items and "redirect" to the 5/x position which contains an item.
I think it might be best to simply test the TUI directly (the interesting part, the gridmenu is rendered first) to get a feeling of how it works.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey,
For my
scrabbler
TUI, I wrote an internal bubble called gridmenu, which as the name implies, renders a list of elements as a multidimensional grid, intended to be used as a selection "menu".I think this could be a nice addition to this repo, instead of sitting in the
internal/
package of my own project.I'd be interested to get some feedbacks from the community and maintainers about the current implementation, which could most certainly be improved and refactored to be more generic to be used by others.
I'd be willing to work on the eventual refactors needed if that's something that you might get interested int.
The current implementation comes with several features:
I think it might be best to simply test the TUI directly (the interesting part, the gridmenu is rendered first) to get a feeling of how it works.
Beta Was this translation helpful? Give feedback.
All reactions