fix: add date in chart tooltip#1831
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
📝 WalkthroughWalkthroughAdds a cached date formatter for tooltips, keyed by locale and displayed granularity. Extends the tooltip Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
|
||
| // Format date for compare page (multi-package mode, not in modal) | ||
| let formattedDate = '' | ||
| if (!props.inModal && hasMultipleItems && absoluteIndex !== undefined) { |
There was a problem hiding this comment.
I think just checking if hasMultipleItems and valid absoluteIndex is enough. You never know in the future if we display this chart for multiple series in a modal.
There was a problem hiding this comment.
Yes, you're right. I need to rest now. I'll fix it later.
There was a problem hiding this comment.
Oh please do rest :)
I'll do it
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/components/Package/TrendsChart.vue (1)
1619-1619: Consider showing the date for single-dataset scenarios as well.Based on prior feedback, the
hasMultipleItemscondition could be relaxed to show the formatted date even when viewing a single package chart. This would provide a consistent tooltip experience across all views. The current implementation correctly addresses the linked issue (#1815) for compare graphs, so this is entirely optional.♻️ Optional: Remove hasMultipleItems requirement
- if (hasMultipleItems && absoluteIndex !== undefined) { + if (absoluteIndex !== undefined) {
🔗 Linked issue
resolves #1815
🧭 Context
📚 Description