Skip to content
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

Double click column divider to auto resize column #52

Open
TinFoilFox opened this issue Jul 26, 2023 · 7 comments
Open

Double click column divider to auto resize column #52

TinFoilFox opened this issue Jul 26, 2023 · 7 comments
Labels
wishlist Low priority nice to have features

Comments

@TinFoilFox
Copy link

I would love the ability to double click the column divider to auto resize the column to the size of the longest row. I am coming from Transmission Remote GUI and it is a very small but very appreciated quality of life feature.

Thank you for the work you've done so far :)

@qu1ck
Copy link
Member

qu1ck commented Jul 26, 2023

This was discussed in #31 even though it was mostly about resizers not appearing.

TLDR is auto sizing is difficult to implement and has limited use in practice because data is dynamic.

Maybe I'll add it some day but don't expect it soon.

@qu1ck qu1ck added the wishlist Low priority nice to have features label Jul 26, 2023
@qu1ck qu1ck changed the title Wishlist: Double click column divider to auto resize column. Double click column divider to auto resize column Jul 26, 2023
@melyux
Copy link
Contributor

melyux commented Jul 27, 2023

Just to clarify, you double click it to expand to the current widest content in the column. Later, if you see new content in the column that's even wider, you double click again to expand the column again, bringing you closer to the perfect width. For these kinds of UIs, it's essential for saving space, so isn't quite so limited use in practice

@qu1ck
Copy link
Member

qu1ck commented Jul 27, 2023

Yeah, except law of large numbers will make it so that you will always have top 1 percentile with a lot longer content than bottom 90 percentile. So you have to choose between wasting a lot of space and showing the content of longest row or making the column much more compact and showing full content 90% of the time. Or 95, or 80, everyone will pick their own balance point. No auto sizing is going to help you there, that's what I mean by limited use. It's great for columns with static or fixed max width but you only have to manually set their width once anyway.

And it's hard to implement because unlike native gui toolkits where everything is measured in pixels and inherently has it's "best size" so all you have to do is just add up the widths of column contents, web doesn't work that way. There are pixels and ems and collapsing margins and adaptive padding and whole host of layout stuff to take into account, convert and calculate. One could take the easy way out and just calculate text width + some fixed spacing and it will work most of the time but will be annoyingly off point some times.

So the way I see it, it's non-trivial effort for trivial benefit (double click instead of quick drag one time when setting up the app).
If you find yourself resizing the columns a lot (aside from name column, I guess, that one has the most variability in width) then let me know your use case.

@melyux
Copy link
Contributor

melyux commented Jul 27, 2023

I get the whole web thing since the Web UI shares code with the native app. And I don't mind the few sub pixels I lose in efficiency without the double click. But what makes it pretty bad is that the app doesn't show you how the column is going to look until you let go of your drag. You just spray and pray. So it's not the best experience resizing columns. If the column resized live as you dragged, then honestly I'd still want the double click but somewhat less

qu1ck added a commit that referenced this issue Jul 27, 2023
@qu1ck
Copy link
Member

qu1ck commented Jul 27, 2023

Valid point, I added a resizing guide to help with the aim.

qu1ck added a commit that referenced this issue Jul 27, 2023
@qu1ck
Copy link
Member

qu1ck commented Jul 27, 2023

And made them resize live. Was initially worried about performance but lag is barely noticeable.

@nicknlsn
Copy link

nicknlsn commented Sep 9, 2023

Live resizing is working great. Regarding the double clicking to resize, most columns have content who's width is very similar the whole way through. Double clicking those columns is very useful because you often want them to be as small as possible and still show you their data. The name column is obviously super variable and not a good use case for this. But most of the other columns make a good use case for this in my opinion.

Also, since it's hard to get the calculations just right for a web UI, I would be ok if it was just close enough. If there are only a few rows that don't show every thing, or if you err on the side of slightly too much space, I would be ok with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wishlist Low priority nice to have features
Projects
None yet
Development

No branches or pull requests

4 participants