Pagination #17
Replies: 5 comments 18 replies
-
Reposting my question: @DevinCLane I want to walk back the randomness. I think this will add complexity and solve a problem we won't even have with MVP due to limited users. I'd recommend lowering the complexity and setting pagination to just a sort of some default criteria. |
Beta Was this translation helpful? Give feedback.
-
(copying same comment from issue #7) const res = await client.query('SELECT * FROM users ORDER BY random() LIMIT 8'); |
Beta Was this translation helpful? Give feedback.
-
Apologies for not being able to attend the initial meeting (and for the length of this post). After reviewing the document, I have a few points that I would like to discuss: Name/Summary:
Data Model:
User Stories:
Implementation:
APIs:
Testing:
Open Questions:
|
Beta Was this translation helpful? Give feedback.
-
Updated things a bunch, would love another look at this @timmyichen @devonzara @Caleb-Cohen @MatthewBozin etc |
Beta Was this translation helpful? Give feedback.
-
Bit of a late thought, but we may also wish to consider how to handle the pagination's state. For instance, let's assume someone scrolls to page X, clicks on a link and goes to a developer's profile, then clicks their browser's back button. Should they be put back where they left off in the search results or would they have to start over? Similarly, should users be able to share their search results (including their page/scroll position)? If users should be able to resume where they left off, then state should be persisted by either:
If users should be able to share their search results, then having the state in the URL would be useful. |
Beta Was this translation helpful? Give feedback.
-
Moving the conversation from #7 to here while we iron things out @MainlyColors @Caleb-Cohen @timmyichen
Summary:
This tech spec outlines the technical requirements for implementing pagination on Dev Directory
Scope:
Data model:
No changes needed to the data model. This tech spec is only responsible for reading from the DB.
User Stories:
Implementation:
Use Sequelize for queries, e.g.,
We will paginate based on [Offset API Pagination] (https://nordicapis.com/understanding-5-types-of-web-api-pagination/#offset-api-pagination)
More information on pagination approaches
Infinite scroll
IntersectionObserver
to detect when the user has scrolled to the bottom of the pageAPIs:
GET /api/users
. Using query parameters to control what is returned.Security:
N/A
Testing:
Open Questions:
N/A
Deployment:
N/A
Beta Was this translation helpful? Give feedback.
All reactions