feat: add theme presets with graceful fallback for user customization#8275
feat: add theme presets with graceful fallback for user customization#8275sureshsuriya wants to merge 2 commits into
Conversation
|
@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. |
|
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! |
📦 Next.js Bundle Size Report (Gzipped Sizes)
📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
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.
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_PRESETSlist for frontend usage.Updated theme handling to gracefully fall back to the default theme when an unknown theme is provided.
Added an
X-Theme-Warningresponse header instead of returning a400 Bad Requestfor 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
themeparameter.Added/updated tests covering:
Pillar
Visual Preview
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors.feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.