Skip to content

fix(insights): move the raw results count out of the page header - #238

Merged
gkhngyk merged 1 commit into
mainfrom
fix/insights-results-count-relocation
Jun 12, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
fix/insights-results-count-relocation

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

On Answer Engine Insights (/dashboard/insights) the page header subtitle showed a raw results count:

{brand.name} · Last run: {lastCheckedLabel} · {N} results

That N is the size of the raw Prompt Results list (capped at ~1000 rows, newest-first). Sitting in the page header — above the KPI cards, the visibility trend, and the Brand vs Competitors leaderboard — it read as a page-wide figure and implied those top-level metrics were computed from at most ~1000 rows.

They are not: the KPI cards, leaderboard, and Share of Voice all come from server-side aggregate RPCs (insights_aggregates, competitor_aggregates, share_of_voice_aggregates) that aggregate over the entire dataset with no row cap. Only the raw results list (and the CSV export) is bounded.

Change

Pure relocation of the existing count — no change to how the number is computed:

  • Removed · {totalResults} results from the header subtitle, leaving {brand.name} · Last run: {lastCheckedLabel}.
  • Added the count to the "Prompt Results by Topic" card header, where it correctly describes the list it refers to:
    • When the list is truncated, the existing Showing X of Y rows (newest first)… note already carries the total.
    • Otherwise, show a plain {N} results (singular/plural handled).

totalResults is still passed into the card as totalRowCount, so no dead state.

Related issue

Closes #190

Type of change

  • fix — Bug fix

Checklist

  • yarn lint passes (run from web/) — 0 errors
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

The header subtitle showed the raw Prompt Results count (capped at ~1000
rows) directly above the KPI cards, leaderboard, and Share of Voice — all
of which aggregate over the full dataset with no cap. That made the count
read as a page-wide figure and implied a cap the headline metrics do not
have.

Relocate the count into the 'Prompt Results by Topic' card header, where it
correctly describes the list it refers to. When the list is truncated the
existing 'Showing X of Y rows' note already carries the total; otherwise
show a plain '{N} results'. No change to how the number is computed.

Closes #190
@gkhngyk
gkhngyk merged commit d1ae7de into main Jun 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(insights): move the raw results count out of the page header (reads as a page-wide cap)

1 participant