Library: Limit default document list to 20 most recently edited

Resolved 💬 3 comments Opened Dec 30, 2025 by jfdTP Closed Feb 14, 2026

Problem

The library currently fetches ALL documents on load. This worked when we had 30-40 documents, but now with 1000+ documents:

  • Slow initial page load
  • Excessive API payload size
  • Contributes to rate limit issues on page load

Solution

Change the default library query to return only the last 20 most recently edited documents.

API Changes

  • GET /api/all should default to limit=20 and sort=updatedAt:desc
  • Add pagination support if not already present
  • Add "Load more" or infinite scroll in UI

Acceptance Criteria

  • [ ] Library loads in <1 second with 1000+ documents in DB
  • [ ] Default view shows 20 most recently edited
  • [ ] User can load more documents on demand
  • [ ] Search still works across all documents

Context

Currently hitting rate limits and slow loads because the frontend fires many parallel requests on page load, and /api/all returns the entire document collection.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗