Skip to content

feat(streak): add hide_background parameter to make SVG background transparent#205

Open
Subhooo5 wants to merge 2 commits into
JhaSourav07:mainfrom
Subhooo5:feat/hide-background-param
Open

feat(streak): add hide_background parameter to make SVG background transparent#205
Subhooo5 wants to merge 2 commits into
JhaSourav07:mainfrom
Subhooo5:feat/hide-background-param

Conversation

@Subhooo5
Copy link
Copy Markdown
Contributor

Description

Fixes #131
Adds a hide_background=true URL parameter that makes the base of the SVG transparent, allowing the monolith to float naturally on a README page without a solid background box.

Changes made:

  • lib/validations.ts — Added hide_background field to streakParamsSchema as an optional boolean-transformed string
  • app/api/streak/route.ts — Destructured hide_background from parsed params and passed it into BadgeParams as hideBackground
  • types/index.ts — added hideBackground?: boolean to the BadgeParams interface
  • lib/svg/generator.ts — updated both generateSVG and generateAutoThemeSVG to conditionally set the background fill to transparent when hideBackground is true
  • README.md — added hide_background to the Parameter Reference table

Pillar

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

Visual Preview

https://collection.cloudinary.com/dqvm8dce2/ce54209a1a00e816516d85178dbd53c7

Hitting /api/streak?user=YOUR_USERNAME&hide_background=true returns a valid SVG with a transparent background, letting the monolith float on the page.

Checklist

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME&hide_background=true).
  • I have run npm run format and npm run lint locally and resolved all errors.
  • My commits follow the Conventional Commits format.
  • I have updated README.md if I added a new theme or URL parameter.
  • I have starred the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 19, 2026

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

A member of the Team first needs to authorize it.

@Subhooo5
Copy link
Copy Markdown
Contributor Author

Subhooo5 commented May 19, 2026

@JhaSourav07 All done. Working seamlessly, passing all tests. Whenever possible please add the necessary tags and feel free to review and merge 🚀🫂

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
commitpulse Ready Ready Preview, Comment May 19, 2026 10:49am

@JhaSourav07
Copy link
Copy Markdown
Owner

@Subhooo5

Can you keep the commits focused to 1 for the PR?

@JhaSourav07 JhaSourav07 added GSSoC 2026 level:intermediate Moderate complexity tasks quality:exceptional Outstanding contribution with exceptional implementation quality, testing. gssoc:approved PR has been reviewed and accepted for valid contribution points labels May 19, 2026
@github-actions github-actions Bot added this to the GSSoC 2026 milestone May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points GSSoC 2026 level:intermediate Moderate complexity tasks quality:exceptional Outstanding contribution with exceptional implementation quality, testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add hide_background URL Parameter for Transparent Badges

2 participants