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

Paginate Followers & Following pages #9283

Closed
Tracked by #9281
mekarpeles opened this issue May 16, 2024 · 5 comments · Fixed by #9323, #9361 or #9363
Closed
Tracked by #9281

Paginate Followers & Following pages #9283

mekarpeles opened this issue May 16, 2024 · 5 comments · Fixed by #9323, #9361 or #9363
Assignees
Labels
Fellowship Opportunity Good First Issue Easy issue. Good for newcomers. [managed] Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Priority: 2 Important, as time permits. [managed] Theme: My Books Theme: Performance Issues related to UI or Server performance. [managed]

Comments

@mekarpeles
Copy link
Member

mekarpeles commented May 16, 2024

Currently, the My Followers and Following pages show all a patron's subscribers or subscriptions.

https://openlibrary.org/people/mekBot/followers
https://openlibrary.org/people/mekBot/following

Screenshot 2024-05-16 at 6 25 34 AM

If a patron has hundreds or thousands of followers, this likely to cause a significant performance issue. Especially considering #9282.

Open Library has a Pager macro that will automatically handle the UI for adding pagination to a view.

Here is a similar example PR which adds the Pager to a page: #6739

Screenshot 2024-05-16 at 7 13 10 AM

In order to switch from the current system (where all followers / subscriptions are rendered), we'll need to change the code to only fetch 25 per page instead of everything, and then also calculate the total number of pages that exist by querying for the total count of followers and dividing it by 25.

@mekarpeles mekarpeles added Good First Issue Easy issue. Good for newcomers. [managed] Priority: 2 Important, as time permits. [managed] Fellowship Opportunity Theme: Performance Issues related to UI or Server performance. [managed] Theme: My Books Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] labels May 16, 2024
@pidgezero-one
Copy link
Contributor

Hello! Could I please work on this issue?

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label May 18, 2024
@mekarpeles
Copy link
Member Author

Hi @pidgezero-one, sure! Feel free to give it a try and let me know if you have any questions about contributing.

@mekarpeles mekarpeles removed the Needs: Response Issues which require feedback from lead label May 18, 2024
@pidgezero-one
Copy link
Contributor

@mekarpeles Is there a recommended way to add 26+ entries to follower/following list for the default (openlibrary) local testing user? I've started a draft PR, but so far I can only verify that the page doesn't break when the list is empty.

(Sorry this took longer than I'd have liked, I picked up this ticket and then got sick!)

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label May 23, 2024
@scottbarnes
Copy link
Collaborator

@pidgezero-one, I don't know that it's a great idea, but I replied on Slack in #openlibrary-g with an idea that may help, or at least get you going in the right direction.

@pidgezero-one
Copy link
Contributor

Thank you @scottbarnes! That was exactly what I needed. The PR is ready now thanks to your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fellowship Opportunity Good First Issue Easy issue. Good for newcomers. [managed] Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Priority: 2 Important, as time permits. [managed] Theme: My Books Theme: Performance Issues related to UI or Server performance. [managed]
Projects
None yet
3 participants