Merged
Conversation
…e fetching with background updates and deduplication of rules based on unique keys.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the loading experience for authored rules by implementing progressive/streaming loading and changing from forward to backward pagination to fetch items in reverse chronological order.
Changes:
- Modified GraphQL query and API route to use backward pagination (
last/beforeinstead offirst/after) with explicit sorting bylastUpdated - Implemented progressive loading that renders results as soon as the first page arrives while continuing to fetch additional pages in the background
- Added deduplication logic to prevent duplicate rules from appearing in the list
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
| tina/queries/queries.gql | Changed rulesByAuthor query to use backward pagination parameters (last/before/hasPreviousPage/startCursor) and added explicit sort parameter |
| app/api/tina/rules-by-author/route.ts | Updated API route to accept last/before parameters instead of first/after, added sort: "lastUpdated" to query call, includes fallback to first parameter for backward compatibility |
| app/user/client-page.tsx | Increased fetch page size from 10 to 100, implemented progressive loading with early rendering after first page, added deduplication using Set, updated loading states and UI to show pagination only after all data is loaded |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
/deploy |
Contributor
PR Preview Deployed
This preview will be automatically deleted when the PR is closed. |
Freego1783
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
✏️
Relates to #2468
Refactors the authored rules fetching and pagination logic for the user client page.
UserRulesClientPageto use backward pagination (lastandbefore), progressively loading rules and updating the UI as each batch arrives. Pagination controls are only enabled once all rules are fetched.app/api/tina/rules-by-author/route.tsto acceptlast,before, andsortparameters, aligning with the new backend pagination scheme.Screenshot (optional)
✏️
The authored rule lists loads faster now:
https://github.com/user-attachments/assets/b3aa6b5b-1546-4be4-a6dc-3922576a5976