Closed IAmJSD closed 2 years ago
The issue with the current packages in my opinion is the following:
1) They don't support everything we need. Recent additions to Bubble Tea have got closer to what we need, but not close enough for the table list view with search for example. 2) If we were to combine packages to achieve what we need, it would make the codebase extremely complex. For example, in the virtual machine builder we may need to combine several console libraries. 3) A lot of the current libraries are not designed to be unit tested and have very low test coverage themselves.
If we can overcome those issues I'm for switching to a library, but I don't know we can really.
I'm not sure we need to fully mix and match and combine different TUI libraries, cause I agree that would be horrible :)
But from what I can tell, something like tcell might be a good foundation to still hand-roll stuff on top of, if it can handle things like drawing/re-drawing, auto-resizing boxes/elements, etc., allowing us to focus on what should be displayed, rather than how we make it display correctly. If we still have to implement things ourselves on top of that, I think that's fine. At the very least, I think some basic console drawing libraries might help make our lives easier, instead of manually handling all re-draws and updates to the screen.
That said, I haven't used any of the libraries myself that I suggest, they simple seem like the go-to solutions. tcell does look pretty promising, for example fzf uses it.
And I just noticed there's tview built on top if tcell, which sounds promising, to quote the readme:
Among these components are:
- Input forms (include input/password fields, drop-down selections, checkboxes, and buttons)
- Navigable multi-color text views
- Sophisticated navigable table views
- Flexible tree views
- Selectable lists
- Grid, Flexbox and page layouts
- Modal message windows
- An application wrapper
Cleaning up the final questions in the CLI was a suggestion by Adam. This does this by cleanly showing the other options in a form-like component.