Skip to content

Fix Pagination to Support Navigation Beyond First 5 Pages in History Table #48

@pragmaticAweds

Description

@pragmaticAweds

Context & Impact

The HistoryTable.tsx pagination renders a maximum of 5 page buttons using Math.min(5, pageCount). If there are more than 5 pages of transaction history, users have no way to navigate to page 6 and beyond. There are no "next page", "previous page", "first", or "last" navigation controls. Transaction history beyond page 5 is effectively inaccessible.

Why this matters: Active users will accumulate hundreds of transactions — streams, distributions, withdrawals. If they can't navigate beyond page 5, they lose access to their older transaction history. This is a data accessibility bug in a financial application where users may need to reference past transactions.

Scope

  • Implement a sliding window pagination that shows the current page surrounded by neighbors
  • Add "Previous" and "Next" navigation buttons
  • Add "First" and "Last" page jump buttons
  • Show ellipsis (...) for skipped page ranges
  • Maintain the current active page highlighting

Implementation Guidelines

  • Use the existing Pagination components from src/components/ui/pagination
  • Implement a sliding window: show pages [current-2, current-1, current, current+1, current+2]
  • Show page 1 and the last page always, with ellipsis for gaps
  • Disable "Previous" on page 1, disable "Next" on the last page
  • Keep the URL in sync with the current page (query parameter or state)
  • Ensure the pagination component is reusable for other tables (streams, distributions)

Acceptance Criteria

  • Users can navigate to any page of transaction history
  • "Previous" and "Next" buttons are present and functional
  • Current page is highlighted in the pagination
  • Ellipsis (...) appears for skipped page ranges
  • Page 1 and last page are always visible in the pagination
  • "Previous" is disabled on page 1; "Next" is disabled on the last page
  • Pagination works correctly with 1 page, 5 pages, 10 pages, and 100+ pages
  • The component is reusable and can be applied to other tables

Getting Started

  1. Read src/components/modules/history/HistoryTable.tsx — find the pagination section
  2. Read src/components/ui/pagination.tsx for available primitives
  3. Create a usePagination hook or utility that calculates the visible page numbers
  4. Implement the sliding window logic with first/last page anchors and ellipsis
  5. Replace the current Array.from({ length: Math.min(5, pageCount) }) with the new component
  6. Test with different page counts: 1, 3, 5, 10, 50, 100
  7. Test rapid page navigation — ensure no flickering or stale data

PR Submission Guide

This section applies to every PR for this issue. Follow it exactly.

Before You Start

  • Fork the repository first if you haven't already — all contributions must come from a fork
  • Pull the latest main branch: git checkout main && git pull origin main
  • Create your feature branch from main: git checkout -b fix/<issue-number>-pagination-history

While Working

  • Make atomic commits — one concern per commit, each commit must build
  • Use Conventional Commits: feat(scope): description, fix(scope): description
  • Keep your branch up to date: git pull origin main --rebase regularly

Before Submitting the PR

  • Pull latest main and rebase: git checkout main && git pull origin main && git checkout <your-branch> && git rebase main
  • Ensure the build passes: pnpm build
  • Ensure linting passes: pnpm lint
  • Record a screen recording of your implementation showing the feature/fix working in the browser. Attach it to the PR.

PR Requirements

  • Link this issue in your PR description using Closes #<issue-number>
  • Fill out the full PR template — Summary, What Was Implemented, Implementation Details, How to Test
  • Attach your screen recording demonstrating the implementation
  • Request a review from a maintainer

PRs without a screen recording or without a linked issue will not be reviewed. Failure to meet PR requirements may lead to PR rejection.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions