minttea icon indicating copy to clipboard operation
minttea copied to clipboard

Components Wishlist (from Bubbles)

Open leostera opened this issue 1 year ago • 6 comments

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 :)

leostera avatar Dec 14 '23 02:12 leostera

Spinner added in #13. 🔥

sabine avatar Dec 20 '23 23:12 sabine

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 }
| ...

lessp avatar Dec 25 '23 14:12 lessp

I think you made the right call with taking the Event.t and making Leaves depend on MintTea 🙏🏼

leostera avatar Dec 25 '23 20:12 leostera

I'm starting on a paginator component :)

metame avatar Feb 12 '24 20:02 metame

Forgot to mention this issue in my PR, but Paginator is done for anyone looking at this list.

metame avatar Mar 12 '24 17:03 metame

I would love to have a "Menu" https://github.com/p-gen/smenu

davesnx avatar Oct 22 '24 07:10 davesnx