ratatui-org / ratatui

Rust library that's all about cooking up terminal user interfaces (TUIs) 👨‍🍳🐀
https://ratatui.rs
MIT License
8.86k stars 269 forks source link

feat(list)!: add list navigation methods (first, last, previous, next) #1159

Closed joshka closed 1 week ago

joshka commented 1 month ago

Also cleans up the list example significantly (see also https://github.com/ratatui-org/ratatui/issues/1157)

Fixes: https://github.com/ratatui-org/ratatui/pull/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.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.4%. Comparing base (3f2f2cd) to head (e7935cf).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1159 +/- ## ===================================== Coverage 94.4% 94.4% ===================================== Files 62 62 Lines 14941 14991 +50 ===================================== + Hits 14110 14160 +50 Misses 831 831 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

joshka commented 1 week ago

Rebased on main, added breaking changes docs, updated commit message and PR comment to note breaking change.