Skip to content

fix: prevent filtered skills pagination flicker#372

Open
abdulbb wants to merge 2 commits intoopenclaw:mainfrom
abdulbb:fix/skills-filtered-pagination-flicker
Open

fix: prevent filtered skills pagination flicker#372
abdulbb wants to merge 2 commits intoopenclaw:mainfrom
abdulbb:fix/skills-filtered-pagination-flicker

Conversation

@abdulbb
Copy link

@abdulbb abdulbb commented Feb 16, 2026

Summary

  • fix skills.listPublicPageV2 to skip fully filtered-out pages when highlightedOnly and/or nonSuspiciousOnly are enabled
  • avoid returning empty pages with isDone: false, which caused the UI to repeatedly show Loading more… without visible new rows
  • add regression tests for skipping empty filtered pages and correctly exhausting pagination

Test plan

  • bun run lint
  • bun run test
  • bun run build

Made with Cursor

Greptile Summary

This PR fixes a pagination bug where the UI repeatedly showed "Loading more..." without displaying new rows when highlightedOnly or nonSuspiciousOnly filters were active. The fix implements a while loop that skips empty filtered pages by fetching the next page until either matching skills are found or pagination is exhausted.

Changes:

  • Modified listPublicPageV2 to loop through pages when filters remove all results (convex/skills.ts:1596-1599)
  • Extracted filtering logic into a reusable filterPublicSkillPage function
  • Added regression test for skipping empty filtered pages
  • Updated test for exhausted pagination to properly return isDone: true

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is well-tested with comprehensive regression tests covering the happy path (skipping empty pages), edge case (exhausted pagination), and existing behavior. The logic is straightforward and follows TypeScript best practices.
  • No files require special attention

Last reviewed commit: 45c477c

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

Skip fully filtered-out pages in public skills pagination so highlighted/non-suspicious filtering doesn't return empty pages with more cursor state, which caused repeated loading-more flicker.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings February 16, 2026 21:52
@vercel
Copy link
Contributor

vercel bot commented Feb 16, 2026

@abdulbb is attempting to deploy a commit to the Amantus Machina Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

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 fixes a pagination UX issue in skills.listPublicPageV2 by skipping pages that become empty after applying highlightedOnly / nonSuspiciousOnly post-pagination filters, preventing clients from receiving empty pages with isDone: false (which caused “Loading more…” flicker).

Changes:

  • Add a loop in listPublicPageV2 to advance pagination until a non-empty filtered page is found or pagination is exhausted.
  • Extract post-pagination filtering into a dedicated filterPublicSkillPage helper.
  • Add/adjust regression tests to cover skipping fully filtered pages and correctly returning isDone: true when no matches exist.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
convex/skills.ts Skips fully filtered-out pages during pagination and factors filtering into a helper.
convex/skills.listPublicPageV2.test.ts Adds tests verifying page-skipping behavior and proper exhaustion semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Remove the custom runPaginate annotation so TypeScript infers the exact Convex paginate result shape and preserves stronger type-safety.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant

Comments