fix: enrichment pipeline reliability + loading page gradient + button click area
- generate-report: filter empty strings from AI social handles, add saveError logging - useReport: 3-level fallback for social handles (report > clinicInfo > scrape_data) - useEnrichment: always trigger enrichment if clinicName exists (not just IG/YT handles) - Hero: pointer-events-none on decorative blobs (were blocking button clicks) - AnalysisLoadingPage: warm gradient on INFINITH logo text (#fff3eb → #e4cfff → #f5f9ff) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
72ea8f4a2d
commit
ad625e08ee
5 files changed
+43
-21
No files matched your search
@@ -187,11 +187,15 @@ ${JSON.stringify(analyzeResult.data?.analysis || {}, null, 2)}
|
||||
.filter((h): h is string => h !== null)
|
||||
)];
|
||||
|
||||
// Filter out empty strings — AI sometimes returns "" instead of null
|
||||
const pickNonEmpty = (...vals: (string | null | undefined)[]): string | null =>
|
||||
vals.find(v => v && v.trim().length > 0) || null;
|
||||
|
||||
const normalizedHandles = {
|
||||
instagram: igHandles.length > 0 ? igHandles : null, // array of handles
|
||||
youtube: aiSocial.youtube || scrapeSocial.youtube || null,
|
||||
facebook: aiSocial.facebook || scrapeSocial.facebook || null,
|
||||
blog: aiSocial.naverBlog || scrapeSocial.blog || null,
|
||||
instagram: igHandles.length > 0 ? igHandles : null,
|
||||
youtube: pickNonEmpty(aiSocial.youtube, scrapeSocial.youtube),
|
||||
facebook: pickNonEmpty(aiSocial.facebook, scrapeSocial.facebook),
|
||||
blog: pickNonEmpty(aiSocial.naverBlog, scrapeSocial.blog),
|
||||
};
|
||||
|
||||
// Embed normalized handles in report for DB persistence
|
||||
@@ -211,6 +215,10 @@ ${JSON.stringify(analyzeResult.data?.analysis || {}, null, 2)}
|
||||
.select("id")
|
||||
.single();
|
||||
|
||||
if (saveError) {
|
||||
console.error("DB save error:", saveError);
|
||||
}
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: true,
|
||||
@@ -226,6 +234,7 @@ ${JSON.stringify(analyzeResult.data?.analysis || {}, null, 2)}
|
||||
aiGeneration: !report.parseError,
|
||||
},
|
||||
socialHandles: normalizedHandles,
|
||||
saveError: saveError?.message || null,
|
||||
address,
|
||||
services,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user