Problem/Motivation
#3023242: Pagination/Pager style update implemented the full pager according to the design system. However, for example, views allow using mini pager as an alternative to the full pager. This is how the mini pager looks currently in Claro:

Proposed resolution
Remaining tasks
Design- Development Implementation
Note: The Figma file contains the full layout with specs. Screen shot attached in comment #3 for reference.
Link to Figma file: https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system...
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | interdiff.txt | 471 bytes | lauriii |
| #34 | interdiff-3049321-24-34.txt | 9.99 KB | huzooka |
| #34 | interdiff-3049321-31-34.txt | 3.47 KB | huzooka |
| #34 | claro-mini_pager-3049321-34.patch | 8.91 KB | huzooka |
| #31 | interdiff-3049321-24-30.txt | 10.23 KB | huzooka |
Issue fork claro-3049321
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
L2G2Utilizing the new pagination styles here:
https://www.drupal.org/project/claro/issues/3023242
I have implemented a few options for the mini pager.
Can be found in the Figma file here:
https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system?node-id=10266%3A18279
Outline of Options:
The first option keeps the existing styles of "current item" being fully enclosed in a blue circle. The second iteration could be to remove the circle when we are only showing one number, but the typography would still retain the current state blue color.
Then each one has an option for "first, previous, next, last" or just "previous and next"
Screenshot preview also attached.
Note the bounding box around the items is just to show they are variants, I'm not recommending it actually live in a box. :)
Comment #3
L2G2The Mini Pager is finalized and ready for implementation.
Comment #4
bnjmnmComment #5
bnjmnmHere's an implementation of the mini pager. Because views does not supply first/last links, I added some logic to the preprocessor to create those.
During manual testing, noticed that the views mini pager has an option for a "more" link, which is not accounted for in these designs. I'm not sure if this is necessarily something that would fall in the scope of this issue, but mentioning it just in case.
Comment #6
lauriiiThe buttons are now implemented as a square. This is how I would interpret the design system as well. It would be good to confirm this with the design team since this is inconsistent with the full pager.

Comment #7
lauriiiAnother question; should we keep the current page as a link? It doesn't seem useful since it would always link to the current page.
Comment #8
ckrinaI wouldn't keep the link to the current page neither.
Comment #9
ckrinaI wouldn't keep the link to the current page neither.
Comment #10
lauriiiNit: Space between if and opening parenthesis
I'm getting following error if I access /admin/content/media:
Notice: Undefined index: current in claro_preprocess_views_mini_pager() (line 852 of themes/claro/claro.theme).
claro_preprocess_views_mini_pager(Array, 'views_mini_pager', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('views_mini_pager', Array) (Line: 430)
Comment #11
ckrinaAll link areas in the pager should be circles unless they have text (prev, next...). So the hover should keep the circle appearance too. Here's an screenshot of the current specs, but we'll add states for all of them to avoid future confusions.
Comment #12
ckrinaAdding another screenshot for the target area:
Comment #13
lauriiiComment #14
junaidmasoodi commentedComment #15
antonellasev commentedComment #16
ant1<span>.Comment #17
lauriiiIt doesn't seem like this is working. I get a link to the last page even on the last page.
What are the steps to reproduce the problem this is trying to solve? I still get the notification that I mentioned in #10.2 on lists that only contain one page and I'm wondering if we could remove this.
We shouldn't assume the element type. Let's remove span from the selector.
Comment #18
ant1Comment #19
ant1spanhas been removed.Comment #20
ant1Forgot to add the comments (addressed in #19->#17.2).
Edit: or so I thought. You can ignore this patch.
Comment #21
lauriiiInstead of commenting these lines, we should remove these. Other than that, I think we're close to getting this finished 🥳
Comment #22
ant1Looking at the code, I strongly believe it's actually not possible to create a link to last page in the mini pager. The
template_preprocess_views_mini_pagerdoes not provide the needed information for making this possible (e.g. the amount of pages). Unless someone does know a proper solution, I think we should consider skipping the first/last links.Comment #23
lauriii@AntoineH is right, it's not possible to implement the last page link. We also shouldn't add those since it's one of the reasons mini pager exists - it's supposed to bring better performance to views with lots of pages.
We could generate the first-page link since it's always the same, but it feels like we shouldn't have the first-page link without the last-page link. Here's a version that has both of them removed.
Comment #24
ant1Adjusted the comment on removing the margins, as there are no first and last links anymore.
Apart from that, I believe this patch covers everything for this issue. Tested it and it looks good to me.
Comment #25
ckrinaComment #26
huzookaReviewing this.
Comment #27
huzookaComment #28
huzookaComment #29
huzookaAdditional changes since #24:
aria-labelledbyattribute, see #3059232: Views mini pager Twig template has broken "aria-labelledby" referenceNo visual difference (hopefully 🙂).
Comment #30
huzookaForgot to add the patch.
Comment #31
huzookaComment #32
huzookaComment #33
huzookaComment #34
huzookaComment #36
lauriiiTested both, mini pager and full pager manually to ensure that there are no regressions. Everything looked as expected.
Made a minor documentation improvement. Interdiff attached.
Thanks everyone!
Comment #39
lauriii