Skip to content

feat: add visual feedback when profile link is copied - #98

Open
aditya2206-afk wants to merge 5 commits into
vishnukothakapu:mainfrom
aditya2206-afk:feature/copy-link-feedback
Open

feat: add visual feedback when profile link is copied#98
aditya2206-afk wants to merge 5 commits into
vishnukothakapu:mainfrom
aditya2206-afk:feature/copy-link-feedback

Conversation

@aditya2206-afk

@aditya2206-afk aditya2206-afk commented May 15, 2026

Copy link
Copy Markdown

Fixes #94

Description

Added visual feedback when the profile link is copied.

Changes Made

  • Added toast notification on copy
  • Auto-dismiss after 2 seconds
  • Maintained UI consistency

GSSoC

Participant

Summary by CodeRabbit

  • Bug Fixes
    • Added robust error handling for clipboard copy operations with clear failure messaging.
  • Improvements
    • Copy actions now copy full https profile/link URLs and show updated success confirmations.
    • External links opened in a new tab now include safer link attributes.
  • UI
    • Refined QR and copy control layout while preserving copied-state feedback.
  • Accessibility
    • Copy controls now include descriptive aria labels and titles.

@vercel

vercel Bot commented May 15, 2026

Copy link
Copy Markdown

@aditya2206-afk is attempting to deploy a commit to the vishnukothakapu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

LinkIdCard now copies full profile URLs asynchronously, shows success or failure toasts, adds copy-button accessibility attributes, and secures its external link. LinkItem renders its external link through an asChild button-and-anchor structure while preserving existing controls.

Changes

Dashboard link clipboard and UI updates

Layer / File(s) Summary
Async profile clipboard handling
app/dashboard/LinkIdCard.tsx
copyProfile awaits clipboard writes for the full profile URL and shows success or error toast messages.
LinkIdCard control and link updates
app/dashboard/LinkIdCard.tsx
QR markup is adjusted, the copy button gains aria-label and title, and the external link adds rel="noopener noreferrer".
LinkItem external-link rendering
app/dashboard/LinkItem.tsx
The external link now uses Button asChild around an anchor with existing URL, target, rel, and accessibility attributes; other handlers remain connected.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested labels: enhancement

Suggested reviewers: vedhapprakashni, anshggss, dev1822

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title concisely describes the main user-facing change: copy feedback for profile links.
Linked Issues check ✅ Passed The PR adds toast-based copy feedback, uses the correct profile URL, and handles clipboard failures for #94.
Out of Scope Changes check ✅ Passed The LinkItem JSX refactor is consistent with the copy-link accessibility cleanup and does not appear unrelated.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Biome (2.5.3)
app/dashboard/LinkItem.tsx

File contains syntax errors that prevent linting: Line 122: Illegal return statement outside of a function; Line 323: Expected a statement but instead found '}

)'.; Line 326: Expected a statement but instead found '}'.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/dashboard/LinkItem.tsx

Parsing error: Declaration or statement expected.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/dashboard/LinkIdCard.tsx`:
- Line 18: The clipboard copy currently writes a scheme-less URL; update the
navigator.clipboard.writeText call in LinkIdCard.tsx (the place where you build
the profile link) to copy a fully-qualified URL by prepending the scheme (e.g.,
"https://") so it writes "https://linkid.qzz.io/${username}" instead of
"linkid.qzz.io/${username}".

In `@app/dashboard/LinkItem.tsx`:
- Around line 41-43: The copy action currently writes a scheme-less path via
navigator.clipboard.writeText(`linkid.qzz.io/${username}/${link.platform}`); —
change it to write a full URL by prepending the scheme (e.g. use
`https://linkid.qzz.io/${username}/${link.platform}`) so pasted output is
clickable; update the code in LinkItem.tsx where navigator.clipboard.writeText
is called and ensure the template uses the existing username and link.platform
variables unchanged.
- Around line 113-126: The JSX in the LinkItem component nests a <Button> inside
an <a>, which is invalid; change to render the <Button> with asChild and place
the <a> as the child so the anchor becomes the actual interactive element.
Specifically, in the block using link.url / link.label / link.platform and the
ExternalLink icon, replace the outer <a> wrapping the <Button> with <Button
asChild> and move href, target, rel, aria-label (and any link-specific props)
onto the inner <a> so the anchor receives those attributes while the Button
styles/behavior are preserved; keep title and the ExternalLink element as
before. Ensure you update the JSX in the LinkItem component (the fragment using
Button, ExternalLink, and link.url/link.label/link.platform) accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 301077c8-8442-4f69-a09b-a0fd4c4cf8cd

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce750f and b96e334.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • app/dashboard/LinkIdCard.tsx
  • app/dashboard/LinkItem.tsx

Comment thread app/dashboard/LinkIdCard.tsx Outdated
Comment thread app/dashboard/LinkItem.tsx Outdated
Comment thread app/dashboard/LinkItem.tsx Outdated
@aditya2206-afk

Copy link
Copy Markdown
Author

Thanks for the review ✅

Updated the copy actions to use fully-qualified URLs (https://) and refactored nested interactive elements using the asChild pattern for improved accessibility.

Please let me know if any further changes are needed.

@aparna24bce11388

Copy link
Copy Markdown

All issues fixed. Ready for review. Please approve workflow and merge.

@aditya2206-afk

Copy link
Copy Markdown
Author

Thanks for pointing that out ✅

Removed duplicate URL argument and corrected the nested button structure. Everything should now follow proper accessibility and clipboard usage.

Please let me know if anything else needs refinement.

@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
linkid Error Error Jul 24, 2026 4:40am

@aditya2206-afk

Copy link
Copy Markdown
Author

@vishnukothakapu (or @aparna24bce11388 if they are the primary maintainer)

Hi, it looks like the Copilot PR Review / request-review check is failing due to a permission error (Resource not accessible by integration (HTTP 403)). This seems to be a repository-level configuration issue rather than a problem with the code in this PR.

Could you please take a look at this? If it's a non-blocking check, or if you can adjust the workflow permissions, the PR should be ready for merge.

Thanks for your time and guidance!

@aditya2206-afk

Copy link
Copy Markdown
Author

✅ All checks (except Copilot permission issue) have passed.
✅ Vercel deployment is successful.

Kindly review and merge the PR when possible. Thank you!

@vishnukothakapu

Copy link
Copy Markdown
Owner

Hi @aditya2206-afk, the Copilot review error is from our workflow side, not from your PR. Your PR looks good and the required checks have passed successfully.

Please wait for the mentor review. Once the mentor review is completed, the PR will be merged.

@vishnukothakapu

Copy link
Copy Markdown
Owner

Hi @aditya2206-afk, could you please resolve the merge conflicts as well?

@aditya2206-afk

Copy link
Copy Markdown
Author

✅ Merge conflicts resolved successfully.

Kindly review and merge the PR when possible. Thank you!

@aditya2206-afk

Copy link
Copy Markdown
Author

✅ All checks are passing and conflicts resolved.

Kindly merge when possible. Thank you!

@vishnukothakapu

Copy link
Copy Markdown
Owner

✅ All checks are passing and conflicts resolved.

Kindly merge when possible. Thank you!

Hi @aditya2206-afk, Please wait for the mentor review. Once the mentor review is completed, the PR will be merged.

@vedhapprakashni

Copy link
Copy Markdown
Collaborator

hey @aditya2206-afk. pls review ur pr again:

1.the last commit deleted the package-lock.json file
2. dev.db must not be commited and must be added in the gitignore

@vedhapprakashni

Copy link
Copy Markdown
Collaborator

@aditya2206-afk any updates?

@vedhapprakashni

Copy link
Copy Markdown
Collaborator

hi @aditya2206-afk. pls update your progress and resolve conflicts

@vishnukothakapu

Copy link
Copy Markdown
Owner

Hi @aditya2206-afk ,
There is currently a merge conflict in app/dashboard/LinkItem.tsx that needs to be resolved before the PR can be merged.
Please resolve the conflicts, push the updated changes.

@vedhapprakashni

Copy link
Copy Markdown
Collaborator

hey @aditya2206-afk. Pls resolve conflicts

@Karanjot786

Copy link
Copy Markdown

Hey @aditya2206-afk! Saw your work on GSSoC 2026.

We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal.

We have 99 unassigned GSSoC issues open, including new widgets, hooks, and CLI tooling. Your TypeScript background transfers directly.

Karanjot, TermUI maintainer

@vedhapprakashni

Copy link
Copy Markdown
Collaborator

hey @aditya2206-afk. pls resolve conflicts

@aditya2206-afk

Copy link
Copy Markdown
Author

Conflicts resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
app/dashboard/LinkItem.tsx (2)

88-90: 🎯 Functional Correctness | 🟠 Major

The copied URL is still scheme-less.

This repeats the previously reported issue: linkid.qzz.io/... is not a fully qualified, reliably clickable profile URL. Prefix it with https://.

Proposed fix
-            `linkid.qzz.io/${username}/${link.alias || link.platform}`
+            `https://linkid.qzz.io/${username}/${link.alias || link.platform}`
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/dashboard/LinkItem.tsx` around lines 88 - 90, Update the URL passed to
navigator.clipboard.writeText in LinkItem so it starts with https:// while
preserving the existing username and alias/platform path construction.

88-93: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Handle clipboard failures before showing success.

navigator.clipboard.writeText() returns a promise, but the handler neither awaits nor catches it. Failed copies still show “Copied” and can produce unhandled promise errors.

Proposed fix
-        navigator.clipboard.writeText(
-            `linkid.qzz.io/${username}/${link.alias || link.platform}`
-        );
-        setCopied(true);
-        toast.success("Copied");
-        setTimeout(() => setCopied(false), 1200);
+        try {
+            await navigator.clipboard.writeText(
+                `https://linkid.qzz.io/${username}/${link.alias || link.platform}`
+            );
+            setCopied(true);
+            toast.success("Copied");
+            setTimeout(() => setCopied(false), 1200);
+        } catch {
+            toast.error("Failed to copy");
+        }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/dashboard/LinkItem.tsx` around lines 88 - 93, Update the clipboard
handler in LinkItem to await navigator.clipboard.writeText before calling
setCopied, toast.success, or scheduling the reset; catch failures and avoid
showing the success state or toast when the copy operation rejects.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/dashboard/LinkItem.tsx`:
- Around line 95-97: Remove the extra closing brace immediately before the save
function in LinkItem, keeping save and the later JSX return inside the LinkItem
component function so the file compiles.

---

Outside diff comments:
In `@app/dashboard/LinkItem.tsx`:
- Around line 88-90: Update the URL passed to navigator.clipboard.writeText in
LinkItem so it starts with https:// while preserving the existing username and
alias/platform path construction.
- Around line 88-93: Update the clipboard handler in LinkItem to await
navigator.clipboard.writeText before calling setCopied, toast.success, or
scheduling the reset; catch failures and avoid showing the success state or
toast when the copy operation rejects.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b6d0dae1-0880-4ba0-9410-8d6fc694df9e

📥 Commits

Reviewing files that changed from the base of the PR and between b327111 and cf48e78.

⛔ Files ignored due to path filters (1)
  • dev.db is excluded by !**/*.db
📒 Files selected for processing (1)
  • app/dashboard/LinkItem.tsx

Comment on lines +95 to 97
}

async function save() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Remove the extra closing brace.

Line 95 closes LinkItem before save() and the component’s later JSX return, leaving the return outside a function and breaking compilation.

Proposed fix
     setTimeout(() => setCopied(false), 1200);
   }
-  }

   async function save() {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
}
async function save() {
async function save() {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/dashboard/LinkItem.tsx` around lines 95 - 97, Remove the extra closing
brace immediately before the save function in LinkItem, keeping save and the
later JSX return inside the LinkItem component function so the file compiles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Add Visual Feedback When Profile Link Is Copied

5 participants