Skip to content

Unify table pagination on the Prompts page — use the shared TablePager (citations-style) #544

Closed

Description

@gkhngyk

Problem

Pagination is inconsistent across the app. The Citations page (and the prompt-detail Top Sources card) use the shared TablePager + usePagination from web/src/components/table-pager.tsx (X–Y of Z + Previous/Next). The Prompts page differs in two ways:

  1. Main prompt list (web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx) has no pagination at all — filtered.map(...) renders every prompt in one long table.
  2. Fan-out tab (web/src/app/[locale]/(dashboard)/dashboard/prompts/_fanout-tab.tsx) ships its own bespoke numbered pager (getPagerItems with 1 2 … 9 buttons) that looks nothing like the shared one.

We want one pagination style everywhere — the citations style.

Proposal

  1. Main prompt list: paginate with usePagination(filtered.length, resetKey) + <TablePager …/> (default PAGE_SIZE = 100). resetKey must include the active filters and sort so changing either returns to page 1 (the hook already handles this via its reset-key contract). Slice filtered with pager.start/pager.end.
  2. Fan-out tab: replace the bespoke numbered pager with the shared TablePager, keeping the tab's current page size (pass it as the optional third usePagination argument, added in feat: add 10-per-page pagination and search filter to Top Sources (#530) #533). Delete getPagerItems and the custom pager markup.

No behavior change beyond pagination: sorting, filtering, and row rendering stay as they are.

Acceptance criteria

  • Prompts main list shows at most one page of rows with the shared pager below the table; filter/sort changes reset to page 1.
  • Fan-out tab (both views that currently paginate) uses the same TablePager UI as Citations.
  • No remaining usages of getPagerItems; web/ format:check, lint, typecheck, and test pass.

Activity

  1. added
    enhancement
    good first issue
    on Jul 28, 2026
  2. Maqbool61 commented on Jul 28, 2026

    @Maqbool61
    Contributor

    Can you assign me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions