feat(og): add dynamic social card customization parameters#546
feat(og): add dynamic social card customization parameters#546Animesh-86 wants to merge 1 commit into
Conversation
|
@Animesh-86 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds theming support for the OG image endpoint and wires dashboard metadata generation to pass theme/color query parameters.
Changes:
- Extend OG query param validation to accept
theme,bg,text, andaccent. - Update
/api/ogrendering to resolve colors from a selected theme with optional overrides. - Update dashboard
generateMetadata(and its test) to build OG image URLs including the new query params.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| lib/validations.ts | Adds schema fields for theme + color overrides with sanitization transforms. |
| app/api/og/route.tsx | Applies theme/override colors when rendering the OG image. |
| app/(root)/dashboard/[username]/page.tsx | Forwards dashboard search params into the OG image URL. |
| app/(root)/dashboard/[username]/page.test.tsx | Updates metadata test to assert the new query string format. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
67d4885 to
644c720
Compare
Aamod007
left a comment
There was a problem hiding this comment.
fix : params type regression — Changed Promise<{ username: string }> → { username: string } and dropped await. Build passes but diverges from Next.js convention. Fragile on upgrade.
Hardcoded card colors — longestStreak (#f78166), currentStreak (#3fb950) ignore accent param. Only "total commits" is dynamic.
Card overlay too subtle — 3% opacity glassmorphic cards nearly invisible, especially on light themes. Bump to 5-8%.
|
🚨 Hey @Animesh-86, the CI Pipeline is failing on this PR and it has been marked as Please fix the issues before this can be reviewed. Here's how: 1. Run checks locally before pushing: npm run format:check # Check Prettier formatting
npm run lint # Run ESLint
npm run typecheck # TypeScript type check
npm run test # Run unit tests (Vitest)
npm run build # Verify production build passes2. Auto-fix common issues: npm run format # Auto-fix formatting with Prettier
npm run lint -- --fix # Auto-fix lint errors where possible3. Check the full failure log here: Once you push a fix and the CI passes, the |
1a9429b to
953dc11
Compare
|
kindly resolve the conflict so i can merge |
|
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-leaseOnce resolved, the |
1 similar comment
|
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-leaseOnce resolved, the |
I resolved all merge conflicts with the main branch and implemented the requested changes. Thanks @Aamod007 for the feedback. @JhaSourav07, the PR is ready for review and merge. |
b55ad1a to
f1a3ec7
Compare
Description
This PR implements dynamic theme and color customization for the
/api/ogendpoint, ensuring that social media previews beautifully reflect the user's customized CommitPulse dashboard.Fixes #493
Key Features Implemented:
ogParamsSchemato parsetheme,bg,text, andaccentquery parameters safely.generateMetadata) to the OpenGraph endpoint.app/api/og/route.tsxto resolve dynamic colors against thethemesdictionary.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 (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.