feat: Implement cursor-based infinite scrolling for Model Directory (#51)#92
feat: Implement cursor-based infinite scrolling for Model Directory (#51)#92nitishchaubeyy wants to merge 3 commits into
Conversation
|
@nitishchaubeyy is attempting to deploy a commit to the aditthyass' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey @AditthyaSS , Just a quick heads-up regarding the dependencies! To implement the Intersection Observer reliably for the infinite scroll, I needed to install the react-intersection-observer package. I remember you mentioning earlier to make sure package.json and package-lock.json aren't touched separately. I have left those dependency updates out of this commit to respect that rule. Let me know how you'd prefer to handle adding this necessary package! I can either push the lockfile updates to this PR if you give the green light, or we can handle it in a separate dependency PR! |
|
@nitishchaubeyy i can see some merege conflicts please resolve it... |
|
@AditthyaSS The conflicts on this branch has been resolved as well. |
|
@nitishchaubeyy Please solve the conflicts ..Then only the PR can be merged src/app/api/models/route.js |
Description
This PR resolves #51 by replacing the heavy client-side filtering and static data loading with a highly performant, cursor-based infinite scrolling architecture.
Key Changes
Backend (
src/app/api/models/route.ts)cursorandskip: 1.whereclauses to ensure paginated chunks are accurate and scalable.id: "asc"toorderBy) so cursors never skip ties.Frontend (
src/app/models/page.tsx&ModelTable.tsx)URLSearchParamsgeneration to pass active UI filters down to the API route natively.To implement the Intersection Observer reliably, this feature relies on the
react-intersection-observerpackage.I remember the rule to make sure
package.jsonandpackage-lock.jsonaren't touched separately or bundled blindly into feature PRs.To respect that, I have intentionally excluded the
package.jsonand lockfile updates from this commit.Let me know how you'd prefer to handle adding this necessary package (e.g., push the lockfile updates to this PR, or handle it in a separate dependency PR).
Fixes
Closes #51