Feature NPM Resource Changed PR-5.2-dev PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
10 Jul 2024

Pull Request for Issue #32674

Summary of Changes

Uses css media query etc to provide responsive pagination

Made for 5.2 as I have no idea if this is considered a bug fix or a feature - can easily be rebased

When you have a lot of items in a list (site and admin) then it breaks the layout on small devices or requires horizontal scrolling

Testing Instructions

As this is a scss change either use a pre-built package from this PR or apply the pr and run npm run build:css

Create a list view in both the site and admin and check the pagination

Actual result BEFORE applying this Pull Request

image

Expected result AFTER applying this Pull Request

image

Additional Checks

Make sure that the arrows are always displayed and that the ellipsis is never displayed between the arrows

image

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar brianteeman brianteeman - open - 10 Jul 2024
avatar brianteeman brianteeman - change - 10 Jul 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jul 2024
Category Repository NPM Change
avatar Quy
Quy - comment - 19 Jul 2024

At the beginning, ellipsis is centered.
43766-pagination-start

Go to the end, ellipsis is not centered.
43766-pagination-end

The ellipsis next to the arrows is confusing as it implies additional links/pages to me, but that is not the case. For example, 13 is the last page but I assume there are more.

avatar Hackwar
Hackwar - comment - 20 Jul 2024

@brianteeman could you try to find a fix for the issue @Quy posted? I also would like to eventually have the numbered buttons disappear completely at a certain size. I think it would be perfectly fine to have the arrow buttons and then the "page x of y" at certain sizes. If you can get that done, I will try to get testers and have this be part of 5.2.

avatar brianteeman
brianteeman - comment - 20 Jul 2024

This was an attempt to resolve a three year old issue that keeps coming up.
I am not a designer or css guru but I did my best to make it better than it was yesterday
If someone wants to improve this then great - create a pr against this or create your own pr.
This is the limit of my skillset

avatar Hackwar
Hackwar - comment - 20 Jul 2024

I will try to get someone to help with this.

avatar Quy
Quy - comment - 21 Jul 2024

Another possible solution is to show the arrows and the current page only as follows by removing /* Display the list item immediately before the active list item if it is not disabled */ sections:

43766-pagination

avatar angieradtke
angieradtke - comment - 22 Jul 2024

Good morning,
the whole thing is always something you can look at from different perspectives. With a smaller viewport, the pagination does not break. It stretches the screen.

The pagination itself arranges its items next to each other with display:flex.
If you allow the list to wrap, all the information is retained and the list does not expand the page.

@media (max-width:xxpx) {

ul.pagination { flex-wrap: wrap}
}

``
paginationv1

This solution may not be visually attractive, but it is very flexible and all information is retained.

paginationv2

The second solution visually removes all item links from the view, leaving only the arrows and the currently selected page visible.
`@media (max-width: xxpx) {

ul.pagination {
flex-wrap: wrap
}

.pagination li.page-item:not(.active) {
display: none
}

.pagination li.page-item:nth-child(-n + 2),
.pagination li.page-item:nth-last-child(-n+2)

{ display:block}

}
`
This option has two problems: firstly, it may deprive the user of interesting information. The arrows are easy to use for blind people as they contain the necessary aria information. Sighted people, however, are required to know what a single and a double arrow mean. As long as the numbers are visible, this transfer is easier to achieve.

Problem number two: Performance is becoming increasingly important. By using nth, the numbers links can be switched off quite easily with CSS. However, nth is not a simple selector. The computing power is not negligible. However, if you want to prioritize design over usability, .-) I think this is a practical solution.

avatar Hackwar
Hackwar - comment - 22 Jul 2024

@brianteeman would you adopt the proposal of @angieradtke?

avatar brianteeman
brianteeman - comment - 22 Jul 2024

i dont consider either of those as solutions.

avatar fgsw
fgsw - comment - 31 Jul 2024

The Prebuilt packages is not available for download:
Ohne Titel

Edit: @Quy Thanks for merge branch.

avatar Quy Quy - change - 31 Jul 2024
Labels Added: NPM Resource Changed PR-5.2-dev
avatar fgsw fgsw - test_item - 31 Jul 2024 - Tested successfully
avatar fgsw
fgsw - comment - 31 Jul 2024

I have tested this item ✅ successfully on 7fad1bb

Test using Prebuilt package, Frontend Articles-, Backend Modules-list view.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43766.

avatar coolcat-creations
coolcat-creations - comment - 24 Aug 2024

There is somehow a 404 Error when clicking on the prebuild packages
https://artifacts.joomla.org/drone/joomla/joomla-cms/5.2-dev/43766/downloads/77726

avatar brianteeman
brianteeman - comment - 24 Aug 2024

@coolcat-creations afaik the prebuilt packages are only store for a few weeks. I have triggered an update so that should generate new packages

avatar coolcat-creations
coolcat-creations - comment - 24 Aug 2024

Although it's only 3 pages, it shows the ellipsis between the arrows and the page number. Tested on the prebuilt package in com_content articles view with blog sample data and limit to 5 articles per page.

grafik
avatar exlemor
exlemor - comment - 24 Aug 2024

Tried to test this PR but I am not even getting the ellipses that you are all lucky to get ( i guess ;) )... I created 280 articles in the Blog Category for testing this pagination situation.

Here are the settings in the Menu:
Screenshot at Aug 24, 2024 at 7_55_46 PM

And the results look like this:
Screenshot of Safari at Aug 24, 2024 at 7_58_17 PM

Same result if I change the Menu to a Category List, no ellipse just the data as expected.

avatar coolcat-creations
coolcat-creations - comment - 24 Aug 2024

@exlemor you are in the frontend. the PR is for the backend ;)

avatar brianteeman
brianteeman - comment - 24 Aug 2024

@exlemor you are in the frontend. the PR is for the backend ;)

No it is not

avatar coolcat-creations
coolcat-creations - comment - 24 Aug 2024

The screenshots here are mixed and your first two screenshots in the description is for the backend @brianteeman ?
Can you clarify in the testing instruction which template to test?

avatar brianteeman
brianteeman - comment - 24 Aug 2024

I wrote

When you have a lot of items in a list (site and admin) then it breaks the layout on small devices or requires horizontal scrolling

can't be any clearer than that. When you are feeling better you will comprehend

avatar brianteeman
brianteeman - comment - 24 Aug 2024

@exlemor your screenshot is of a desktop view. This PR only changes the display of pagination on smaller screens

avatar exlemor
exlemor - comment - 24 Aug 2024

Hi Brian,

Thanks, I guess I was getting tired myself - sorry.

I see the issue with the ellipse shifting location from center to the right... when looking at the mobile version :/

avatar HLeithner
HLeithner - comment - 2 Sep 2024

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 2 Sep 2024
Title
[5.2] Responsive pagination
[5.3] Responsive pagination
avatar HLeithner HLeithner - edited - 2 Sep 2024
avatar brianteeman brianteeman - change - 2 Sep 2024
Labels Added: Feature PR-5.3-dev

Add a Comment

Login with GitHub to post a comment