Skip to content

feat: add theme presets with graceful fallback for user customization#8275

Open
sureshsuriya wants to merge 2 commits into
JhaSourav07:mainfrom
sureshsuriya:feat/7251-theme-presets
Open

feat: add theme presets with graceful fallback for user customization#8275
sureshsuriya wants to merge 2 commits into
JhaSourav07:mainfrom
sureshsuriya:feat/7251-theme-presets

Conversation

@sureshsuriya

Copy link
Copy Markdown
Contributor

Description

Fixes #7251

This PR adds multiple predefined theme presets with one-click switching, making it easier for users to customize their badges without manually configuring colors.

Changes

  • Added two new theme presets: mono and galaxy.

  • Exported a shared THEME_PRESETS list for frontend usage.

  • Updated theme handling to gracefully fall back to the default theme when an unknown theme is provided.

  • Added an X-Theme-Warning response header instead of returning a 400 Bad Request for invalid theme names.

  • Added a Theme Presets gallery on the landing page with one-click theme selection.

  • Updated the generated embed URL to include the selected theme parameter.

  • Added/updated tests covering:

    • Theme preset availability.
    • Unknown theme fallback.
    • Warning header behavior.

Pillar

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

Visual Preview

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

@vercel

vercel Bot commented Jul 22, 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 22, 2026

Copy link
Copy Markdown

This pull request enhances user experience by allowing easy theme customization through predefined presets and implementing a fallback for unknown themes. This aligns with our previous decision to implement visually themed fallback SVGs for API errors, ensuring consistency in user experience across the platform. Thank you for your contribution, and I look forward to your updates!

@retenta-bot retenta-bot Bot changed the title feat: add theme presets with graceful fallback feat: add theme presets with graceful fallback for user customization Jul 22, 2026
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jul 22, 2026
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

Asset PR Size Base Size Difference Status
static/chunks/app/page-[hash].js 21.25 KB 21.04 KB +0.21 KB (+1.00%) 🔴 Regression
static/css/[hash].css 41.11 KB 41.08 KB +0.02 KB (+0.05%) 🔴 Regression

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3985.78 KB 3984.83 KB +0.95 KB (+0.02%)
Total CSS 331.61 KB 331.41 KB +0.20 KB (+0.06%)

@Aamod007 Aamod007 added level:beginner Small changes Usually isolated fixes or simple UI/text updates. 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.

Thanks for adding the theme presets! The graceful fallback mechanism and the new presets are solid additions to the customization UI.

However, I noticed that a file named \diff.txt\ was accidentally committed to this pull request. Please remove this file from your branch and update the PR.

Looking forward to merging this once that file is removed!

Label Justification:

  • \level:beginner: Adding theme presets and updating validation falls into beginner frontend/backend tasks.
  • \quality:clean: Applied as default pending removal of the rogue file.
  • \ ype:feature: Adds new preset options to the generator UI.
  • \mentor:Aamod007: Assigned as required.

@Aamod007 Aamod007 added level:advanced Complex contributions involving architecture, optimization, or significant feature work and removed level:beginner Small changes Usually isolated fixes or simple UI/text updates. labels Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:advanced Complex contributions involving architecture, optimization, or significant feature work 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.

Add multiple theme presets with one-click switching

2 participants