Repository navigation
fix(insights): move the raw results count out of the page header - #238
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Answer Engine Insights (
/dashboard/insights) the page header subtitle showed a raw results count:That
Nis 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:
· {totalResults} resultsfrom the header subtitle, leaving{brand.name} · Last run: {lastCheckedLabel}.Showing X of Y rows (newest first)…note already carries the total.{N} results(singular/plural handled).totalResultsis still passed into the card astotalRowCount, so no dead state.Related issue
Closes #190
Type of change
fix— Bug fixChecklist
yarn lintpasses (run fromweb/) — 0 errorsyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)