Skip to content

feat(citations): paginate the Top Sources Domains/URLs tables (100 rows per page) #395

Closed

Description

@gkhngyk

Problem

On /dashboard/citations, the Top Sources card renders the entire Domains and URLs result sets with no limit — DomainsTable and UrlsTable just rows.map(...) over the full arrays (web/src/app/[locale]/(dashboard)/dashboard/citations/page.tsx, ~791 and ~852).

This is amplified by the keepMounted tab optimization from #299/#325: both full tables live in the DOM simultaneously (switching is a CSS visibility toggle). Each row carries a favicon image, category badge, and platform chips — for a brand with thousands of cited domains/URLs the page gets heavy to render and scroll.

Proposal

Client-side pagination, 100 rows per page, independently for the Domains and URLs tabs.

  • The data is already fully loaded client-side by getCitationsOverview (one server action returns all rows), so no server/API change is needed — paginate by slicing the in-memory arrays.
  • Add a small pager under each table (Previous / Next + "1–100 of N" is enough; numbered pages optional).

Details to get right

  • Rank column: DomainsTable renders rank as i + 1 — with pagination it must be page * 100 + i + 1 so ranks stay global.
  • Independent page state per tab (Domains page 3 shouldn't move the URLs tab).
  • Reset to page 1 when filters change (date preset, platform, topic, prompt, region, own-domain toggles) — the row set changes under the pager.
  • Keep keepMounted as is — with 100-row pages both mounted panels are cheap, so the instant tab switching from perf(citations): make Domains/URLs tab switching instant (keepMounted + memo) #325 is preserved (and gets even faster).
  • The tab labels already show totals (Domains (N) / URLs (N)); the pager should agree with those numbers.

Acceptance criteria

  • Domains and URLs tabs each render at most 100 rows per page, with working pager controls
  • Rank numbers remain global across pages (page 2 starts at 101)
  • Page state is per-tab and resets when any filter changes
  • Tab switching stays instant (keepMounted preserved)
  • No change to getCitationsOverview / server behavior

Activity

  1. added
    enhancement
    good first issue
    on Jul 10, 2026
  2. Sam-syntax35 commented on Jul 10, 2026

    @Sam-syntax35
    Contributor

    Hi @gkhngyk, could you please assign these issues to me? I've already started working on them, and assigning them will help avoid duplicate PRs. Thanks!

  3. added a commit that references this issue on Jul 12, 2026
    4e382ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions