Skip to content

feat: add copy dashboard URL button to header#66

Open
MansimranKaurBedi0 wants to merge 3 commits into
Umbrella-io:mainfrom
MansimranKaurBedi0:fix/copy-dashboard-url
Open

feat: add copy dashboard URL button to header#66
MansimranKaurBedi0 wants to merge 3 commits into
Umbrella-io:mainfrom
MansimranKaurBedi0:fix/copy-dashboard-url

Conversation

@MansimranKaurBedi0

Copy link
Copy Markdown

Summary

This PR adds a copy dashboard URL button to the dashboard header, making it easier for users to quickly share their dashboard link. On clicking the button, the current dashboard URL gets copied and the user sees a short "Copied!" confirmation.

Closes #52

Type of Change

  • Bug fix
  • [✅] New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

  • Added a copy button in DashboardHeader.tsx
  • Copied the current page URL using the Clipboard API
  • Added a temporary "Copied!" feedback for better user experience
  • Added accessibility support with aria-label
  • Verified it works properly in both light and dark mode

How to Test

  1. Run the project locally using npm run dev
  2. Open the dashboard page
  3. Click the copy button in the header
  4. Confirm that "Copied!" appears for a few seconds
  5. Paste anywhere to verify the dashboard URL was copied

Screenshots (if UI change)

Screenshot 2026-05-15 at 12 26 47 PM Screenshot 2026-05-15 at 12 27 41 PM Screenshot 2026-05-15 at 12 28 17 PM

Tested locally.

Checklist

  • [✅] Linked issue in summary
  • [✅] Self-reviewed the changes
  • [✅] Tested locally

@vercel

vercel Bot commented May 15, 2026

Copy link
Copy Markdown

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

@MansimranKaurBedi0

Copy link
Copy Markdown
Author

Hi @Priyanshu-byte-coder, it looks like the workflow is failing due to a GitHub Actions permission issue (Resource not accessible by integration) for first-time contributors. Kindly review whenever you get time. Thank you! ✨

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Clean implementation of the core feature — Clipboard API usage is correct, aria-label is good, CSS variables handle theming, and the copied state feedback is nice. Two things to fix.

Blockers

1. alert("Copy failed") — bad UX

An alert() dialog is jarring and inconsistent with the rest of the UI. Use an inline error state the same way you handle the success case:

const [copyError, setCopyError] = useState(false);

const handleCopy = async () => {
  try {
    await navigator.clipboard.writeText(window.location.href);
    setCopied(true);
    setTimeout(() => setCopied(false), 2000);
  } catch {
    setCopyError(true);
    setTimeout(() => setCopyError(false), 2000);
  }
};

Then in JSX:

{copied ? "✓ Copied!" : copyError ? "Failed" : "📋"}

2. Missing newline at end of file

DashboardHeader.tsx is missing a trailing newline.


Minor

Extra blank lines between JSX elements inside the <div> (between <h1> and <p>, and between buttons) — not idiomatic, please remove.


Fix those two and this is good to merge.

@Priyanshu-byte-coder Priyanshu-byte-coder added type:feature GSSoC type bonus: new feature level:beginner GSSoC: Beginner difficulty (20 pts) gssoc26 GSSoC 2026 contribution labels May 15, 2026
@MansimranKaurBedi0

Copy link
Copy Markdown
Author

Implemented all requested changes:

✅ Removed alert-based error handling and added inline error state
✅ Fixed file formatting issues (blank lines + trailing newline)
✅ Resolved merge conflicts with latest main branch

Kindly review again. Thanks!
@Priyanshu-byte-coder

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two issues to fix before this can merge:

1. Regression — removes the Share Profile link
PR #102 (already merged) added a 'Share Profile' link to DashboardHeader.tsx. Your branch is based on an older commit so that change is missing. Please rebase on main and keep the Share Profile link alongside your copy button.

2. Indentation
The rest of the file uses 2-space indent; your additions use 4-space. Please match the existing style.

Once those are fixed this will be ready to go.

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

Hi @MansimranKaurBedi0 — this PR has a merge conflict with main. Please rebase your branch:

git fetch upstream
git rebase upstream/main
# resolve conflicts, then:
git push --force-with-lease

Once rebased, we'll review and merge.

@MansimranKaurBedi0

Copy link
Copy Markdown
Author

@Priyanshu-byte-coder done ,plz review

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

Good fixes — CSS vars look correct. One remaining issue:

Indentation changed from 2-space to 4-space throughout the file

The PR reformatted the entire DashboardHeader.tsx to 4-space indentation, which is inconsistent with the rest of the project (2-space). This makes the diff very noisy and could cause future merge conflicts.

Please reformat back to 2-space indentation. You can run npm run lint --fix (ESLint + Prettier should handle this automatically if configured) or manually convert back. Only add new lines at 2-space depth.

@MansimranKaurBedi0

Copy link
Copy Markdown
Author

Good fixes — CSS vars look correct. One remaining issue:

Indentation changed from 2-space to 4-space throughout the file

The PR reformatted the entire DashboardHeader.tsx to 4-space indentation, which is inconsistent with the rest of the project (2-space). This makes the diff very noisy and could cause future merge conflicts.

Please reformat back to 2-space indentation. You can run npm run lint --fix (ESLint + Prettier should handle this automatically if configured) or manually convert back. Only add new lines at 2-space depth.

done @Priyanshu-byte-coder review plz

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. Missing EOF newline on DashboardHeader.tsx. 2. No button background/text color — the copy button has no bg- or text- class, inherits browser defaults, looks inconsistent with adjacent buttons. Add bg-[var(--control)] text-[var(--card-foreground)]. 3. Emoji-only label — the clipboard emoji with no text fallback is inconsistent across platforms. Replace with a text label or SVG icon. 4. Wholesale indentation reformat — the entire component was re-indented from 2-space to 4-space, bloating the diff. Revert to 2-space to match the codebase. 5. Copies current URL, not dashboard URL — window.location.href copies wherever the user is. Use window.location.origin + /dashboard for a predictable link.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing EOF newline — DashboardHeader.tsx ends without a trailing newline. Please add one.

@Priyanshu-byte-coder Priyanshu-byte-coder added the gssoc:approved GSSoC: PR approved for scoring label May 24, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with main. Please rebase on the latest main branch and re-request review.

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has conflicts with the current main branch. Please rebase on main to resolve conflicts so it can be reviewed and merged. Run: git fetch upstream main && git rebase upstream/main

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with the current main branch. Please rebase on the latest main to resolve them — your contribution is labeled for GSSoC scoring.

@Priyanshu-byte-coder Priyanshu-byte-coder added the quality:clean GSSoC: Clean quality multiplier (×1.2) label Jun 4, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

Hi! This PR has merge conflicts with the main branch. Could you please rebase or merge main into your branch to resolve them? We'd love to get this merged! 🚀

git fetch upstream
git rebase upstream/main
# resolve any conflicts
git push --force-with-lease

If you're no longer working on this, let us know and we can close it. Thanks!

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with the main branch. Please rebase your branch on latest main and resolve the conflicts so it can be reviewed and merged.

@Priyanshu-byte-coder Priyanshu-byte-coder added the stale Inactive for 21+ days label Jun 16, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has been open for a long time and has merge conflicts with the current main branch. The codebase has changed significantly since this PR was opened.

If you're still interested in contributing this change, please:

  1. Rebase your branch on latest main
  2. Resolve all merge conflicts
  3. Ensure your changes still work with the current codebase

If no update is made within 2 weeks, this PR will be closed as stale.

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) stale Inactive for 21+ days type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GOOD FIRST ISSUE] Add 'Copy Dashboard URL' button to DashboardHeader

2 participants