openscopeproject / TrguiNG

Remote GUI for Transmission torrent daemon
GNU Affero General Public License v3.0
372 stars 47 forks source link

Ability to "select none" and "select all" in a torrent's files tab? #29

Closed Pentaphon closed 1 year ago

Pentaphon commented 1 year ago

Right now, we have to check the box for each file individually to select or deselect all the files when adding a torrent or in the files tab. It would be nice to have:

1) A shortcut to select none of the files in the files tab (so we can quickly select just 1 file we want after that) 2) A shortcut to select all of the files in the files tab (so we can select all the files with one click if we want to reverse selecting none)

Thanks.

melyux commented 1 year ago

This would hopefully be for both when adding a new torrent and in the files tab of an existing torrent, though the former is more important

Pentaphon commented 1 year ago

This would hopefully be for both when adding a new torrent and in the files tab of an existing torrent, though the former is more important

Yes, I should have mentioned that.

qu1ck commented 1 year ago

You mean the "file wanted" checkbox, not selection. I was confused there for a seconds since ctrl-a works.

Pentaphon commented 1 year ago

You mean the "file wanted" checkbox, not selection. I was confused there for a seconds since ctrl-a works.

Sorry, yes, the file checkboxes are what need to be select none or all. Really helps with working with lots of files.

melyux commented 1 year ago

Would be cool if we could press Space to check/uncheck all currently selected files as well

qu1ck commented 1 year ago

No space to toggle because shortcuts are a PITA in web and it gets messy when your selection is mixed with checked/unchecked/partial. But I've added explicit buttons and menu items to add dialog and files table in details correspondingly.

melyux commented 1 year ago

I like it. Idk about the web thing, but usually this is handled by this state machine:

If all of the selection is checked, space unselects them. If all of the selection is unchecked, space selects them. If the selection is mixed, space selects them.

The "Set wanted" and "Set unwanted" items in the right click menu are good, but they don't work in the torrent addition file selection dialog?

qu1ck commented 1 year ago

Yeah I came up with that too. The tricky part is binding and unbinding the key press handlers at the right time so that it intuitively works when you want it to and doesn't when you don't expect it to. For example naive approach of binding space would result in presses in add dialog also triggering files table changes. Because web does not have concept of keyboard events starting at focused element and bubbling up to whatever catches them, it has no idea you "target" that space press at the add dialog. It's possible to work around and I did for other shortcuts but this one would need more situations to take care of.

Also space is commonly used for keyboard navigation in accessibility. I won't pretend that I've put a lot of effort into making the app usable without a pointing device but at least the UI lib I'm using should work well with it and overriding space keypress will definitely break stuff.

qu1ck commented 1 year ago

Implemented in v0.6.0.

Pentaphon commented 1 year ago

@qu1ck how do we select all or select none in 0.6.0? Right now it just has a context menu that says set wanted or set wanted for individual files.

qu1ck commented 1 year ago

Ctrl-A to select all (after selecting one) and then use the menu.

Pentaphon commented 1 year ago

Ctrl-A to select all (after selecting one) and then use the menu.

Thanks.