Skip to content

fix: honor custom dimensions in default streak badge#5328

Closed
Tanayajadhav1 wants to merge 1 commit into
JhaSourav07:mainfrom
Tanayajadhav1:fix/default-streak-badge-dimensions
Closed

fix: honor custom dimensions in default streak badge#5328
Tanayajadhav1 wants to merge 1 commit into
JhaSourav07:mainfrom
Tanayajadhav1:fix/default-streak-badge-dimensions

Conversation

@Tanayajadhav1

Copy link
Copy Markdown
Contributor

Description

Fixes #5321

This PR fixes an inconsistency in the default streak badge dimension handling.

Currently, the API accepts and validates custom width and height parameters for default streak badge requests, but the generated SVG ignores those values and continues to render using the hardcoded 600x420 dimensions.

Changes made

  • Updated the default SVG renderer to respect user-provided width and height values.
  • Preserved existing fallback behavior when custom dimensions are not supplied.
  • Updated integration tests to verify that the generated SVG uses the requested dimensions instead of the hardcoded defaults.

Example

Before:
/api/streak?user=octocat&width=777&height=666

Rendered:
viewBox="0 0 600 420"

After:
viewBox="0 0 777 666"

Pillar

  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

Before

viewBox="0 0 600 420"

After

viewBox="0 0 777 666"

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format.
  • I have updated README.md if I added a new theme or URL parameter. (Not applicable)
  • I have started the repo.
  • I have made sure that I have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse aesthetic standards.
  • [x ] (Recommended) I joined the CommitPulse Discord community.

suggested labels :

gssoc:approved , gssoc'26 , bug , level:intermediate

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@Tanayajadhav1 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Hey @Tanayajadhav1, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

Please fix the issues before this can be reviewed. Here's how:

1. Run checks locally before pushing:

npm run format:check   # Check Prettier formatting
npm run lint           # Run ESLint
npm run typecheck      # TypeScript type check
npm run test           # Run unit tests (Vitest)
npm run build          # Verify production build passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jun 12, 2026
@Aamod-Dev Aamod-Dev added level:intermediate Moderate complexity tasks type:bug Something isn't working as expected mentor:Aamod007 labels Jun 12, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I went through the changes and the overall approach to fixing the custom dimensions looks correct, but there is a major issue that needs to be addressed before this can be merged.

It appears that a significant portion of unrelated code, specifically the entire \generateSkylineSVG\ function in \lib/svg/generator.ts, was accidentally deleted in this PR. Please revert the deletion of \generateSkylineSVG\ and ensure only the code related to the default streak badge dimensions is modified.

Labels Applied:

  • \level:intermediate: The intended bug fix touches the core SVG generation logic and requires understanding the parameter handling.
  • \ ype:bug: This PR aims to fix a bug where custom dimensions were ignored.
  • \mentor:Aamod007\

Once the unrelated deletions are reverted and the fix is isolated, I'll be happy to take another look. Thanks again for the contribution.

@Aamod-Dev Aamod-Dev added gssoc:approved PR has been reviewed and accepted for valid contribution points quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. labels Jun 12, 2026
@Aamod-Dev

Copy link
Copy Markdown
Collaborator

Review Update
Automatically adjusted labels to meet the strict 1:1:1:1:1 category requirement.

@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 12, 2026
@Aamod-Dev Aamod-Dev added level:advanced Complex contributions involving architecture, optimization, or significant feature work and removed level:intermediate Moderate complexity tasks labels Jun 13, 2026
@Aamod-Dev Aamod-Dev added GSSoC 2026 type:design UI designs, styling, SVG icons, and themes labels Jun 13, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is currently marked with the \status:blocked\ label. Please resolve the blockers so we can proceed with a full review and approval.

@Aamod-Dev Aamod-Dev added level:advanced Complex contributions involving architecture, optimization, or significant feature work quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. and removed level:advanced Complex contributions involving architecture, optimization, or significant feature work quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. labels Jun 13, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I went through the changes and have evaluated them according to the rubric.

@JhaSourav07 JhaSourav07 removed the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jun 13, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the issues that caused the blocked label before this can be approved.

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is currently blocked due to a failing CI check or other blocking issues. Please fix the blocking issues so we can proceed with the review and approval process.

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is blocked, so I can’t approve it yet. The dimension handling looks like the right direction, but lib/svg/generator.ts is doing a very broad rewrite and the PR is still marked blocked. Please clear the blocker, then add a focused test proving the custom width and height values are respected without breaking the existing default badge paths.

@Aamod-Dev Aamod-Dev added the level:beginner Small changes Usually isolated fixes or simple UI/text updates. label Jun 18, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Difficulty: beginner – Bug fix implementation.

Quality: clean – Solid fix.

Type: bug – Issue resolution.

Good fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:needs-rebase GSSoC 2026 level:advanced Complex contributions involving architecture, optimization, or significant feature work level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. status:blocked This PR is blocked due to a failing CI check. type:bug Something isn't working as expected type:design UI designs, styling, SVG icons, and themes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Default streak badge validates width/height parameters but ignores them during SVG rendering

3 participants