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(reports): offer a retry when a report fails to load (#977)

Gökhan Geyikf1ba67fda929
diff --git a/web/messages/en.json b/web/messages/en.json
index c4fe3807d..c27dbddbd 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -2147,6 +2147,7 @@
"queryFanout": "Query Fan-out",
"queryFanoutDescription": "Sub-queries answer engines actually ran while answering your tracked prompts.",
"fanoutCoverage": "{queries} distinct sub-queries across {answers} answers",
+ "loadReportFailed": "Couldn't load this report.",
"notFound": "Report not found.",
"backToReports": "Back to Reports",
"generatedOn": "Generated on",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/reports/[id]/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/reports/[id]/page.tsx
index b41122b0d..0ad8f2b57 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/reports/[id]/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/reports/[id]/page.tsx
@@ -25,7 +25,7 @@ import {
TableHeader,
TableRow,
} from '@/components/ui/table';
-import { ArrowLeft, FileDown, Loader2 } from 'lucide-react';
+import { ArrowLeft, FileDown, Loader2, RotateCw } from 'lucide-react';
import { formatDate } from '@/lib/format';
import { cn } from '@/lib/utils';
import { PLATFORM_LABELS } from '@/config/platform-labels';
@@ -81,25 +81,33 @@ export default function ReportDetailPage() {
const params = useParams();
const id = params.id as string;
const t = useTranslations('reports');
+ const tCommon = useTranslations('common');
const [report, setReport] = useState<Report | null>(null);
const [loading, setLoading] = useState(true);
+ const [loadFailed, setLoadFailed] = useState(false);
+ const [attempt, setAttempt] = useState(0);
const [downloading, setDownloading] = useState(false);
useEffect(() => {
let cancelled = false;
+ setLoading(true);
+ setLoadFailed(false);
getReport(id)
.then((r) => {
if (!cancelled) setReport(r);
})
- .catch((err) => console.error('Failed to load report:', err))
+ .catch((err) => {
+ console.error('Failed to load report:', err);
+ if (!cancelled) setLoadFailed(true);
+ })
.finally(() => {
if (!cancelled) setLoading(false);
});
return () => {
cancelled = true;
};
- }, [id]);
+ }, [id, attempt]);
if (loading) {
return (
@@ -109,6 +117,20 @@ export default function ReportDetailPage() {
);
}
+ // A failed load is not a missing report: offer a retry instead of
+ // reporting it as not found.
+ if (loadFailed) {
+ return (
+ <div className="flex flex-col items-center gap-4 py-24 text-center">
+ <p className="text-sm text-muted-foreground">{t('loadReportFailed')}</p>
+ <Button variant="outline" className="gap-2" onClick={() => setAttempt((n) => n + 1)}>
+ <RotateCw className="h-4 w-4" />
+ {tCommon('retry')}
+ </Button>
+ </div>
+ );
+ }
+
if (!report) {
return (
<div className="flex flex-col items-center gap-4 py-24 text-center">