ratatui-org / ratatui

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

Consolidate `List::get_items_bounds` and `Table::get_row_bounds` #1215

Open kdheepak opened 1 week ago

kdheepak commented 1 week ago

Both List::get_items_bounds and Table::get_row_bounds perform similar enough tasks that I'm wondering if there's an opportunity to consolidate these. I think these are useful functions that a generalized version could be made pub. Related design question - is it possible to move these methods to the ListState or TableState?

More generally, Table and List have some overlap and it'd be nice to explore whether there is opportunities for more alignment. At the very least it'd be good to document when a user should use one or the other, what the tradeoffs are etc.