-
-
Notifications
You must be signed in to change notification settings - Fork 238
fix: tweak versions chart config #1365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThis pull request introduces chart export functionality to the VersionDistribution component, enabling users to download charts as CSV, PNG, or SVG files with sanitized, date-range-inclusive filenames. The changes include configuration for export button titles and callbacks, conversion of chart data to downloadable blobs, and UI enhancements such as horizontal grid lines, adjusted axis label styling, and increased mobile chart height. Additionally, a minor aspect ratio adjustment was made to the modal placeholder in the Versions component to improve rendering stability during transitions. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/components/Package/VersionDistribution.vue (1)
121-191:⚠️ Potential issue | 🟡 MinorDefer object URL revocation and set CSV MIME type for downloads.
The
loadFilefunction triggers downloads asynchronously viaa.click(), but object URLs are revoked immediately afterwards in both the CSV and SVG callbacks. This creates a race condition where browsers may not have begun reading the blob URL before revocation, causing downloads to fail—particularly in Safari. Additionally, the CSV Blob should explicitly specify its MIME type.🛠️ Suggested changes
- const blob = new Blob([ - csvStr - .replace('data:text/csv;charset=utf-8,', '') - .replaceAll(`\n${multilineDateTemplate}`, ` ${multilineDateTemplate}`), - ]) + const blob = new Blob( + [ + csvStr + .replace('data:text/csv;charset=utf-8,', '') + .replaceAll(`\n${multilineDateTemplate}`, ` ${multilineDateTemplate}`), + ], + { type: 'text/csv;charset=utf-8' }, + ) const url = URL.createObjectURL(blob) loadFile(url, buildExportFilename('csv')) - URL.revokeObjectURL(url) + setTimeout(() => URL.revokeObjectURL(url), 0)Apply the same
setTimeoutdeferral to the SVG callback (line 166).
Follow up to the awesome #1245