Skip to content

[Perf] Optimize Load more pagination to cursor-based offset #371

@realproject7

Description

@realproject7

Optimize "Load more" pagination to use cursor-based offset

Problem

The "Load more" pattern in donation history (#367), writer donation history (#368), and trading history (#369) all re-fetch from offset 0 with an increased limit on each click. This means every "Load more" re-fetches all previously loaded rows.

Example: after 3 clicks, the query fetches 30 rows but only 10 are new.

Fix

Switch to cursor-based pagination using .range(offset, offset + PAGE_SIZE - 1) and append new results to existing state, rather than re-fetching everything with an increased limit.

Affected Components

  • Reader dashboard: Donation History, Trading History
  • Writer dashboard: Donation History

Priority

Low — current datasets are small. Only matters at scale (100+ donations/trades per user).

Branch

task/371-cursor-pagination

Labels

agent/T3, perf

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