osa1 / tiny

A terminal IRC client
MIT License
997 stars 59 forks source link

Implement wrapping for the tab line #125

Open osa1 opened 5 years ago

osa1 commented 5 years ago

Currently if I have more tabs than what fits on the screen we draw left and right arrows and implement scrolling. It looks like this:

screenshot_2019-02-20_08-59-22

I implemented this but I never really needed it as I wasn't joining too many channels/servers. But now I do, and I realize that while this look OK it's really hard to use:

So I think it'd be better to render channels in multiple lines when they don't fit in one line.

No need to remove the current behavior -- we can put it behind a setting in the config file. Also, we may want to use the current behavior when the screen is too small to allocate multiple lines to the channel list.

trevarj commented 4 years ago

I was hoping that this would be my next task, but after some tinkering I got stuck at a design decision.

Allowing the tabs to wrap is actually really simple, and I have already built a TabWidget for the TUI to contain all the relevant code for this in its own space.

Personally, I don't like the horizontal scrolling at all, even for fallback. I think it would be nice to rip out all of the horizontal scrolling logic and convert it to vertical scrolling, which would only be used when the screen is small and the tab line is a certain size (maybe greater than 1/6th of the total screen height?). I think that a vertical scroll would be simpler to implement, but the negative side is that you don't see as many tabs in scroll mode.

I also would like to add a control to hide/show the tab line, which could also be useful for when the screen is small. This control could also function as an "expand" to make the tab line full size when it is in scroll mode.

Vertical scroll idea:

Full view (or "expanded" tab line mode):

|                      |
|                      |
|osa1:                 |
|mentions #line1       |
|#random #line2 #chan  |
|#line3 #mychan        |

Middle line (small screen):

|                      |
|                      |
|osa1:                 |
|#random #line2 #chan ↕|

Top line (small screen):

|                      |
|                      |
|osa1:                 |
|mentions #line1      ↓|

Bottom line (small screen):

|                      |
|                      |
|osa1:                 |
|#line3 #mychan       ↑|