Skip to content

feat(og): add dynamic social card customization parameters#546

Open
Animesh-86 wants to merge 1 commit into
JhaSourav07:mainfrom
Animesh-86:feat/dynamic-og-customization
Open

feat(og): add dynamic social card customization parameters#546
Animesh-86 wants to merge 1 commit into
JhaSourav07:mainfrom
Animesh-86:feat/dynamic-og-customization

Conversation

@Animesh-86
Copy link
Copy Markdown
Contributor

Description

This PR implements dynamic theme and color customization for the /api/og endpoint, ensuring that social media previews beautifully reflect the user's customized CommitPulse dashboard.

Fixes #493

Key Features Implemented:

  • Updated ogParamsSchema to parse theme, bg, text, and accent query parameters safely.
  • Forwarded customization parameters from the dashboard (generateMetadata) to the OpenGraph endpoint.
  • Refactored app/api/og/route.tsx to resolve dynamic colors against the themes dictionary.
  • Premium Detail: Added dynamic glassmorphic card overlays (a translucent white/black layer based on the background brightness) so that the inner stats cards always pop beautifully regardless of the custom background chosen!

Pillar

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

Visual Preview

image

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 27, 2026 04:43
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 27, 2026

@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.

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 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, and accent.
  • Update /api/og rendering 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.

Comment thread app/api/og/route.tsx
Comment thread lib/validations.ts Outdated
Comment thread app/(root)/dashboard/[username]/page.tsx
Comment thread app/api/og/route.tsx Outdated
Comment thread app/(root)/dashboard/[username]/page.tsx
@Animesh-86 Animesh-86 force-pushed the feat/dynamic-og-customization branch from 67d4885 to 644c720 Compare May 27, 2026 04:51
@github-actions github-actions Bot added the type:feature New features, additions, or enhancements label May 27, 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.

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%.

@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label May 27, 2026
@github-actions
Copy link
Copy Markdown

🚨 Hey @Animesh-86, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

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 passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

@Animesh-86 Animesh-86 force-pushed the feat/dynamic-og-customization branch 2 times, most recently from 1a9429b to 953dc11 Compare May 27, 2026 16:51
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label May 27, 2026
@JhaSourav07
Copy link
Copy Markdown
Owner

@Animesh-86

kindly resolve the conflict so i can merge

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

⚠️ Hey @Animesh-86, 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. 🙌

1 similar comment
@github-actions
Copy link
Copy Markdown

⚠️ Hey @Animesh-86, 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. 🙌

@Animesh-86
Copy link
Copy Markdown
Contributor Author

@Animesh-86

kindly resolve the conflict so i can merge

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.

@Animesh-86 Animesh-86 force-pushed the feat/dynamic-og-customization branch from b55ad1a to f1a3ec7 Compare May 28, 2026 04:03
@github-actions github-actions Bot removed the needs-rebase This PR has merge conflicts and needs a rebase. label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New features, additions, or enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Proposal: Dynamic OpenGraph Social Card Customization

4 participants