infinite-industries / infinite

MIT License
5 stars 3 forks source link

Inhouse Pagination #496

Closed chriswininger closed 4 months ago

MatthewGidcomb commented 4 months ago

We can discuss further but I think there's an argument for separating the Vuetify Pagination replacement component from the existing portal Pagination component, which I should have both named and documented better. The intention there was to simplify displaying data paginated client-side, with either future enhancements or a separate component for server-side pagination. In the latter case, we'll still need a component for managing the various page buttons.

Also, now that I see it, managing the number of page buttons from the components consuming the pagination component seems like the wrong way to handle it. Maybe instead we should consider a hint prop that gives the component an idea of how much space it has to work with (e.g. something like a "size" enum or just a narrow bool), and it uses that in combination with the page size to decide where to truncate?

chriswininger commented 4 months ago

We can discuss further but I think there's an argument for separating the Vuetify Pagination replacement component from the existing portal Pagination component, which I should have both named and documented better. The intention there was to simplify displaying data paginated client-side, with either future enhancements or a separate component for server-side pagination. In the latter case, we'll still need a component for managing the various page buttons.

Also, now that I see it, managing the number of page buttons from the components consuming the pagination component seems like the wrong way to handle it. Maybe instead we should consider a hint prop that gives the component an idea of how much space it has to work with (e.g. something like a "size" enum or just a narrow bool), and it uses that in combination with the page size to decide where to truncate?

I broke the logic up a bit more so that the part that draws the pagination buttons is separated out from the part that renders the selected pages.

I still think we should stick with letting the pages manager the buttons for now. Honestly long term it's hard to say what the right strategy is, but I was able to make each of those pages function a little better at smaller screens than they did before with this.

If we start using pagination in more places we can re-think. There's definitely still the possibility we ditch this in favor of a third part component in the future, if this proves hard to manage.