| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Sorry, something went wrong.
|
Lost in the diff? Review this PR in Change Stack to follow the change map from intent to exact ranges. 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 reviews.auto_review.auto_pause_after_reviewed_commits setting. Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds an Access-Control-Allow-Origin header and uses the shared cache constant for the cached downloads SVG endpoint; replaces the embed “copy URL” label with an info-icon TooltipApp and adds a translated tip (and schema entry) that explains the default 12-month date range when startDate/endDate are omitted. ChangesSVG Embed CORS, caching and date defaults
Possibly related PRs
Suggested reviewers
✏️ 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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
📢 Thoughts on this report? Let us know! |
Sorry, something went wrong.
There was a problem hiding this comment.
server/api/embed/downloads.svg.get.ts (1)🤖 Prompt for all review comments with AI agents14-15: 💤 Low value
Consider removing the Vary: Origin header.
The Vary: Origin header instructs caches to store separate copies of the response for different origins. However, since Access-Control-Allow-Origin: * is constant for all requests, the response doesn't actually vary by origin. Including Vary: Origin creates unnecessary cache fragmentation without benefit.
Vary: Origin is typically used when the CORS header value is conditionally set based on the request origin (e.g., echoing back specific origins), but with *, it's redundant.
♻️ Proposed fix🤖 Prompt for AI AgentssetHeader(event, 'Access-Control-Allow-Origin', '*') -setHeader(event, 'Vary', 'Origin')Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@server/api/embed/downloads.svg.get.ts` around lines 14 - 15, The Vary: Origin header is redundant when Access-Control-Allow-Origin is '*'—remove the setHeader call that sets 'Vary' on the response (the call like setHeader(event, 'Vary', 'Origin')) or change it to only set Vary when the CORS value is dynamic; leave the setHeader(event, 'Access-Control-Allow-Origin', '*') intact and ensure no other code reintroduces Vary for this route.
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 `@server/api/embed/downloads.svg.get.ts`: - Around line 14-15: The Vary: Origin header is redundant when Access-Control-Allow-Origin is '*'—remove the setHeader call that sets 'Vary' on the response (the call like setHeader(event, 'Vary', 'Origin')) or change it to only set Vary when the CORS value is dynamic; leave the setHeader(event, 'Access-Control-Allow-Origin', '*') intact and ensure no other code reintroduces Vary for this route.
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6baa83d6-9eb5-4fd6-97d1-8ccbfd19440d
📥 CommitsReviewing files that changed from the base of the PR and between 396b17f and 0bac49c.
📒 Files selected for processing (1)
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@server/utils/embed-downloads-svg.ts`:
- Around line 145-154: The date math around effectiveEndDate/effectiveStartDate
is timezone-unsafe because it mixes parsing a UTC date string with local-time
mutators (new Date(...), setDate, setFullYear, getFullYear); change the
computations to use UTC-based constructors and accessors: build defaultEndDate
and defaultStartDate using Date.UTC (or new Date(Date.UTC(...))) and use
getUTCDate/setUTCDate and getUTCFullYear/setUTCFullYear (or operate on UTC
milliseconds) so that effectiveEndDate and effectiveStartDate (and the default*
variables) are computed in UTC consistently with parseDateQuery and the
toISOString().split('T')[0] formatting. Ensure the logic still falls back to
requestedEndDate and parseDateQuery(query.startDate ?? query.start) but uses the
UTC-safe date objects for the -1 day and -1 year adjustments.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: de3da5ad-6e37-46ee-a3b8-1b509adbe3c3
📥 CommitsReviewing files that changed from the base of the PR and between 3e108d0 and 89d389f.
📒 Files selected for processing (1)
Sorry, something went wrong.
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly. You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description. Tracked Files
|
Sorry, something went wrong.
There was a problem hiding this comment.
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/TrendsChart.vue (1)1976-1976: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win
Remove the stray + token in the button tag.
Line 1976 introduces invalid template syntax inside the <button> start tag, which will break SFC compilation.
Suggested fix🤖 Prompt for AI Agents<button type="button" :aria-expanded="showEmbedFields" - + aria-controls="trends-embed-chart" class="self-start flex items-center gap-1 text-2xs font-mono text-fg-subtle hover:text-fg transition-colors" `@click`="showEmbedFields = !showEmbedFields" >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/Package/TrendsChart.vue` at line 1976, Remove the stray '+' character inside the malformed <button> start tag in the TrendsChart.vue template (that stray token at the start of the button element is causing invalid SFC syntax); edit the template to delete the '+' so the button tag is a valid opening tag (e.g., <button ...>), then save and verify the component compiles and the surrounding markup remains correctly formed.
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Outside diff comments: In `@app/components/Package/TrendsChart.vue`: - Line 1976: Remove the stray '+' character inside the malformed <button> start tag in the TrendsChart.vue template (that stray token at the start of the button element is causing invalid SFC syntax); edit the template to delete the '+' so the button tag is a valid opening tag (e.g., <button ...>), then save and verify the component compiles and the surrounding markup remains correctly formed.
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4bb16329-5098-4f27-a87f-34b6c1dcdf0c
📥 CommitsReviewing files that changed from the base of the PR and between 89d389f and 3df7aae.
📒 Files selected for processing (4)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Follow up to #2833
This enables CORS on the embed downloads chart endpoint, to enable fetch and retrieve the svg string. Without it, only the image tag can be consumed with the url in its src.
I also added a tooltip, informing that startDate and endDate can be omitted from the query to dynamically get the last year of data.