This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix

+70 -52
+23 -15
src/app/api/bluesky/stats/route.ts
··· 229 229 console.log(`Records with DID: ${recordsWithDid.length}`); 230 230 } 231 231 232 - // Create a map of month -> count 232 + // Create a map of month -> count (filter for 2025+) 233 233 const monthlyCounts = new Map<string, number>(); 234 234 235 + // Filter data to only include 2025 and later 236 + const data2025Plus = dailyData?.filter(entry => { 237 + const year = new Date(entry.created_at).getFullYear(); 238 + return year >= 2025; 239 + }); 240 + 235 241 // Get the earliest and latest dates to ensure all months are included 236 - if (dailyData && dailyData.length > 0) { 237 - const dates = dailyData.map(e => new Date(e.created_at)); 242 + if (data2025Plus && data2025Plus.length > 0) { 243 + const dates = data2025Plus.map(e => new Date(e.created_at)); 238 244 const minDate = new Date(Math.min(...dates.map(d => d.getTime()))); 239 245 const maxDate = new Date(Math.max(...dates.map(d => d.getTime()))); 240 246 241 - // Initialize all months with 0 242 - const currentMonth = new Date(minDate.getFullYear(), minDate.getMonth(), 1); 247 + // Initialize all months with 0 (starting from Jan 2025 or the earliest date) 248 + const startMonth = new Date(Math.max(minDate.getTime(), new Date(2025, 0, 1).getTime())); 249 + const currentMonth = new Date(startMonth.getFullYear(), startMonth.getMonth(), 1); 243 250 const endMonth = new Date(maxDate.getFullYear(), maxDate.getMonth(), 1); 244 251 245 252 while (currentMonth <= endMonth) { ··· 249 256 } 250 257 251 258 // Process each entry to get monthly counts 252 - dailyData.forEach(entry => { 259 + data2025Plus.forEach(entry => { 253 260 const date = new Date(entry.created_at); 254 261 const monthKey = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`; 255 262 ··· 415 422 } 416 423 }); 417 424 418 - // Convert to array and sort by count to get top 10 DIDs 419 - const top10Dids = Array.from(didCounts.entries()) 425 + // Convert to array and sort by count to get top 15 DIDs (fetch extra in case some have 0) 426 + const top15Dids = Array.from(didCounts.entries()) 420 427 .sort((a, b) => b[1] - a[1]) 421 - .slice(0, 10) 428 + .slice(0, 15) 422 429 .map(([did]) => did); 423 430 424 - console.log(`Top 10 DIDs from Supabase ranking: ${top10Dids.join(', ')}`); 431 + console.log(`Top 15 DIDs from Supabase ranking: ${top15Dids.join(', ')}`); 425 432 426 - // Now fetch true counts from Bluesky API for these top 10 DIDs 427 - console.log('Fetching true counts from Bluesky API for top 10 users...'); 433 + // Now fetch true counts from Bluesky API for these top 15 DIDs 434 + console.log('Fetching true counts from Bluesky API for top 15 users...'); 428 435 const leaderboardWithTrueCounts = await Promise.all( 429 - top10Dids.map(async (did) => { 436 + top15Dids.map(async (did) => { 430 437 const trueCount = await fetchTrueCountFromBluesky(did); 431 438 const supabaseCount = didCounts.get(did) || 0; 432 439 ··· 440 447 }) 441 448 ); 442 449 443 - // Sort by true count (descending) in case the order changed, and filter out 0s 450 + // Sort by true count (descending) in case the order changed, filter out 0s, and take top 10 444 451 const leaderboard = leaderboardWithTrueCounts 445 452 .filter(item => item.count > 0) // Only include users with at least 1 flush 446 - .sort((a, b) => b.count - a.count); 453 + .sort((a, b) => b.count - a.count) 454 + .slice(0, 10); // Take top 10 after filtering 447 455 448 456 console.log(`Leaderboard after filtering (${leaderboard.length} users with flushes > 0)`); 449 457
+33 -24
src/app/profile/[handle]/page.tsx
··· 370 370 const perDay = parseFloat((userEntries.length / activeDaysCount).toFixed(1)); 371 371 setFlushesPerDay(perDay); 372 372 373 - // Generate chart data (group by month) 373 + // Generate chart data (group by month) - filter for 2025 and later 374 374 const chartDataMap = new Map<string, number>(); 375 375 376 - // Get the earliest and latest dates 377 - const dates = userEntries.map(e => new Date(e.created_at)); 378 - const minDate = new Date(Math.min(...dates.map(d => d.getTime()))); 379 - const maxDate = new Date(Math.max(...dates.map(d => d.getTime()))); 376 + // Filter entries to only include 2025 and later 377 + const entries2025Plus = userEntries.filter((entry: FlushingEntry) => { 378 + const year = new Date(entry.created_at).getFullYear(); 379 + return year >= 2025; 380 + }); 380 381 381 - // Initialize all months with 0 382 - const currentMonth = new Date(minDate.getFullYear(), minDate.getMonth(), 1); 383 - const endMonth = new Date(maxDate.getFullYear(), maxDate.getMonth(), 1); 384 - 385 - while (currentMonth <= endMonth) { 386 - const monthKey = `${currentMonth.getFullYear()}-${String(currentMonth.getMonth() + 1).padStart(2, '0')}`; 387 - chartDataMap.set(monthKey, 0); 388 - currentMonth.setMonth(currentMonth.getMonth() + 1); 389 - } 390 - 391 - // Group entries by month 392 - userEntries.forEach((entry: FlushingEntry) => { 393 - const date = new Date(entry.created_at); 394 - const monthKey = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`; 382 + if (entries2025Plus.length > 0) { 383 + // Get the earliest and latest dates from 2025+ entries 384 + const dates = entries2025Plus.map(e => new Date(e.created_at)); 385 + const minDate = new Date(Math.min(...dates.map(d => d.getTime()))); 386 + const maxDate = new Date(Math.max(...dates.map(d => d.getTime()))); 387 + 388 + // Initialize all months with 0 (starting from Jan 2025 or the earliest date) 389 + const startMonth = new Date(Math.max(minDate.getTime(), new Date(2025, 0, 1).getTime())); 390 + const currentMonth = new Date(startMonth.getFullYear(), startMonth.getMonth(), 1); 391 + const endMonth = new Date(maxDate.getFullYear(), maxDate.getMonth(), 1); 395 392 396 - if (chartDataMap.has(monthKey)) { 397 - chartDataMap.set(monthKey, chartDataMap.get(monthKey)! + 1); 398 - } else { 399 - chartDataMap.set(monthKey, 1); 393 + while (currentMonth <= endMonth) { 394 + const monthKey = `${currentMonth.getFullYear()}-${String(currentMonth.getMonth() + 1).padStart(2, '0')}`; 395 + chartDataMap.set(monthKey, 0); 396 + currentMonth.setMonth(currentMonth.getMonth() + 1); 400 397 } 401 - }); 398 + 399 + // Group entries by month 400 + entries2025Plus.forEach((entry: FlushingEntry) => { 401 + const date = new Date(entry.created_at); 402 + const monthKey = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`; 403 + 404 + if (chartDataMap.has(monthKey)) { 405 + chartDataMap.set(monthKey, chartDataMap.get(monthKey)! + 1); 406 + } else { 407 + chartDataMap.set(monthKey, 1); 408 + } 409 + }); 410 + } 402 411 403 412 // Convert map to array and sort by date 404 413 const chartDataArray = Array.from(chartDataMap.entries())
+14 -13
src/app/profile/[handle]/profile.module.css
··· 551 551 } 552 552 553 553 .wrappedHeader { 554 - font-size: 1.8rem; 555 - font-weight: 700; 556 - margin: 0 0 0.5rem 0; 557 - color: var(--primary-color); 558 - text-align: center; 554 + font-size: 1.2rem; 555 + font-weight: 500; 556 + margin: 0 0 1rem 0; 557 + color: var(--title-color); 558 + text-align: left; 559 559 } 560 560 561 561 .wrappedSubtitle { 562 - font-size: 1rem; 563 - color: var(--timestamp-color); 564 - text-align: center; 565 - margin: 0 0 1.5rem 0; 562 + font-size: 1.1rem; 563 + color: var(--text-color); 564 + text-align: left; 565 + margin: 0 0 1rem 0; 566 566 } 567 567 568 568 .wrappedGrid { ··· 616 616 617 617 .shareWrappedButton { 618 618 display: block; 619 - width: 100%; 620 619 background-color: var(--primary-color); 621 620 color: white; 622 621 border: none; 623 622 border-radius: 4px; 624 - padding: 1rem 1.5rem; 625 - font-size: 1.1rem; 626 - font-weight: 600; 623 + padding: 0.8rem 1.2rem; 624 + font-size: 1rem; 625 + font-weight: 500; 627 626 cursor: pointer; 627 + margin-top: 1.5rem; 628 628 transition: all 0.2s; 629 + padding-top: 1rem; 629 630 } 630 631 631 632 .shareWrappedButton:hover {