Skip to content

Content: KPI cards mix page-scoped stats with the brand-wide total #662

Closed

Description

@gkhngyk

Problem

Since server-side pagination (#610), opportunities holds at most one page (PAGE_SIZE = 100). Three KPI cards — High Impact, Avg. Score, Sent — are still computed by filtering/averaging that loaded page, while the Total card next to them shows the server-side count of all matching rows. On a brand with more than 100 opportunities the row reads e.g. "Total 340 · High Impact 12 · Avg. Score 61" where the last two describe only the first 100 rows — and they silently change when the user pages. Users read these as brand-wide metrics.

Evidence

Fix (pick one — the first is the good-first-issue version)

  1. Label version: add "on this page" subtext to the three page-scoped cards so their scope is explicit, and keep Total as-is.
  2. Data version (larger): extend the list endpoint to return aggregate counts (high-impact count, avg score, sent count) for the whole filtered set and bind the cards to those.

Acceptance criteria

  • KPI numbers can no longer be misread as brand-wide when they aren't: either correctly scoped labels (option 1) or truly brand-wide values (option 2).
  • Paging no longer silently changes unlabeled metrics.

Activity

  1. added
    bug
    good first issue
    on Aug 7, 2026
  2. BharadwajKanneveti commented on Aug 8, 2026

    @BharadwajKanneveti
    Contributor

    @gkhngyk I will work on this issue

  3. gkhngyk commented on Aug 8, 2026

    @gkhngyk
    ContributorAuthor

    @BharadwajKanneveti assigned — thanks! Either fix option from the issue works: the label version is the quick win, but given your track record, the data version (server-side aggregates for the whole filtered set) would be the more valuable close if you're up for it. Your call.

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

Metadata

Metadata

Labels

buggood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions