Fix demo chart data consistency#1390
Conversation
- Add generateConsistentDemoData() to ensure chart totals match stacked per-app data - Add getDemoDayCount() to match demo data length with chart labels - Update UsageCard, BundleUploadsCard, DeploymentStatsCard to use consistent demo generation Addresses PR review feedback about demo totals not matching stacked chart data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis pull request introduces unified demo data generation utilities ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a58b7826f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { | ||
| calculateDemoEvolution, | ||
| DEMO_APP_NAMES, | ||
| generateConsistentDemoData, | ||
| generateDemoBandwidthData, |
There was a problem hiding this comment.
Restore getDaysInCurrentMonth import used by defaults
The import block no longer brings in getDaysInCurrentMonth, but the data prop default still calls it (default: () => Array.from({ length: getDaysInCurrentMonth() })). This means the symbol is now undefined: TypeScript will flag it, and if data is ever omitted (e.g., during refactors or tests) the component will throw a ReferenceError at runtime. This regression was introduced by removing the import here; either re‑import getDaysInCurrentMonth or change the default to avoid that call.
Useful? React with 👍 / 👎.
|
…1390) - Add generateConsistentDemoData() to ensure chart totals match stacked per-app data - Add getDemoDayCount() to match demo data length with chart labels - Update UsageCard, BundleUploadsCard, DeploymentStatsCard to use consistent demo generation Addresses PR review feedback about demo totals not matching stacked chart data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…1390) - Add generateConsistentDemoData() to ensure chart totals match stacked per-app data - Add getDemoDayCount() to match demo data length with chart labels - Update UsageCard, BundleUploadsCard, DeploymentStatsCard to use consistent demo generation Addresses PR review feedback about demo totals not matching stacked chart data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…ap-go#1390) - Add generateConsistentDemoData() to ensure chart totals match stacked per-app data - Add getDemoDayCount() to match demo data length with chart labels - Update UsageCard, BundleUploadsCard, DeploymentStatsCard to use consistent demo generation Addresses PR review feedback about demo totals not matching stacked chart data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>


Summary
Addresses PR review feedback from #1389 about demo data inconsistency:
Fix totals not matching stacked chart: Demo totals are now derived from per-app breakdown by generating per-app data first, then summing to create the total series. This ensures the card stats always match the stacked chart data.
Fix array length mismatch with chart labels: Added
getDemoDayCount()to determine correct demo data length based on chart mode (30 for last-30-days, or billing period length otherwise).Test plan
Checklist
bun run lint:backend && bun run lint.accordingly.
my tests
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.