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(prompts): move suggestions to All Prompts (#466)

Giorgio Maria Federico Birnthaler44e0d5e7dbd9
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/prompts/_suggestions-card.tsx b/web/src/app/[locale]/(dashboard)/dashboard/prompts/_suggestions-card.tsx
index 29233b48c..3d529cb5b 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/prompts/_suggestions-card.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/prompts/_suggestions-card.tsx
@@ -16,9 +16,10 @@ import {
interface Props {
brandId: string;
+ onAccepted?: () => void;
}
-export function SuggestionsCard({ brandId }: Props) {
+export function SuggestionsCard({ brandId, onAccepted }: Props) {
const [suggestions, setSuggestions] = useState<PromptSuggestion[]>([]);
const [loading, setLoading] = useState(true);
const [refreshing, setRefreshing] = useState(false);
@@ -48,9 +49,15 @@ export function SuggestionsCard({ brandId }: Props) {
useEffect(() => {
setLoading(true);
- load(true);
+ load(false);
}, [load]);
+ useEffect(() => {
+ if (!loading && window.location.hash === '#prompt-opportunities') {
+ document.getElementById('prompt-opportunities')?.scrollIntoView();
+ }
+ }, [loading]);
+
const handleRefresh = async () => {
setRefreshing(true);
try {
@@ -70,6 +77,7 @@ export function SuggestionsCard({ brandId }: Props) {
try {
await acceptSuggestion(s.id);
setSuggestions((prev) => prev.filter((x) => x.id !== s.id));
+ onAccepted?.();
toast.success('Prompt added to your tracked list');
} catch (err) {
toast.error(err instanceof Error ? err.message : 'Failed to add');
@@ -92,7 +100,7 @@ export function SuggestionsCard({ brandId }: Props) {
};
return (
- <Card>
+ <Card id="prompt-opportunities">
<CardHeader className="pb-3">
<div className="flex items-center justify-between gap-4 flex-wrap">
<div className="flex items-center gap-2">
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx
index 3109d93ae..730dadec4 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx
@@ -582,6 +582,8 @@ export default function PromptsPage() {
{/* ─── All Prompts tab ─────────────────────────────────────────── */}
<TabsContent value="all" className="mt-4 space-y-4">
+ {activeBrandId && <SuggestionsCard brandId={activeBrandId} onAccepted={loadData} />}
+
{!loading && unanalyzedCount > 0 && (
<div className="flex flex-col gap-3 rounded-lg border border-amber-200 bg-amber-50 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-amber-900/50 dark:bg-amber-950/30">
<div className="flex items-start gap-2.5">
@@ -811,9 +813,6 @@ export default function PromptsPage() {
</Card>
</div>
- {/* Prompt Suggestions */}
- {activeBrandId && <SuggestionsCard brandId={activeBrandId} />}
-
{/* Prompt Volume Table */}
<Card>
<CardHeader className="pb-3">