Skip to content

feat(svg): add option to toggle heavy SVG Glow Filters (glow=true/false)#1925

Merged
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
nishtha-agarwal-211:feat/toggle-glow
May 31, 2026
Merged

feat(svg): add option to toggle heavy SVG Glow Filters (glow=true/false)#1925
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
nishtha-agarwal-211:feat/toggle-glow

Conversation

@nishtha-agarwal-211
Copy link
Copy Markdown
Contributor

Description

Fixes #1731

Introduces a new glow URL query parameter (glow=true/false) that allows users to enable or disable heavy SVG Gaussian blur filters (<feGaussianBlur>) and text shadow-effects on active contribution statistics/total labels.

When glow=false is requested:

  • The <filter id="glow"> (and <filter id="hm-glow"> for heatmaps) tags are completely omitted from <defs>.
  • The corresponding filter="url(#glow)" (and cell-level filter="url(#hm-glow)" on heatmaps) attributes are conditionally removed from the text and cell elements.
  • Heavy multi-layered stroke offsets are omitted, reducing drawing instructions and saving payload bytes.

This provides an optimized, flatter, and crisper vector styling alternative designed to dramatically enhance scroll performance on low-end mobile devices and ensure support on markdown renderers that block filter assets.

Fixes #1731

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Enhancement, performance)

Visual Preview

N/A — Visual layout remains identical to baseline, but Gaussian blur filter masks are removed to output flat, sharp vector paths.

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 (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • 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 "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

Copilot AI review requested due to automatic review settings May 31, 2026 03:06
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 31, 2026

@nishtha-agarwal-211 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new optional glow parameter to streak/heatmap badges, allowing users to disable SVG glow filters via query string. Defaults to true to preserve current behavior.

Changes:

  • Adds glow field to BadgeParams type and streakParamsSchema with default true.
  • Conditionally renders <filter id="glow"> / <filter id="hm-glow"> defs and filter="url(...)" attributes in generator.ts based on params.glow.
  • Threads glow through the streak API route and adds unit tests for schema and SVG rendering.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
types/index.ts Adds optional glow field to BadgeParams.
lib/validations.ts Adds glow zod field with default true and string→boolean transform.
lib/validations.test.ts Tests for the new glow schema behavior.
lib/svg/generator.ts Conditionally emits glow filters and attributes; plumbs glow into heatmap grid.
lib/svg/generator.test.ts Tests glow inclusion/omission in main and heatmap SVGs.
app/api/streak/route.ts Extracts and forwards glow into badge params.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/validations.ts
Comment on lines +243 to +250
glow: z
.string()
.optional()
.transform((val) => {
if (val === undefined) return true;
return val === 'true' || val === '1';
})
.default(true),
Comment thread lib/svg/generator.ts
Comment on lines +162 to +165
const filterGlow =
params.glow !== false
? `<filter id="glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="${fs(5)}" result="blur" /><feComposite in="SourceGraphic" in2="blur" operator="over" /></filter>`
: '';
Comment thread lib/svg/generator.test.ts
Comment on lines +1467 to +1471
it('renders glow filter and attributes by default', () => {
const svg = generateSVG(mockStats, { user: 'avi' } as unknown as BadgeParams, mockCalendar);
expect(svg).toContain('<filter id="glow"');
expect(svg).toContain('filter="url(#glow)"');
});
Comment thread lib/svg/generator.ts
Comment on lines 167 to 170
return `<defs>
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="${fs(5)}" result="blur" /><feComposite in="SourceGraphic" in2="blur" operator="over" /></filter>
${filterGlow}
${gradients}
</defs>`;
@github-actions github-actions Bot added the needs-rebase This PR has merge conflicts and needs a rebase. label May 31, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

24 similar comments
@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @nishtha-agarwal-211, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions github-actions Bot removed the needs-rebase This PR has merge conflicts and needs a rebase. label May 31, 2026
Copy link
Copy Markdown
Collaborator

@Aamod007 Aamod007 left a comment

Choose a reason for hiding this comment

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

Adds a glow URL parameter (defaults to true, backward compatible) to toggle heavy SVG Gaussian blur filters. When glow=false, the <filter id=glow> (and hm-glow for heatmaps) tags are omitted from <defs>, and filter=url(#glow) attributes are removed from text/cell elements. Applied across regular badge SVG, wrapped SVG, heatmap SVG, and auto-theme heatmap variants.

  • 6 files, +147/-21
  • 1158/1158 tests pass (4 pre-existing failures from missing gsap/react-force-graph-2d deps)
  • TypeScript typecheck has no new errors

@JhaSourav07 JhaSourav07 merged commit 6968850 into JhaSourav07:main May 31, 2026
4 of 5 checks passed
@github-actions
Copy link
Copy Markdown

🎉 Congratulations @nishtha-agarwal-211! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@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 mentor:Aamod007 labels May 31, 2026
@github-actions github-actions Bot added this to the GSSoC 2026 milestone May 31, 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 mentor:Aamod007 quality:exceptional Outstanding contribution with exceptional implementation quality, testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add option to toggle heavy SVG Glow Filters (glow=true/false)

4 participants