Skip to content

Conversation

@al3rez
Copy link

@al3rez al3rez commented Aug 25, 2025

Summary

  • Fixed pagination issue where the selected version would reset to index 0 when loading more releases
  • Now only sets the index to 0 on initial page load, preserving user selection during pagination

Problem

When users clicked "Load more..." to fetch additional releases, the version dropdown would reset to the first item (index 0), losing the user's current selection. This was frustrating when browsing through multiple pages of releases.

Solution

Added a check to only set setCurrentIndex(0) when loaded_page == 1 (initial load). This preserves the user's selected version when loading additional pages.

Test plan

  • Open installer dialog and select a compatibility tool
  • Select a version from the dropdown
  • Click "Load more..." at the bottom of the version list
  • Verify the selected version remains unchanged after loading more releases
  • Verify the first version is still selected by default on initial load

@sonic2kk
Copy link
Contributor

This change does not appear to work as expected. When selecting a version and then clicking "Load more...", the version dropdown displays a blank value. I tested this with GE-Proton and Luxtorpeda. In fact, this happens even if you don't select a version.

image

We may need to remember the previous index, not avoid setting the selected index altogether. Maybe we need to include this optionally when calling _threadupdate_releases_thread, but that's just a quick guess from skimming and vaguely remembering how this part of the code works. 😅

When clicking 'Load more...' to fetch additional releases, the version
dropdown would show a blank selection after removing the 'Load more...'
item and adding new versions.

This fix saves the current selection index before removing the last item
and restores it after adding new releases, ensuring the user's selected
version remains visible during pagination.
@al3rez al3rez force-pushed the fix/pagination-version-reset branch from 9281148 to 1e05d23 Compare August 26, 2025 05:36
@al3rez
Copy link
Author

al3rez commented Aug 26, 2025

@sonic2kk i updated the solution the selection works now but it kind of jumps
image

@sonic2kk
Copy link
Contributor

sonic2kk commented Aug 26, 2025

Tested again and I think I understand what you mean about jumpy. When a version is selected, even the default version, clicking "Load more..." will cause it to switch to another version. It seems to be offset by its position in the list e.g. the default currently of the latest GE-Proton10-13 will jump to GE-Proton8-21 when "Load more..." Is pressed. This is the first suggestion on the next "page" of results.

We may need to do some calculation on the selected index as well then. I haven't dug too deeply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants