tui-rs icon indicating copy to clipboard operation
tui-rs copied to clipboard

Handle tab overflow

Open meain opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. If on a small screen and I have a lot of tabs, there is no good way to see the items if they are out of the screen width.

Describe the solution you'd like I am not sure the best way to handle this, but something like a scroll for tabs would be a nice to have. As in when the uses goes to the right and selects a tab that is not visible we bring that to the visible area and hide the ones which were on the left. Maybe we could even add arrows or some indicator at either ends which will show if there are things that are invisible in either ends.

Describe alternatives you've considered Drop and add tabs based on the user switching, but it is kinda messy.

meain avatar Jun 20 '20 10:06 meain

This can indeed be a problem for a large numbers of tabs. I actually think your alternative solution might be more intuitive and more friendly to keyboard only workflows.

fdehau avatar Jun 28 '20 13:06 fdehau

What is your opinion on managing that logic in the library?

We should be able to decide on if something is visible or not based on the number of chars each tab takes and the width. I am not entirely sure how I would go about adding that in but I could probably take a stab at it some time if you think that would be a good addition to the library.

meain avatar Jun 28 '20 13:06 meain

I think that we could introduce a TabsState to save the previous selected tab and provides a nice scrolling experience. Then it is pretty much the same logic as the List but on the horizontal axis and with items of variables length.

fdehau avatar Jun 28 '20 14:06 fdehau

Is this issue still open to solve?

I'd like to take a shot at implementing it.

pmk21 avatar Jun 01 '21 11:06 pmk21