fix: hide chart when dataset is empty#119
Conversation
✅ Deploy Preview for agentscan ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAccountEventsTimeline.vue now detects when aggregated series totals are zero and shows a centered “No activity to display” fallback (using VueUiIcon) instead of rendering VueUiXy; nuxt.config.ts updates Vite optimizeDeps to include specific ChangesEmpty State Detection and Fallback UI
Vite optimizeDeps update
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
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)
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.
🧹 Nitpick comments (1)
app/components/Chart/AccountEventsTimeline.vue (1)
199-204: 💤 Low valueSolid implementation of the emptiness check.
The logic correctly sums all series values across the dataset and handles nullable values appropriately. The nullish coalescing operator usage is consistent with how series values are handled elsewhere in the component (e.g., line 210).
Optional: Add explanatory comment
Consider adding a brief comment to document the purpose:
+// Check if dataset has zero total activity across all series const isEmpty = computed( () => datasetLine.value .flatMap((d) => d.series) .reduce((a, b) => (a ?? 0) + (b ?? 0), 0) === 0, );🤖 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 `@app/components/Chart/AccountEventsTimeline.vue` around lines 199 - 204, Add a brief explanatory comment above the isEmpty computed property to document its purpose: that it flattens datasetLine.value series arrays, null-coalesces series values, sums them, and returns true when the total is zero; reference the isEmpty computed, datasetLine, and the inner series to make intent clear for future readers and to match existing style (similar to other inline comments around series handling).
🤖 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.
Nitpick comments:
In `@app/components/Chart/AccountEventsTimeline.vue`:
- Around line 199-204: Add a brief explanatory comment above the isEmpty
computed property to document its purpose: that it flattens datasetLine.value
series arrays, null-coalesces series values, sums them, and returns true when
the total is zero; reference the isEmpty computed, datasetLine, and the inner
series to make intent clear for future readers and to match existing style
(similar to other inline comments around series handling).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c8298734-0e72-4218-859c-4be863143c42
📒 Files selected for processing (1)
app/components/Chart/AccountEventsTimeline.vue
| </VueUiXy> | ||
| <div | ||
| v-if="isEmpty" | ||
| class="w-full h-64 flex place-items-center justify-center" |
There was a problem hiding this comment.
I would probably make it less tall: like around 160px or so
| > | ||
| <div class="flex flex-col items-center gap-4"> | ||
| <VueUiIcon name="chartSparkline" :stroke="colors.text" /> | ||
| <p class="text-gh-muted">No recent events</p> |
There was a problem hiding this comment.
I like it a lot!
"No recent events" is probably not the right copy, since sometimes there are events, just none we can show. We need something else, like "No activity to display"? What do you think?
There was a problem hiding this comment.
Way better indeed!

Resolves #118
Displays a chart icon with a message when the dataset is empty
The icon is part of the vue-data-ui library.
Other icons available: https://vue-data-ui.graphieros.com/docs#vue-ui-icon
Summary by CodeRabbit
Bug Fixes
Chores