fix(dashboard): show scraper center count as active sources#22
Conversation
Active Sources StatCard now displays data.scrapers.length as the primary
value (number of scrapers registered in Scraper Center) and
data.stats.active_sources as the sub-label ("N with events"), replacing
the previous inversion.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe dashboard page adds a ChangesDashboard Loading State and StatCard Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/frontend/src/routes/+page.svelte (1)
12-17: ⚡ Quick win
loadinghere creates a one-tick skeleton flash instead of true loading behavior.On Line 14 and Line 15, this state always flips to
falseon the first client tick, so charts are briefly hidden even when data is already ready. Consider removing the synthetic flag and rendering based on real data presence only.Proposed simplification
- // Data arrives via +page.ts load(); show chart skeletons until the first - // client tick confirms render (also covers slow-network navigation). - let loading = $state(true); - $effect(() => { - loading = false; - });- {`#if` loading} - <ChartSkeleton /> - {:else if sourceData.length} + {`#if` sourceData.length} <BarChart labels={sourceLabels} data={sourceData} /> {:else} <p class="py-16 text-center text-sm text-muted">No events scraped yet.</p> {/if}- {`#if` loading} - <ChartSkeleton /> - {:else if catData.length} + {`#if` catData.length} <DonutChart labels={catLabels} data={catData} /> {:else} <p class="py-16 text-center text-sm text-muted">No categorized events yet.</p> {/if}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/frontend/src/routes/`+page.svelte around lines 12 - 17, The loading state variable and its associated $effect are causing unnecessary skeleton flashing by unconditionally setting loading to false on the first tick regardless of actual data readiness. Remove both the loading state declaration and the $effect block that sets it to false, then update any conditional rendering that checks for loading (likely using {`#if` loading} syntax) to instead check for the actual presence of data from the +page.ts load function to achieve true loading behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/frontend/src/routes/`+page.svelte:
- Line 35: The StatCard component for "Active Sources" passes the raw value of
data.scrapers.length without localized number formatting, while other stat cards
use toLocaleString() for consistency. Apply toLocaleString() to the value prop
in the StatCard on line 35 where data.scrapers.length is passed to format the
number according to the user's locale for consistent display across all stat
cards.
---
Nitpick comments:
In `@apps/frontend/src/routes/`+page.svelte:
- Around line 12-17: The loading state variable and its associated $effect are
causing unnecessary skeleton flashing by unconditionally setting loading to
false on the first tick regardless of actual data readiness. Remove both the
loading state declaration and the $effect block that sets it to false, then
update any conditional rendering that checks for loading (likely using {`#if`
loading} syntax) to instead check for the actual presence of data from the
+page.ts load function to achieve true loading behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c0f93c5a-3b98-4735-aa28-9ddf0b2e53f6
📒 Files selected for processing (1)
apps/frontend/src/routes/+page.svelte
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
data.stats.active_sourcesas the primary value anddata.scrapers.lengthas the sub-label, which was inverted from the intended UX.data.scrapers.length), with the sub-label reading"{N} with events"(data.stats.active_sources) for additional context.Test plan
active_sources/scrapers🤖 Generated with Claude Code
Summary by CodeRabbit