Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
feat(insights): open the Mentions page from the Mentions card (#1143)
Cihana3da20315698
diff --git a/web/messages/en.json b/web/messages/en.jsonindex 39efc8918..904cfdd20 100644--- a/web/messages/en.json+++ b/web/messages/en.json@@ -2385,6 +2385,7 @@"viewBreakdown": "{metric}: view breakdown","openPrompts": "Tracked prompts: open Prompts","openCitations": "Citations: open Citations",+ "openMentions": "Mentions: open Mentions","visibility": "Visibility","visibilityTip": "AI Visibility Score (0–100) from how often answers name you, cite your site and how early you're named. See Formulas.","rankOf": "#{rank} of {count} brands",diff --git a/web/src/app/[locale]/(dashboard)/dashboard/insights/_kpi-cards.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/insights/_kpi-cards.test.tsxindex e54af78c2..9866b2df2 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/insights/_kpi-cards.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/insights/_kpi-cards.test.tsx@@ -35,6 +35,8 @@ const summary = (over: Partial<InsightsSummary> = {}) =>let container: HTMLDivElement;let root: Root;+const onBreakdown = vi.fn();+const onNavigate = vi.fn();function render(trackedPrompts: TrackedPromptsKpi, over: Partial<InsightsSummary> = {}) {act(() => {@@ -49,8 +51,8 @@ function render(trackedPrompts: TrackedPromptsKpi, over: Partial<InsightsSummarycompetitors={null}comparison={null}series={null}- onBreakdown={vi.fn()}- onNavigate={vi.fn()}+ onBreakdown={onBreakdown}+ onNavigate={onNavigate}/></NextIntlClientProvider>,);@@ -64,6 +66,7 @@ const plan = (quotaUsed: number, quotaLimit: number): TrackedPromptsKpi => ({});beforeEach(() => {+ vi.clearAllMocks();container = document.createElement('div');document.body.appendChild(container);root = createRoot(container);@@ -104,6 +107,17 @@ describe('the Mentions and Citations cards', () => {expect(container.textContent).not.toMatch(/same \d+ prompts?/);});+ it('open their own pages', () => {+ render(plan(47, 50));+ const card = (label: string) =>+ container.querySelector(`[role=button][aria-label="${label}"]`) as HTMLElement;+ act(() => card('Mentions: open Mentions').click());+ expect(onNavigate).toHaveBeenLastCalledWith('/dashboard/mentions');+ act(() => card('Citations: open Citations').click());+ expect(onNavigate).toHaveBeenLastCalledWith('/dashboard/citations');+ expect(onBreakdown).not.toHaveBeenCalled();+ });+it('say nothing of a change they do not have', () => {render(plan(47, 50), { mentionsChange: null, citationsChange: null });expect(container.textContent).not.toContain('vs previous period');diff --git a/web/src/app/[locale]/(dashboard)/dashboard/insights/_kpi-cards.tsx b/web/src/app/[locale]/(dashboard)/dashboard/insights/_kpi-cards.tsxindex 2563472db..303fdabc2 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/insights/_kpi-cards.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/insights/_kpi-cards.tsx@@ -258,7 +258,8 @@ interface KpiRowsProps {competitors: CompetitorComparisonData | null;comparison: PromptComparison | null;series: KpiSeriesDay[] | null;- onBreakdown: (metric: 'visibility' | 'mentions') => void;+ /** Visibility's breakdown; Mentions opens its own page. */+ onBreakdown: (metric: 'visibility') => void;onNavigate: (path: string) => void;}@@ -390,8 +391,8 @@ export function KpiRows({delta={upIsGood(summary.mentionsChange, { percent: true, locale })}sub={vsPrevious(summary.mentionsChange)}spark={daily('mentions')}- onClick={() => onBreakdown('mentions')}- clickLabel={t('viewBreakdown', { metric: t('mentions') })}+ onClick={() => onNavigate('/dashboard/mentions')}+ clickLabel={t('openMentions')}/><MetricCardlabel={t('citations')}