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

Improvements to pagination #4704

Open
al-bakalova opened this issue Mar 17, 2023 · 14 comments
Open

Improvements to pagination #4704

al-bakalova opened this issue Mar 17, 2023 · 14 comments
Labels
Review: Design needed Vanilla WG Task owned by Vanilla Working Group WG: Validated Validate working group proposals

Comments

@al-bakalova
Copy link

al-bakalova commented Mar 17, 2023

Pattern to amend

Table controls

Visual

MAAS

MAAS

LXD

LXD

Context

MAAS has recently introduced a table control bar. It consists of the following three elements:

  • Items count
  • Pagination (new look and feel)
  • Items per page selection

To meet our user's needs, as well as to keep the experience across products consistent, the LDX team has decided to adopt the pattern.

To meet the needs of the MAAS user, the table control bar is positioned above the table.
To meet the needs of the LXD users, the table control bar is positioned below the table, as a sticky table footer.
(see mockups in Zeplin)

Links to the GitHub tasks (MAAS)
Page size select
Pagination

We believe other products can benefit from this pattern.

@bartaz bartaz added the WG: Proposal Working group proposals label Mar 17, 2023
@bartaz
Copy link
Member

bartaz commented Mar 17, 2023

Thanks @al-bakalova, could you add some screenshots to the description? It makes it easier to understand what it's about without clicking on all the links.

@amylily1011
Copy link

@dgtlntv Can you add some interaction images for the pagination in the description here as well? 😃

@dgtlntv
Copy link
Member

dgtlntv commented Mar 17, 2023

Number of regions

Page input 1

Page input 2

Page input 3

Page input 4

Items per page

@dgtlntv
Copy link
Member

dgtlntv commented Mar 17, 2023

FYI: @ndv99 Worked on the implementation for MAAS!

@ndv99
Copy link

ndv99 commented Mar 21, 2023

Not sure how much help this might be but here's the SCSS I wrote for it:

.p-pagination--items {

  padding-bottom: $spv--small;

  .p-button {
    margin: 0;
    border: 0;
  }

  .p-pagination__link--next {
    margin-right: $spv--large * 2;
  }

  .p-pagination__input {
    margin: 0 $spv--small;
    appearance: none;
    width: 3rem;
    min-width: 0;
    text-align: center;
  }

  // required to get rid of buttons/arrows while keeping number-only input
  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    appearance: none;
  }

  input[type=number] {
    appearance: textfield;
  }
}

@lyubomir-popov
Copy link
Contributor

@al-bakalova and @juanruitina to do some benchmarking, and propose a mini spec explaining when to use which version and which exact versions are being proposed.

@lyubomir-popov
Copy link
Contributor

@AnnSoMuller to link to an example spec here

@AnnSoMuller
Copy link

Sure.
here is the Google drive folder for specs
and here the one for pagination specs

@bartaz bartaz added the WG: Validated Validate working group proposals label Mar 24, 2023
@danielmutis danielmutis changed the title Table controls Pagination on tables Apr 5, 2023
@danielmutis danielmutis changed the title Pagination on tables Improvements to pagination Apr 5, 2023
@danielmutis danielmutis removed the WG: Proposal Working group proposals label Apr 5, 2023
@bartaz
Copy link
Member

bartaz commented May 4, 2023

Not sure if still relevant, but we used to have a minimal pagination proposal like that before (via #3649):

Visual

image

Context

This new style of next and previous pagination is being placed at the top of tables in MAAS.

Not sure if it's still being used, should it be considered as variant, or is it replaced by other styles of pagination already.

@bartaz
Copy link
Member

bartaz commented May 4, 2023

Another pagination related discussion about positioning of pagination: #3208

@bartaz
Copy link
Member

bartaz commented Jan 25, 2024

Table Pagination has been recently added to React components: canonical/react-components#1013
See example and docs: https://canonical.github.io/react-components/?path=/docs/tablepagination--docs

Are we ready to build this into Vanilla, does it need any more design work? @danielmutis @juanruitina ?

@juanruitina
Copy link

Alex and I did some benchmarking around this.

The React implementation seems to work good enough for tables, although I'd suggest one change: I'd rather have a clear label for the "Items per page" selector: having "/page" as part of each option feels awkward and would result in weird output from screen readers. Something like this (quick mockup, selector as compact as possible):

Screenshot 2024-01-25 at 16 38 59

On Sites we tend to mention the number of search results at the top, then have the standard pagination at the bottom left and results per page at the bottom right. I understand this could still be an option, am I right?

@bartaz bartaz added the P3 Triaged Issue has been reviewed as part of legacy backlog grooming (project P3). label Sep 24, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/WD-15225.

This message was autogenerated

@bartaz bartaz added P3 Needs decision Needs team agreement in terms of triaging. Vanilla WG Task owned by Vanilla Working Group and removed P3 Triaged Issue has been reviewed as part of legacy backlog grooming (project P3). P3 Needs decision Needs team agreement in terms of triaging. labels Sep 24, 2024
@apollo13
Copy link

apollo13 commented Oct 2, 2024

Following up on the comment @juanruitina made, this is how it looks in patternfly (https://staging-v6.patternfly.org/components/pagination):

image

I find this takes up less space than "Items per page: " as label and exposes more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: Design needed Vanilla WG Task owned by Vanilla Working Group WG: Validated Validate working group proposals
Projects
None yet
Development

No branches or pull requests

10 participants