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

Add pagination everywhere #7571

Open
WofWca opened this issue May 1, 2022 · 5 comments
Open

Add pagination everywhere #7571

WofWca opened this issue May 1, 2022 · 5 comments
Labels
enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship.

Comments

@WofWca
Copy link
Contributor

WofWca commented May 1, 2022

Describe the problem

Many pages include lists that may get quite long. For example /user/<name>. If a user has a lot of contributions, the page may be so big that it takes 2 minutes to load it.
Another example is the /projects/ page.

Describe the solution you'd like

Use pagination, as it is done on /screenshots, /user/, /changes.

Describe alternatives you've considered

In case of /user/<name>, make the contributions list a separate page.

Screenshots

No response

Additional context

Apparently mostly the views that are currently paginated are subclasses of ListView, but for /user/<name> there are multiple models. Can we do something like this for each tab: include {% include "paginator.html" with page_obj=user_translations %} and pass user_translations through get_paginator, like it's done in search.py and dashboard.py?:

units = get_paginator(
request, units.order_by_request(search_form.cleaned_data, obj)
)
# Rebuild context from scratch here to get new form
context.update(
{
"search_form": search_form,
"show_results": True,
"page_obj": units,

usersubscriptions = get_paginator(request, usersubscriptions)
usersubscriptions = translation_prefetch_tasks(usersubscriptions)
return render(
request,
"dashboard/user.html",
{
"allow_index": True,
"suggestions": suggestions,
"search_form": SearchForm(request.user),
"usersubscriptions": usersubscriptions,

If so, I'd like to try it.

nijel added a commit that referenced this issue May 2, 2022
@nijel
Copy link
Member

nijel commented May 2, 2022

I've added it to /projects/ in fc45f7f.

For user view it is a bit more tricky because more tabs could get long and then paginating becomes tricky (you would have to pass different parameter to paginate each tab).

@nijel nijel added enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship. labels May 2, 2022
@github-actions
Copy link

github-actions bot commented May 2, 2022

This issue has been put aside. It is currently unclear if it will ever be implemented as it seems to cover too narrow of a use case or doesn't seem to fit into Weblate.

Please try to clarify the use case or consider proposing something more generic to make it useful to more users.

@comradekingu
Copy link
Contributor

comradekingu commented May 10, 2022

The loading time for /user/* is bad, but elsewhere the non-pagination grants extra productivity.
If I can turn it off for just me, all is well.

@endervad
Copy link

Another current offender of the absence of pages is /component-list/. Also (not related to this issue though) the default order of components in component list seems to be either random, or in the order of addition, didn't quite test it. In any case default A-Z order would be nice there. Or maybe even customizable default order.

@nijel
Copy link
Member

nijel commented Jun 6, 2022

@endervad Please file a separate issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship.
Projects
None yet
Development

No branches or pull requests

4 participants