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

Columns sorting - stay on the first result #25

Closed
btTeddy opened this issue May 14, 2023 · 16 comments · Fixed by #28
Closed

Columns sorting - stay on the first result #25

btTeddy opened this issue May 14, 2023 · 16 comments · Fixed by #28
Labels
help wanted Extra attention is needed

Comments

@btTeddy
Copy link

btTeddy commented May 14, 2023

Windows 10, latest transgui as of 14/05/2023

Current behaviour:

  • click on any column label to sort ascending/descending name for example
  • the list will scroll down or up as selection is persistent.
    To get to the top of the list need to scroll up through all of the torrents

Proposed behaviour:
Clicking on any column will unselect current torrent and so the first result will be on the top.

Actually quite hard to explain properly.
Basically it should behave like this example list:
https://hdvinnie.github.io/Private-Trackers-Spreadsheet/

@lighterowl lighterowl self-assigned this May 14, 2023
@lighterowl
Copy link
Owner

Thanks for the report. Yeah, I understand what you mean and it makes a lot of sense. It's actually the default behaviour in all other GUIs (i.e. not just torrent clients), I've just gotten so used to this particular quirk in TransGUI that I don't notice it anymore.

@lighterowl lighterowl linked a pull request May 15, 2023 that will close this issue
@lighterowl
Copy link
Owner

lighterowl commented May 15, 2023

Unfortunately, it doesn't look like it's possible to have nothing selected in TVarGrid if there's at least one row in it, or I can't figure out how to do this. The current code for sorting does preserve the current selection by saving its state in RowOptions and then restoring it after the sorting is done. However, LCL code in TCustomGrid.SetRow calls MoveExtend with ForceFullyVisible set to true, which then calls ScrollToCell which, unsurprisingly, scrolls the viewport so the selected row is visible. It doesn't look like this behaviour can be made runtime-dependent without making changes to LCL, so at least for now, setting the row means that the grid will automatically scroll to the selected row.

I disabled behaviour by setting the row to -1 after sorting if an extra property is set. This means that the first row in the table will be automatically selected after sorting, which may not be perfect but is still better than the current behaviour, I think.

The new behaviour is only active for the torrents table, I chose to keep the old behaviour in all other lists as I suspect not everybody will be 100% happy about this change.

You can download a build with this change at https://github.com/xavery/transgui/suites/12912061047/artifacts/697190047 .

@btTeddy
Copy link
Author

btTeddy commented May 15, 2023

Thanks for trying to get in to it. Really appreciate.

It works... kind of.
New behaviour works for a while, then after clicking couple of time on name label etc sorting completely stops to work. Literally does nothing. Manage to repeat the issue twice.... couldn't when I tried 3rd time.
Lets call it success.

Dzieki

@btTeddy
Copy link
Author

btTeddy commented May 15, 2023

New info.
This just showed up
image

@lighterowl
Copy link
Owner

Yeah, it's flaky as hell on Windows, I could see what you're describing as well. Worked fine when I tested it on Linux but that doesn't really help.

I have no other idea on how to approach this right now, sorry.

@lighterowl lighterowl added the help wanted Extra attention is needed label May 16, 2023
@lighterowl lighterowl removed their assignment May 16, 2023
@lighterowl
Copy link
Owner

I gave this another shot, will need some more work but looks promising so far. I didn't want to patch LCL code just for TransGUI but it seems like there's no other way and we're building everything from scratch anyway so why not.

@Beersteddy Can you try out this build? https://github.com/xavery/transgui/suites/13024903673/artifacts/705579187

@btTeddy
Copy link
Author

btTeddy commented May 20, 2023

@xavery
Testing it right now. I'll report any problems found.

Previous build wasn't that bad actually. Crashed once a while when left in background, but nothing major really. It was actually a good feature reminding me to close it :)
Really appreciate that you're trying to get it fixed and that you continue abandoned project.
Transgui is really outstanding for TM.

BTW.
Do you think is possible to convert transgui to webUI for transmission - just like combustion?

@lighterowl
Copy link
Owner

I don't do any web development so I'm not really the right person to ask. Lazarus has something called Pas2JS but I have no idea what it really does.

@btTeddy
Copy link
Author

btTeddy commented May 21, 2023

No worries.

So far I did have one single crash when left transgui running in the background for a very long while.
Overall works well enough for what I need.
Hopefully one day someone gonna port it to webui.
image

@lighterowl
Copy link
Owner

Very glad to hear, as mentioned before this needs some more work but I should be merging it this week if nothing comes up.

@lighterowl lighterowl linked a pull request May 21, 2023 that will close this issue
@lighterowl
Copy link
Owner

lighterowl commented May 21, 2023

No worries.

So far I did have one single crash when left transgui running in the background for a very long while. Overall works well enough for what I need. Hopefully one day someone gonna port it to webui. image

This seems to be transmission-remote-gui#1459 , so not necessarily related to my changes. Interestingly, the submitter reports using Lazarus 2.2.6.0, and I don't remember this issue occurring with official transgui builds which were built with older versions.

Anyhow, this is now merged by using my own fork of Lazarus/LCL which allows skipping the scrolling.

@garoto
Copy link

garoto commented May 22, 2023

Using the CI build posted by @xavery above (https://github.com/xavery/transgui/suites/13024903673/artifacts/705579187), the program crashes in about ~3 seconds once I minimize the program window, either to the (Windows) tray or justr a regular taskbar minimize.

I'm using Windows 8.1, but should it really matter? Odd if true.

Let me know if my transgui.ini or any other settings related to my Windows environment are needed.

Edit: https://x0.at/CS_H.mp4 (previous mp4 link replaced with a faststart one).

@lighterowl
Copy link
Owner

@garoto Thanks a lot. Looks like my gut feeling telling me not to make a new release right away was right this time...

I managed to reproduce the crash without even trying too hard. The only Windows-exclusive change which has been made in the last few weeks (both in my fork and the community project) was 76d3d6d and reverting it seems to make the crash go away.

Please try with the newest master build if you can : https://github.com/xavery/transgui/suites/13068302160/artifacts/708772515

@garoto
Copy link

garoto commented May 22, 2023

@xavery It seems your supposition is indeed correct! The build you linked above is running crash-free while tray-minimized for the past ~25min. Yay?

@btTeddy
Copy link
Author

btTeddy commented May 22, 2023

Same. Here. Works just fine, haven't noticed any problems so far.

Thanks xavery

@blacklion
Copy link

blacklion commented Nov 18, 2023

I think fixing this is a big mistake. Current "official" GUI build always left current torrent selected and it is VERY useful in many situations.

For example: you have torrents sorted by size, but want to see torrents with names similar to THIS torrent. You select THIS torrent and sort by name - you see all similar names, as THIS torrent still selected!

To go to top of the list you don't need to "scroll up through all of the torrents" you need to press "Home" button on keyboard once (or "End" for last torrent in the list).

IMHO, old behavior is much, much better. Losing selection is no-no, IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants