HSLdevcom / jore4

Public transport registry
European Union Public License 1.2
4 stars 2 forks source link

Implement actual pagination in search views #1675

Open ellinooraikaheimo opened 8 months ago

ellinooraikaheimo commented 8 months ago

Affects at least routes/lines and timetables search, and likely stop search if it is implemented similarly.

The UI already has pagination, but it is "fake": all data for all pages is loaded with one query and pages only filtered in the UI. Thus there is some unnecessary data loaded if the user never views it, especially when there are lots of results. Eg. when searching routes/lines with 1* there are 45 results, only 10 of which are initially shown, and the query takes nearly 10 seconds.

Instead, should load data for each page only when the user views them. This should speed up the first page load, especially when there are lots of results. For stops the issue would likely be a lot worse since there are a lot more of those.

When implementing this, it should be checked that this actually speeds things up.

Could possibly implement https://github.com/HSLdevcom/jore4/issues/1670 at the same time since these likely partly deal with same components.

HenrikHartiala commented 7 months ago

Nitpicking, but had to comment that the current implementation is already an "actual" pagination, it is just a client side pagination. So there is nothing "fake" in this implementation, it is just not a server side pagination which is a different thing :D At the time of implementing the original pagination we decided to use client side pagination.