Fix infinite scroll pagination for albums #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Infinite scroll pagination wasn't triggering because
ScrollViewerdetection failed—ListBoxwithWrapPaneldoesn't create a standard internalScrollViewer.Changes
ScrollViewer Detection (
AlbumsListView.axaml.cs)Pagination Infrastructure
GetAlbumsPagedAsync(libraryId, startIndex, limit, sortBy, sortOrder)with server-side sortingHasMoreAlbums,IsLoadingMoreAlbums,LoadMoreAlbumsCommand;LoadAlbumsAsyncresets pagination statex:Name="AlbumsListBox", loading indicator, "X OF Y ALBUMS" count formatWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
av-build-tel-api-v1.avaloniaui.net/usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Summary
Fix the infinite scroll pagination for albums - the scroll detection is not working because the
ScrollVieweris not being found correctly.Current Problem
In PR #12, infinite scroll pagination was implemented but it's not working. The user never sees the "Loading more albums..." text, and only 50 albums load even though they have 1500+ albums.
The issue is in
AlbumsListView.axaml.cs. The current code tries to find aScrollViewerinside theListBox:However, the
ListBoxuses aWrapPanelas itsItemsPanel:WrapPanelis NOT a virtualizing panel, which means theListBoxmay not create its internalScrollViewerin the typical way, or theScrollViewerfound doesn't actually handle the scrolling.Solution
Update
AlbumsListView.axaml.csto search for theScrollViewermore thoroughly:Additional Debugging
The debug output will help identify:
ScrollVieweris being found at allLoadMoreAlbumsCommandis being triggeredAlternative Approach (if the above doesn't work)
If the
ScrollVieweris still not found or not working, wrap theListBoxin an explicitScrollViewerinAlbumsListView.axaml: