Skip to content

feat(web): show the prompt-level visibility rate on competitor cards and topic detail - #555

Merged
gkhngyk merged 1 commit into
mainfrom
feature/493-visibility-rate-alignment
Jul 29, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/493-visibility-rate-alignment

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes the remaining scope of #493 (the Topics overview half shipped in #499). Both surfaces now lead with the prompt-level Visibility Rate — the same metric as the Insights leaderboard — instead of the all-rows score average:

  • Competitors page cards — the headline is now visibilityRate with a X/Y prompts sub-line (mirroring the leaderboard's "appeared in X/Y prompts"). The score average, mentions and citations move into the hover tooltip, so no information is lost. Pure UI mapping — CompetitorComparisonEntry has carried the rate fields since feat(insights): visibility rate as the headline metric across Insights #490.
  • Topic detail KPI — "Avg visibility" becomes "Visibility rate", sourced from the own-brand entry of the topic-scoped competitor comparison (already computed with the same-denominator rule under the topic filter). Its change indicator now uses the rate's point change instead of the score change.
  • Topic detail competitor table — rows show visibilityRate instead of avgVisibilityScore. This also fixes an existing mismatch: the row's ± change was already rate-based, so it previously sat next to a score-average headline. Score average and X/Y counts are kept in the row tooltip.

No backend changes — getCompetitorComparison already returns visibilityRate, visiblePrompts and promptCount scoped to the active filters/topic.

Related issue

Closes #493

Type of change

  • feat — New feature

How to test

  1. Open Insights and note a competitor's leaderboard rate, then open Competitors — the card percentage now matches for the same period (previously it showed the much lower score average).
  2. Open a topic's detail page — the first KPI reads "Visibility rate"; a topic whose every prompt surfaced the brand reads 100%.
  3. In the topic detail competitor list, brand and competitor percentages share the topic's prompt-count denominator; hover a row to see "appeared in X of Y prompts" plus the old score average.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/)
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@gkhngyk
gkhngyk merged commit 4d2a39c into main Jul 29, 2026
4 checks passed
@gkhngyk
gkhngyk deleted the feature/493-visibility-rate-alignment branch July 29, 2026 08:02
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.

Competitors & Topics: align visibility numbers with the prompt-level rate

1 participant