Skip to content

feat: add customizable label URL parameter for CommitPulse card title#8246

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
sureshsuriya:feat/5725-label-url-param
Jul 23, 2026
Merged

feat: add customizable label URL parameter for CommitPulse card title#8246
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
sureshsuriya:feat/5725-label-url-param

Conversation

@sureshsuriya

Copy link
Copy Markdown
Contributor

Description

Fixes #5725

This PR adds support for a custom label URL parameter that allows users to customize the title displayed above the isometric grid on the CommitPulse card.

Changes

  • Added support for label as a custom string while preserving the existing boolean behavior.

  • Updated request validation to:

    • Convert label=false to false.
    • Convert label=true to true.
    • Preserve any other string as a custom label.
  • Added sanitization to prevent SVG/XML injection.

  • Added truncation for labels longer than 40 characters with an ellipsis.

  • Updated both the standard and auto-theme SVG generators to render the custom label when provided.

  • Preserved the existing default title behavior when label is omitted.

  • Added unit tests covering validation, custom label rendering, sanitization, truncation, and default behavior.

Pillar

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

Visual Preview

N/A – This change introduces a new URL parameter for customizing the card title. Existing behavior remains unchanged when the parameter is omitted.

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 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).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

A member of the Team first needs to authorize it.

@retenta-bot

retenta-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

This PR adds a new feature that allows users to customize the title displayed on the CommitPulse card via a URL parameter. It includes validation and sanitization to enhance security and usability. This is somewhat related to previous decisions regarding responsive design and stability for long labels in the SectionLabel component, which aimed to prevent clipping and ensure proper rendering. If you have any questions or need further clarification, feel free to ask! Happy coding!

@retenta-bot retenta-bot Bot changed the title feat: add customizable label URL parameter for card title feat: add customizable label URL parameter for CommitPulse card title Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3985.32 KB 3985.28 KB +0.04 KB (+0.00%)
Total CSS 331.41 KB 331.41 KB 0 B

@Aamod007 Aamod007 added level:critical High-priority or mission-critical contributions affecting core systems, security, or infrastructure quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:feature New features, additions, or enhancements mentor:Aamod007 labels Jul 23, 2026

@Aamod007 Aamod007 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 an excellent feature addition! Giving users the ability to supply custom string labels directly in the URL params (while preserving backwards compatibility for boolean \label=false) adds great flexibility. The XSS sanitization and text truncation rules are exactly what we need to keep the SVGs safe and visually intact.

The implementation is very clean, and I appreciate the comprehensive unit tests!

Label Justification:

  • \level:critical: Assigned based on 5 files changed across type definitions, zod validation, and SVG rendering logic.
  • \quality:clean: Excellent validation schema transforms and robust test coverage for edge cases like XSS.
  • \ ype:feature: Adds a brand new parameter capability for custom badge labels.
  • \mentor:Aamod007: Assigned as required.

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jul 23, 2026
@JhaSourav07
JhaSourav07 merged commit 7bcc0c5 into JhaSourav07:main Jul 23, 2026
10 of 11 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jul 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @sureshsuriya! 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! 💻✨

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 level:critical High-priority or mission-critical contributions affecting core systems, security, or infrastructure mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:feature New features, additions, or enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add label URL param to customize the card title text above the isometric grid

3 participants