minttea
minttea copied to clipboard
Components Wishlist (from Bubbles)
Having a nice little library of components to reuse would be amazing, and Bubbles has a nice list that we can just port over:
- [x] cursor
- [x] spinner
- [x] text input
- [ ] text area
- [x] table (even virtualized!)
- [x] progress bar: we have something here, not amazing yet but its a good start
- [x] paginator
- [x] list with filtering
- [ ] a toggleable help bar
- [ ] key bindings component to help declaratively map keys to actions
- [x] checkbox – just a tiny little checkbox :)
Spinner added in #13. 🔥
I began looking at what would be required for text input.
textinput in bubbles makes use of bubbletea itself. This makes one able to simply forward the events to the textinput component. What are your thoughts on doing the same? The alternative would be to simply expose commands from the textinput and map the events yourself. This however, feels like it could become quite cumbersome.
E.g. bubbles does this:
match event with
| e ->
(* do other stuff *)
let new_text_input = Text_input.update e in
{ model with text_input = new_text_input }
The alternative, if you want leaves to be stand-alone (unless we separate the events), one would have to do this:
match event with
| KeyDown Left ->
let new_text_input = Text_input.character_backward model.text_input in
{ model with text_input = new_text_input }
| ...
I think you made the right call with taking the Event.t and making Leaves depend on MintTea 🙏🏼
I'm starting on a paginator component :)
Forgot to mention this issue in my PR, but Paginator is done for anyone looking at this list.
I would love to have a "Menu" https://github.com/p-gen/smenu