Skip to content

Commit 0efc4e0

Browse files
committed
feat: Add warning message when star analytics has low data coverage
1 parent 7071b2d commit 0efc4e0

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

components/Visualizer.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2384,10 +2384,26 @@ const Visualizer: React.FC<VisualizerProps> = ({
23842384
{/* Repo Age & Data Info */}
23852385
<div className="flex items-center justify-between mb-4 text-[10px] text-[#64748b]">
23862386
<span>📅 Created {starAnalytics.createdAt} ({starAnalytics.ageInDays} days ago)</span>
2387-
<span className={`px-2 py-0.5 rounded ${starAnalytics.dataCompleteness >= 90 ? 'bg-[#22c55e]/20 text-[#22c55e]' : 'bg-[#fbbf24]/20 text-[#fbbf24]'}`}>
2387+
<span className={`px-2 py-0.5 rounded ${starAnalytics.dataCompleteness >= 90 ? 'bg-[#22c55e]/20 text-[#22c55e]' : starAnalytics.dataCompleteness >= 10 ? 'bg-[#fbbf24]/20 text-[#fbbf24]' : 'bg-[#ef4444]/20 text-[#ef4444]'}`}>
23882388
{starAnalytics.dataCompleteness.toFixed(0)}% data coverage
23892389
</span>
23902390
</div>
2391+
2392+
{/* Low data coverage warning */}
2393+
{starAnalytics.dataCompleteness < 10 && (
2394+
<div className="bg-[#ef4444]/10 border border-[#ef4444]/30 rounded-lg p-3 mb-4">
2395+
<div className="flex items-start gap-2">
2396+
<span className="text-[#ef4444] text-lg">⚠️</span>
2397+
<div>
2398+
<p className="text-[#ef4444] text-xs font-medium">Limited star history data</p>
2399+
<p className="text-[#94a3b8] text-[10px] mt-1">
2400+
For repos with {starAnalytics.totalStars.toLocaleString()}+ stars, GitHub API rate limits prevent fetching complete history.
2401+
Add a <span className="text-[#fbbf24]">GitHub Token</span> with higher rate limits to see detailed charts.
2402+
</p>
2403+
</div>
2404+
</div>
2405+
</div>
2406+
)}
23912407

23922408
{/* Star Stats Grid */}
23932409
<div className="grid grid-cols-2 sm:grid-cols-5 gap-3 mb-6">

0 commit comments

Comments
 (0)