Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(leaves): New list component. #35

Merged
merged 1 commit into from
Mar 5, 2024
Merged

feat(leaves): New list component. #35

merged 1 commit into from
Mar 5, 2024

Conversation

Lattay
Copy link
Contributor

@Lattay Lattay commented Feb 12, 2024

Hi,

I'd like to get some feedback on this proposal of list component.

What is implemented:

  • The component shows a paged list of item with a cursor.
  • The cursor can be moved with arrow keys and hjkl.
  • The current element can be selected with space.
  • The list of elements can be retrieve from the model.
  • A filter can be applied (the example demonstrate this with a Text_input) to temporarily hide elements.

What is not implemented:

Also, I couldn't get the dev version of minttea to build (independantly of my modifications, something wrong with the versions of Riot and libc and other I think), so I only tested the component and the example with commit 87c8072 (that is release 0.0.2).
This is the main reason why I consider this to be WIP.

@leostera
Copy link
Owner

Thanks for opening the PR @Lattay! ✨ – I'd really appreciate if you can record a demo for this new component in an example so its obvious what it does and we can feature it in the examples index page.

To record you can install VHS and run vhs demo.tape, assuming you copied over some of the demo.tape files from the other examples and adjusted them a little.

@Lattay
Copy link
Contributor Author

Lattay commented Feb 12, 2024

Ok, so... now that I have updated to riot 0.0.8 and stuff, my example is broken in a very weird way. It makes me thinh about a race condition somewhere because it is pretty random:

  • sometime the program returns immediately before writing anything
  • sometime it prints nothing but hangs
  • sometime it prints the first view and hangs
  • one time it ran normally (I think)

Investigating that now...

@Lattay Lattay changed the title [WIP] feat(leaves): New list component. feat(leaves): New list component. Feb 25, 2024
The list can be filtered, and elements can be selected.
@Lattay
Copy link
Contributor Author

Lattay commented Feb 25, 2024

Hi,

The previously mentionned bug seems to be solved in 0.0.3 version.

Here is a demo of the list component.

demo

Note that for some reason (unrelated to the component) the "Pick your favorite food" line is not cleared properly before printing the selection at the end.

@leostera leostera added the enhancement New feature or request label Feb 28, 2024
@leostera
Copy link
Owner

leostera commented Mar 5, 2024

Hi @Lattay! This looks fantastic ✨ – thanks a million for contributing! Merging it now.

@leostera leostera merged commit 706dd48 into leostera:main Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants