-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Consistent examples in ratatui #1157
Comments
I was thinking about the same today - a good place for this might be to add a small comment box on the website - e.g. if we move the examples to the website (ratatui/ratatui-website#619) then that becomes a good place to solicit info. A simple thumbs up / down / with a textbox that posts to a kv store on cloudflare might be enough for this. There were also some suggestions just today on hn about feedback form approaches https://news.ycombinator.com/item?id=40524501 |
I refactored the list example in #1159 quite a bit. I've been reading the bevy docs, and examples quite a bit recently, one thing I noted was that they have a bunch of examples on the same topic, some simple, some more advanced. I'd caution against making everything simple or converting it into a tutorial, as there's a lot of work going from example to tutorial well. I'd say a good middle ground would be webpages that have
|
Also cleans up the list example significantly (see also <#1157>) Fixes: <#1159> BREAKING CHANGE: The `List` widget now clamps the selected index to the bounds of the list when navigating with `first`, `last`, `previous`, and `next`, as well as when setting the index directly with `select`. fix: integ test
ratatui#1159) Also cleans up the list example significantly (see also <ratatui#1157>) Fixes: <ratatui#1159> BREAKING CHANGE: The `List` widget now clamps the selected index to the bounds of the list when navigating with `first`, `last`, `previous`, and `next`, as well as when setting the index directly with `select`.
Problem
On discord, we mentioned there was an issue with examples being inconsistent. I wanted to open an issue to track it.
Some of my thoughts are below. I think we need a few different kinds of examples:
As an example, compare
examples/paragraph.rs
andexamples/list.rs
. IMO,paragraph.rs
falls under the category of showing features of theParagraph
widgetlist.rs
falls into the category of showing how to build a simple TODO application on top of theList
widget while showcasing theList
andListState
functionality.There's a complexity difference between these two categories.
Suggestions:
Perhaps the
list.rs
example works better as a tutorial than an example?Examples that fall into category 1 should make it extremely easy for anyone to experiment with different features offered by said widget in Ratatui. To debug a problem on discord, I tried to start with the
list.rs
example but found it was too complicated to experiment with, and it was faster to write the following from scratch:We should solicit more input from users on what kinds of examples they find useful.
The text was updated successfully, but these errors were encountered: