Skip to content

Comments

2468 improve authored rules loading#2476

Merged
Freego1783 merged 8 commits intomainfrom
2468-improve-authored-rules-loading
Feb 23, 2026
Merged

2468 improve authored rules loading#2476
Freego1783 merged 8 commits intomainfrom
2468-improve-authored-rules-loading

Conversation

@Aibono1225
Copy link
Member

@Aibono1225 Aibono1225 commented Feb 23, 2026

Description

✏️

Relates to #2468

Refactors the authored rules fetching and pagination logic for the user client page.

  • Changed the authored rules fetching logic in UserRulesClientPage to use backward pagination (last and before), progressively loading rules and updating the UI as each batch arrives. Pagination controls are only enabled once all rules are fetched.
  • Modified the API route app/api/tina/rules-by-author/route.ts to accept last, before, and sort parameters, 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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/before instead of first/after) with explicit sorting by lastUpdated
  • 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.

@SSWConsulting SSWConsulting deleted a comment from github-actions bot Feb 23, 2026
@SSWConsulting SSWConsulting deleted a comment from github-actions bot Feb 23, 2026
@Aibono1225
Copy link
Member Author

/deploy

@github-actions
Copy link
Contributor

PR Preview Deployed

Preview URL https://app-sswrules-staging-pr-2476.azurewebsites.net/rules
Slot Name pr-2476
Branch 2468-improve-authored-rules-loading
Commit f0edb26dd7e3fec2240f6cfa8d6c16754689b37f

This preview will be automatically deleted when the PR is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants