Skip to content

Insights: KPI cards and competitor leaderboard render counts without thousands separators #587

Closed

Description

@gkhngyk

Problem

The Insights KPI cards and the competitor leaderboard render raw numbers, so large counts show as 12345 instead of 12,345. Every sibling dashboard page (Citations, Traffic, Topics) formats counts with toLocaleString().

Evidence

Unformatted:

  • page.tsx#L309 — KpiCard renders {value} raw; fed with summary!.totalMentions / summary!.totalCitations at #L1534
  • page.tsx#L238 — +{current} new in CountDeltaBadge
  • _charts.tsx#L686-L687 — {entry.totalMentions} mentions / {entry.totalCitations} citations in the leaderboard

Convention elsewhere: citations/page.tsx#L911, traffic/page.tsx#L660, topics/page.tsx#L533.

Suggested fix

Apply toLocaleString() at the render sites listed above (KPI numeric values, count delta badges, leaderboard mention/citation counts). formatCompactNumber from src/lib/format.ts is already imported in page.tsx if a compact form fits better in tight spots like the leaderboard.

Acceptance criteria

  • KPI cards, delta badges, and leaderboard counts show thousands separators for values ≥ 1,000.
  • Score values (one-decimal 0–100) are unaffected.

Activity

  1. added
    enhancement
    good first issue
    on Aug 3, 2026
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