Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds binary-file detection and handling to the package code page. New utility 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue (1)
547-552: Consider addingtarget="_blank"andrel="noopener noreferrer"for the external link.The "View raw file" link points to an external CDN URL but doesn't include the
target="_blank"attribute. This differs from the similar raw file link on line 507-515, which opens in a new tab. For consistency and better UX (users likely expect external links to open in a new tab), consider adding these attributes.Proposed fix
<LinkBase variant="button-secondary" :to="`https://cdn.jsdelivr.net/npm/${packageName}@${version}/${filePath}`" + target="_blank" + rel="noopener noreferrer" > {{ $t('code.view_raw') }} + <span class="i-lucide:external-link w-3 h-3 inline-block ml-1" aria-hidden="true" /> </LinkBase>
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4b5f336c-2b3d-46de-aaf1-d539e366668d
📒 Files selected for processing (4)
app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vueapp/utils/file-types.tsi18n/locales/en.jsoni18n/schema.json
|
I'm not sure I would have this "render anyway" option. If the user really wants to look at a binary file, they can "view raw". This is how GitHub does it too and it does work pretty well |
Hi, thanks for the feedback! That's a good point! I checked the behavior on Github, it does look good. I will update my code. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 698b1378-45f1-45d6-bf35-f1b53972e13f
📒 Files selected for processing (3)
app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vuei18n/locales/en.jsoni18n/schema.json
🚧 Files skipped from review as they are similar to previous changes (2)
- i18n/schema.json
- i18n/locales/en.json
app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue
Show resolved
Hide resolved
b934ca7 to
435160b
Compare
| ]) | ||
|
|
||
| export function isBinaryFilePath(filePath: string): boolean { | ||
| const ext = filePath.split('.').pop()?.toLowerCase() ?? '' |
There was a problem hiding this comment.
It would be more efficient to use lastIndexOf here and, if it is more than -1, slice from there to get the extension
🔗 Linked issue
Resolves #1945
🧭 Context
The binary file is rendered directly, which is not a good user experience. Before supporting different binary file rendering (e.g. image), it would be better to show a warning and allow user to render it anyway.
📚 Description