Repository navigation
feat(mentions): add the Mentions overview tab - #1116
Merged
Merged
Conversation
…iment page shell Mentions & Sentiment (MS-05) gets its sidebar item, "Mentions" with a New pill and a speech-bubble icon, directly above Citations, its sibling concept. Once Topics moves into Prompts, it sits between Prompts and Citations. /dashboard/mentions has the page's title and description, its V1 tabs (Overview, Mentions, Perception; Sentiment and Fact-check stay hidden until built) and the filter bar every tab shares: date range (30 days by default, as in the mockup), AI platform, country, topic and a search over prompts, brands and phrases. Tab and filters live in the URL, so a refresh or a shared link restores the view. The tabs' figures and charts arrive with the next PRs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The data layer for Mentions & Sentiment (MS-03/04), built from what tracking already stores on each answer: mention_count, mention_position, competitor_mentions and the answer's sentiment toward the brand. Opening the page or changing a filter never calls an LLM. Migration 00157 adds two daily rollups: - mentions_prompt_daily (day x prompt x platform x region): answers, the answers naming the brand, occurrences, positive and negative mentions, and the brand's positions; - mentions_competitor_daily: answers naming each competitor, and those naming the brand too. refresh_mentions_daily rebuilds them (service role only), and mentions_overview reads a window and the one before it, filtered by platform, region, topic and a prompt search: under two days from the answers, longer windows from whole UTC days. It is security definer with the organization check made explicit. The server refreshes the rollups with the Insights and Citations ones, when a run stamps and in the nightly sweep, and scripts/backfill-mentions-daily.js fills a brand's history. The web gets getMentionsOverview, the Overview's metrics (mention rate, the sentiment split with neutral kept, net sentiment, low sample under 20 mentions, average position) and the filters-to-query helper. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Overview tab of Mentions & Sentiment (MS-06), as in the mockup: - a summary line written from the aggregates by a fixed template (net sentiment and its change, the platform behind most of it, the competitors named beside you), never an LLM; - KPI cards: Total mentions, Mention rate, Prompts with mentions and Net sentiment with its split and n; under 20 responses a rate is a low sample and shows no change; - a daily trend with a Mentions / Mention rate / Net sentiment toggle; - a by-platform table with the sentiment split, net and its change, and a note when platforms disagree; - competitor framing: mentions, rate and same-answer counts, with sentiment for your brand only. MetricCard is exported from the Insights cards and takes a footer in place of its sparkline. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
This was referenced Oct 17, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
8 of 12 tasks
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 17, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 17, 2026
gkhngyk
approved these changes
Oct 17, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Reviewed. The Overview tab reads mentions_overview (00157, applied). Tested on the full Mentions chain; CI was green on this tree.
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
Third of six PRs for Mentions & Sentiment: the Overview tab (MS-06), as in the mockup. It reads everything from
mentions_overview(#1115) in one call, so opening the tab or changing a filter never calls an LLM.What the tab shows, top-down
"Frequently mentioned with" moves to the Perception tab (PR 5), where the mockup has it, so the same co-mention counts aren't shown twice here.
Code
mentions/_overview.tsxloads the tab:_headline,_overview-kpis,_trend-card/_trend-chart(recharts, loaded on demand),_platform-table,_competitor-table,_sentiment-split.lib/mentions-headline.ts: what the summary says (net, change, the platform behind it, companions) and when platforms disagree, kept apart from the wording and tested.lib/mentions-overview.ts:relativeChange;mentionTrend, which fills in the days without responses.insights/_kpi-cards.tsx:MetricCardis exported, and it takes an optionalfooterin place of its sparkline. Insights renders as before.mentions.overviewinen.json.Related issue
None.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): no errors; the 7 warnings are in files this PR does not touchyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
yarn testpasses: 895 tests, 18 of them new.lib/mentions-headline.test.ts: the mockup's story (+34, ↓ 6, Gemini −18, Profound and Peec AI), a flat change, an empty window, low samples, and disagreement.mentions/_overview.test.tsx:lib/mentions-overview.test.ts:relativeChangeandmentionTrend.yarn buildpasses (with CI's Stripe placeholder).🤖 Generated with Claude Code