Skip to content

feat: implement public profile copy link button#269

Merged
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
YashKrTripathi:YASHCOMMITS
May 19, 2026
Merged

feat: implement public profile copy link button#269
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
YashKrTripathi:YASHCOMMITS

Conversation

@YashKrTripathi
Copy link
Copy Markdown

Summary

This PR resolves the issue regarding the missing share mechanism on the public profile page. It introduces a Copy link button in the page header of the /u/[username] public profile page, allowing users to easily share their profile URL.

Additionally, this PR includes critical bug fixes to the metrics API endpoints and database schema to resolve 502 Bad Gateway and 500 Internal Server Error issues affecting the dashboard and public profile visibility.

Changes Made

  • Added CopyLinkButton.tsx as a client component featuring navigator.clipboard.writeText(window.location.href).
  • Integrated <CopyLinkButton /> into src/app/u/[username]/page.tsx next to the username header.
  • Implemented visual feedback (✓ Copied!) for 2 seconds upon successful copy.
  • Fixed 502 Bad Gateway GitHub rate limits by replacing cache: "no-store" with next: { revalidate: 3600 } across all metrics API routes.
  • Updated supabase/schema.sql to include the missing is_public boolean default false column for the users table.

Acceptance Criteria

  • Button positioned in the page header area next to the username
  • Uses navigator.clipboard.writeText(window.location.href)
  • Visual feedback: button text changes to ✓ Copied! for 2 seconds
  • aria-label="Copy profile link"
  • Since public profile page is a server component, the button must be extracted to a 'use client' component
  • Works on all modern browsers

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

@YashKrTripathi is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first PR on DevTrack! 🎉

A maintainer will review it within 48 hours. While you wait:

  • Make sure CI is passing (type-check + lint)
  • Double-check the PR description is filled out and the issue is linked
  • Feel free to ask questions in Discussions if you need help

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Two concerns:

1. Conflictingcontributions/route.ts was modified by a recently merged PR. Please rebase:

git fetch upstream && git rebase upstream/main

2. Caching strategy change needs separation — changing cache: "no-store"next: { revalidate: 3600 } across 10+ route files in the same PR as the CopyLinkButton feature makes this hard to review. The caching change means users see stale GitHub data for up to 1 hour. The original no-store was intentional for freshness.

Please split this into two PRs:

  • PR A: Just the CopyLinkButton feature (public profile page) — looks great, ready to merge
  • PR B: Just the caching changes — needs discussion about the tradeoff

The CopyLinkButton.tsx component itself is solid.

@YashKrTripathi
Copy link
Copy Markdown
Author

Okay will do it asap 👍 @Priyanshu-byte-coder

@YashKrTripathi YashKrTripathi changed the title feat: implement copy link button and fix metrics api caching feat: implement public profile copy link button May 19, 2026
@YashKrTripathi
Copy link
Copy Markdown
Author

Two concerns:

1. Conflictingcontributions/route.ts was modified by a recently merged PR. Please rebase:

git fetch upstream && git rebase upstream/main

2. Caching strategy change needs separation — changing cache: "no-store"next: { revalidate: 3600 } across 10+ route files in the same PR as the CopyLinkButton feature makes this hard to review. The caching change means users see stale GitHub data for up to 1 hour. The original no-store was intentional for freshness.

Please split this into two PRs:

  • PR A: Just the CopyLinkButton feature (public profile page) — looks great, ready to merge
  • PR B: Just the caching changes — needs discussion about the tradeoff

The CopyLinkButton.tsx component itself is solid.

Hi! As requested, I have split this pull request into two separate PRs:

  1. This PR (feat: implement public profile copy link button #269): feat: implement public profile copy link button — Focuses exclusively on the public profile page copy link button feature. This is fully completed and ready for merge.
  2. New PR (perf: cache metrics api requests with 1 hour revalidation #362): perf: cache metrics api requests with 1 hour revalidation — Contains the caching strategy changes.

Please review and merge this PR (#269) and label it with the gssoc:approved tag. Thank you!

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct placement (public profile page, not dashboard header) and window.location.href correctly copies the profile URL. CSS vars throughout.

Minor: once --success is defined in globals.css (via an upcoming PR), change text-green-500 on 'Copied!' to text-[var(--success)] for theme consistency. Not blocking.

@Priyanshu-byte-coder Priyanshu-byte-coder merged commit 35dc719 into Priyanshu-byte-coder:main May 19, 2026
1 check passed
@Priyanshu-byte-coder Priyanshu-byte-coder added level:beginner GSSoC: Beginner difficulty (20 pts) quality:clean GSSoC: Clean quality multiplier (×1.2) gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution labels May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:beginner GSSoC: Beginner difficulty (20 pts) quality:clean GSSoC: Clean quality multiplier (×1.2)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants