Skip to content

Add pagination to posts list #4

@wassertim

Description

@wassertim

Problem

All posts matching current filters are fetched and rendered in a single response. The listPosts() query in src/db.ts has no LIMIT clause, and the home route renders every result at once. This won't scale as post count grows.

Proposed Solution

Add cursor-based or offset/limit pagination to the posts list:

  • Add LIMIT and OFFSET to listPosts() queries in src/db.ts
  • Return pagination metadata (total count, current page, has more)
  • Add "Load more" or page navigation controls using HTMX
  • Apply pagination to all sort/filter/search modes

Acceptance Criteria

  • Posts are loaded in fixed-size pages (e.g. 20 per page)
  • User can load additional pages via UI controls
  • Pagination works with all existing filters (status, sort, search)
  • No-JS fallback works (progressive enhancement)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions