Skip to content

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.

fix(mentions): say "Search keywords…" in the Perception tab's search (#1391)

Cihanf7c42fe0aee8
diff --git a/web/messages/en.json b/web/messages/en.json
index 0b6e0c938..ea8b20db7 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -5462,7 +5462,8 @@
"topic": "Topic",
"allTopics": "All topics",
"search": "Search",
- "searchPlaceholder": "Search prompts…"
+ "searchPlaceholder": "Search prompts…",
+ "searchPlaceholderPerception": "Search keywords…"
},
"overview": {
"sectionLabel": "Mentions overview",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/mentions/_filter-bar.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/mentions/_filter-bar.test.tsx
new file mode 100644
index 000000000..c51227690
--- /dev/null
+++ b/web/src/app/[locale]/(dashboard)/dashboard/mentions/_filter-bar.test.tsx
@@ -0,0 +1,52 @@
+import { act } from 'react';
+import { createRoot, type Root } from 'react-dom/client';
+import { NextIntlClientProvider } from 'next-intl';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import messages from '../../../../../../messages/en.json';
+import { DEFAULT_MENTIONS_FILTERS } from '@/lib/mentions-filters';
+import { MentionsFilterBar } from './_filter-bar';
+
+(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT =
+ true;
+
+let container: HTMLDivElement;
+let root: Root;
+
+function render(searchPlaceholder?: string) {
+ act(() => {
+ root.render(
+ <NextIntlClientProvider locale="en" messages={messages} timeZone="UTC">
+ <MentionsFilterBar
+ filters={DEFAULT_MENTIONS_FILTERS}
+ onChange={vi.fn()}
+ regions={[]}
+ topics={[]}
+ searchPlaceholder={searchPlaceholder}
+ />
+ </NextIntlClientProvider>,
+ );
+ });
+}
+
+const search = () => container.querySelector<HTMLInputElement>('#mentions-search')!;
+
+beforeEach(() => {
+ container = document.createElement('div');
+ document.body.appendChild(container);
+ root = createRoot(container);
+});
+
+afterEach(() => {
+ act(() => root.unmount());
+ container.remove();
+});
+
+describe('MentionsFilterBar', () => {
+ it('searches prompts by default, and words the search as a tab asks', () => {
+ render();
+ expect(search().placeholder).toBe('Search prompts…');
+ // The Perception tab words it as keywords; it still matches the prompts' text.
+ render(messages.mentions.filters.searchPlaceholderPerception);
+ expect(search().placeholder).toBe('Search keywords…');
+ });
+});
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/mentions/_filter-bar.tsx b/web/src/app/[locale]/(dashboard)/dashboard/mentions/_filter-bar.tsx
index cdd9d5aaa..b57f6ece6 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/mentions/_filter-bar.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/mentions/_filter-bar.tsx
@@ -22,18 +22,23 @@ const ALL = '__all__';
/**
* The filter bar every Mentions & Sentiment tab shares (MS-05): the date
* range, AI platform, country, topic and a search over the prompts' text.
- * The brand is the app's active brand, chosen in the sidebar.
+ * The brand is the app's active brand, chosen in the sidebar. A tab may word
+ * the search its own way (Perception: "Search keywords…"); it still matches
+ * the prompts' text.
*/
export function MentionsFilterBar({
filters,
onChange,
regions,
topics,
+ searchPlaceholder,
}: {
filters: MentionsFilters;
onChange: (patch: Partial<MentionsFilters>) => void;
regions: string[];
topics: Topic[];
+ /** The search box's hint; "Search prompts…" when not given. */
+ searchPlaceholder?: string;
}) {
const t = useTranslations('mentions.filters');
const platformItems = [
@@ -101,7 +106,7 @@ export function MentionsFilterBar({
id="mentions-search"
value={filters.q}
onChange={(e) => onChange({ q: e.target.value })}
- placeholder={t('searchPlaceholder')}
+ placeholder={searchPlaceholder ?? t('searchPlaceholder')}
className="h-8 pl-8 text-xs"
/>
</div>
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/mentions/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/mentions/page.tsx
index 347c278d6..6805744d5 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/mentions/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/mentions/page.tsx
@@ -128,6 +128,9 @@ export default function MentionsPage() {
onChange={(patch) => setFilters((prev) => ({ ...prev, ...patch }))}
regions={regions}
topics={topics}
+ searchPlaceholder={
+ tab === 'perception' ? t('filters.searchPlaceholderPerception') : undefined
+ }
/>
</div>