Skip to content

Implement search result pagination to prevent large list renders - #542

Merged
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
Purity-Euphemia:Implement-search-result-pagination-to-prevent-large-list-renders
Jun 1, 2026
Merged

RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
Purity-Euphemia:Implement-search-result-pagination-to-prevent-large-list-renders

Conversation

@Purity-Euphemia

Copy link
Copy Markdown
Contributor

Closes #353

Summary

Implements search result pagination for the mobile search experience to prevent large list renders and improve performance for result sets of 100+ items.

What changed

  • Added cursor-based pagination support for search results
  • Limited each page to 20 results by default
  • Implemented infinite scroll / load-more behavior in the search UI
  • Preserved search/filter state across pages
  • Added pagination request parameters: limit, cursor, orderBy, and direction
  • Updated cursor handling to use a stable opaque token (nextCursor)
  • Improved search performance and memory usage for large result sets

Files likely touched

  • app/search.tsx
  • src/components/mobile/MobileSearch.tsx
  • src/services/... (search API / pagination helper layer)
  • src/utils/... (cursor encoding/decoding or pagination helpers)

Testing

Manual testing

  1. Run the app locally with Expo.
  2. Open the search screen.
  3. Perform a search that returns a large dataset.
  4. Verify only the first 20 items render initially.
  5. Scroll to the bottom and confirm the next page loads.
  6. Confirm hasMore stops further requests when no more results remain.
  7. Verify filters and queries still work.

Automated testing

  • Add unit tests for pagination helpers:
    • cursor encoding / decoding
    • page boundary calculations
    • hasMore handling
  • Add integration tests for MobileSearch or the search screen:
    • loading first page
    • loading next page when scrolled
    • preserving page state after query/filter changes

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit babc81b into rinafcode:main Jun 1, 2026
1 of 12 checks passed
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.

Implement search result pagination to prevent large list renders

2 participants