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(prompts): right-align the positions panel's 24h citations and reorder its platforms (#1102)
Cihan76c25ecf5a42
diff --git a/web/src/components/prompts/prompt-positions-sheet.test.tsx b/web/src/components/prompts/prompt-positions-sheet.test.tsxindex 5652be80a..15b6e56b1 100644--- a/web/src/components/prompts/prompt-positions-sheet.test.tsx+++ b/web/src/components/prompts/prompt-positions-sheet.test.tsx@@ -49,7 +49,7 @@ const answer = (over: Partial<PositionAnswer> & { createdAt: string }): Position...over,});-function data(locked = false): PromptPositionsData {+function data({ locked = false, unanswered = false } = {}): PromptPositionsData {const { summary, platforms } = summarizePositions([answer({@@ -66,6 +66,15 @@ function data(locked = false): PromptPositionsData {],[{ id: 'chatgpt-web', label: 'ChatGPT', access: { state: 'included' } },+ ...(unanswered+ ? [+ {+ id: 'copilot-web' as const,+ label: 'Microsoft Copilot',+ access: { state: 'included' as const },+ },+ ]+ : []),...(locked? [{@@ -137,8 +146,23 @@ describe('PromptPositionsSheet', () => {expect(text).toContain('In 1 of 2 answers in this period · 3 mentions');});+ it("lists each platform's latest answer in 24h, mention first, then citation", async () => {+ getPromptPositions.mockResolvedValue(data({ unanswered: true }));+ await open('24h');+ const rows = [...document.querySelectorAll<HTMLElement>('[data-platform]')];+ expect(rows.map((r) => r.dataset.platform)).toEqual(['chatgpt-web', 'copilot-web']);++ // The latest answer (Oct 9) named and cited nothing; the one before did.+ const blocks = [...rows[0].querySelectorAll('dl > div')].map((b) => b.textContent);+ expect(blocks).toEqual([+ 'MentionNot mentionedDetected earlier in this period',+ 'CitationNot citedDetected earlier in this period',+ ]);+ expect(rows[1].textContent).toContain('No completed tracking runs in this period');+ });+it('says the counts leave out a platform the plan locks', async () => {- getPromptPositions.mockResolvedValue(data(true));+ getPromptPositions.mockResolvedValue(data({ locked: true }));await open();expect(document.body.textContent).toContain('Answer counts cover the platforms your plan includes.',diff --git a/web/src/components/prompts/prompt-positions-sheet.tsx b/web/src/components/prompts/prompt-positions-sheet.tsxindex 6f209cc26..262c709c7 100644--- a/web/src/components/prompts/prompt-positions-sheet.tsx+++ b/web/src/components/prompts/prompt-positions-sheet.tsx@@ -627,9 +627,13 @@ function LatestView({);}+/**+ * A platform's latest answer: its mention on the left and its citation on+ * the right, under the platform's name.+ */function LatestRow({ platform: p }: { platform: PlatformPositions }) {return (- <div className="px-3 py-3">+ <div data-platform={p.id} className="px-3 py-3"><div className="flex flex-wrap items-center justify-between gap-2"><PlatformName platform={p} />{p.latest && (@@ -655,7 +659,7 @@ function LatestRow({ platform: p }: { platform: PlatformPositions }) {)}</dd></div>- <div>+ <div className="sm:text-right"><dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground">Citation</dt>diff --git a/web/src/lib/prompt-positions.test.ts b/web/src/lib/prompt-positions.test.tsindex d905424a5..a692e9e51 100644--- a/web/src/lib/prompt-positions.test.ts+++ b/web/src/lib/prompt-positions.test.ts@@ -15,6 +15,21 @@ import { positionTone } from './position-tone';const accessFor = (plan: Plan) =>Object.fromEntries(POSITION_PLATFORMS.map((p) => [p.id, platformAccess(plan, p.id)]));+describe('POSITION_PLATFORMS', () => {+ it('lists ChatGPT, then Microsoft Copilot, and Perplexity last', () => {+ expect(POSITION_PLATFORMS.map((p) => p.label)).toEqual([+ 'ChatGPT',+ 'Microsoft Copilot',+ 'Google AI Overviews',+ 'Google AI Mode',+ 'Gemini',+ 'Grok',+ 'Claude',+ 'Perplexity',+ ]);+ });+});+describe('platformAccess', () => {it('locks Starter to ChatGPT and Microsoft Copilot, with Grok and Claude behind sales', () => {const access = accessFor(PLANS.starter);diff --git a/web/src/lib/prompt-positions.ts b/web/src/lib/prompt-positions.tsindex 0007497d7..1d43d1dc1 100644--- a/web/src/lib/prompt-positions.ts+++ b/web/src/lib/prompt-positions.ts@@ -12,17 +12,20 @@ import { extractHostname, normalizeDomain } from '@/lib/citations/classify';import { dayIn, nextDay, startOfDayIn } from '@/lib/time-zone';import type { Sentiment } from '@/types';-/** The engines the panel lists, in the order it lists them. */+/**+ * The engines the panel and the table's platform dots list, in the order+ * they list them: ChatGPT and Microsoft Copilot first, Perplexity last.+ */export const POSITION_PLATFORMS = [{ id: 'chatgpt-web', label: 'ChatGPT' },- { id: 'perplexity-web', label: 'Perplexity' },+ { id: 'copilot-web', label: 'Microsoft Copilot' },{ id: 'google-aio', label: 'Google AI Overviews' },{ id: 'google-aimode', label: 'Google AI Mode' },{ id: 'gemini-web', label: 'Gemini' },- { id: 'copilot-web', label: 'Microsoft Copilot' },{ id: 'grok-web', label: 'Grok' },// API-model tracking stores its answers under this platform.{ id: 'claude', label: 'Claude' },+ { id: 'perplexity-web', label: 'Perplexity' },] as const;export type PositionPlatformId = (typeof POSITION_PLATFORMS)[number]['id'];