Skip to content

fix: auto-prepend https to social URLs lacking a protocol to prevent … - #7800

Open
desireddymohithreddy0925 wants to merge 11 commits into
JhaSourav07:mainfrom
desireddymohithreddy0925:fix/social-url-validation
Open

fix: auto-prepend https to social URLs lacking a protocol to prevent …#7800
desireddymohithreddy0925 wants to merge 11 commits into
JhaSourav07:mainfrom
desireddymohithreddy0925:fix/social-url-validation

Conversation

@desireddymohithreddy0925

Copy link
Copy Markdown
Contributor

Description

Fixes #7630

Previously, if a user entered a social link without a protocol (e.g., twitter.com/user instead of https://twitter.com/user), the generated markdown would treat it as a relative link, breaking navigation when clicked in a GitHub README.

This PR updates readmeGenerator.ts to automatically detect when a social URL is missing the http:// or https:// prefix (for non-email links). It now seamlessly prepends https:// to the URL during markdown generation, ensuring robust and fully qualified links without interrupting the user experience with validation errors.

Pillar

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

Visual Preview

(Social URLs missing https:// now properly navigate to the correct external site when clicked in the generated markdown.)

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.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added status:blocked This PR is blocked due to a failing CI check. and removed status:blocked This PR is blocked due to a failing CI check. labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

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 4052.57 KB 4052.50 KB +0.08 KB (+0.00%)
Total CSS 338.94 KB 338.94 KB 0 B

@Aamod007 Aamod007 added mentor:Aamod007 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:bug Something isn't working as expected labels Jul 10, 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.

Great fix! Automatically prepending \https://\ to social URLs prevents broken links when users forget the protocol. It improves user experience significantly. Note that I am leaving a neutral review because there is currently a repository-level Vercel deployment block preventing full pipeline success, but your logic looks perfect!

Labels assigned:

  • \level:beginner: String manipulation and URL validation.
  • \quality:clean: Clean helper logic.
  • \ ype:bug: Fixes broken URL routing.

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

Nice UX fix for social URLs! Automatically prepending \https://\ when users forget it will prevent a lot of broken links in the generated markdown. Approved!

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

Auto-prepending https:// to social URLs in validations.ts improves the user experience. However, the CI checks are failing. Please resolve the issues and rerun the CI pipeline.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Hey @desireddymohithreddy0925, this pull request has been inactive for 3 days. It will be automatically closed in 2 days if no further activity occurs.

If you are still working on this, please push your latest changes or leave a comment to keep it active.

@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 pushing the new commits! Since we are currently ignoring the Vercel CI failures repository-wide, and you've updated the PR, everything looks good to go from my end. Approved! 🚀

@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 fixing the issue with relative social URLs! Prepending \https://\ automatically is a great UX improvement.

However, there are a couple of things that need to be addressed before we can merge this:

  1. It looks like you've accidentally included changes to \�pp/api/streak/route.timezone-boundaries.test.ts\ (modifying the \s-maxage\ values). Please revert those changes so this PR only contains the fix in
    eadmeGenerator.ts.
  2. Your branch currently has merge conflicts with the \main\ branch (indicated by the
    eeds-rebase\ label). Please rebase your branch on the latest \main\ to resolve these conflicts.

Once the branch is cleaned up and conflicts are resolved, we can get this merged!

Label Justification:

  • \level:beginner: Adding a simple regex check and string prepend is a standard beginner task.
  • \quality:clean: The code for the fix is clean and concise.
  • \ ype:bug: Fixes broken relative links in generated markdown.
  • \mentor:Aamod007: Assigned as required.

@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 fixing the accidental file changes and resolving the merge conflicts! The PR looks clean now and the logic to auto-prepend \https://\ is perfect.

Approving this PR! (Note: The \gssoc:needs-rebase\ label has been removed since conflicts are resolved.)

Label Justification:

  • \level:beginner: Assigned based on 1 file changed with a simple string prepend.
  • \quality:clean: Cleanly isolated fix in
    eadmeGenerator.ts.
  • \ ype:bug: Fixes broken relative links in markdown.
  • \mentor:Aamod007: Assigned as required.

…lidation

fix: auto-prepend https to social URLs lacking a protocol to prevent …
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jul 23, 2026
@desireddymohithreddy0925
desireddymohithreddy0925 force-pushed the fix/social-url-validation branch 2 times, most recently from 11e66db to 75c4e8b Compare July 24, 2026 01:33
@desireddymohithreddy0925
desireddymohithreddy0925 force-pushed the fix/social-url-validation branch 2 times, most recently from 8a1566b to 3aef15c Compare July 24, 2026 03:04
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Invalid URL Validation in Social Links

3 participants