Skip to content

feat: add copy result button with clipboard support (closes #35)#50

Merged
O2sa merged 1 commit intoO2sa:mainfrom
Ai-chan-0411:feat/copy-result-button
Apr 11, 2026
Merged

feat: add copy result button with clipboard support (closes #35)#50
O2sa merged 1 commit intoO2sa:mainfrom
Ai-chan-0411:feat/copy-result-button

Conversation

@Ai-chan-0411
Copy link
Copy Markdown
Contributor

Summary

Implements #35 — adds a Copy Result button to the comparison dashboard.

Changes

  • Converts ResultDashboard to a client component ("use client")
  • Adds a Copy Result button (top-right, secondary variant) that copies a structured JSON summary to clipboard
  • JSON includes: both developers' scores (finalScore, repoScore, prScore, contributionScore), winner, lead percentage, and insights
  • Shows ✓ Copied! (green, with check icon) for 2 seconds after a successful copy, then reverts to the default state
  • Accessible: button has an aria-label for screen readers

Before / After

Before After
No way to export results One-click copy of structured JSON summary

Test plan

  • Compare two GitHub users → result dashboard renders
  • Click Copy Result → button shows "Copied!" briefly
  • Paste clipboard → valid JSON with both users' scores, winner, and insights

Add a 'Copy Result' button to the ResultDashboard component that:
- Copies a structured JSON summary of the comparison to clipboard
- Includes scores for both developers, winner, lead percentage, and insights
- Shows visual 'Copied!' feedback with a check icon for 2 seconds after copy
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 11, 2026

@aoi-dev-0411 is attempting to deploy a commit to the osama's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

Thank you for the pull request! ✅

A maintainer will review this soon. Please be patient while we take a look. 🙌

@Ai-chan-0411
Copy link
Copy Markdown
Contributor Author

Hi @O2sa! The Vercel deployment is ready for approval. Please authorize the deployment to complete the PR checks. Thank you!

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 11, 2026

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

Project Deployment Actions Updated (UTC)
dev-impact Ready Ready Preview, Comment Apr 11, 2026 7:51pm

@O2sa O2sa merged commit 3bf55eb into O2sa:main Apr 11, 2026
3 checks passed
@O2sa
Copy link
Copy Markdown
Owner

O2sa commented Apr 11, 2026

Thanks for the contribution.

You can reopen the closed PRs if think they are valid and I will review them.

@Ai-chan-0411
Copy link
Copy Markdown
Contributor Author

Thank you for the merge and the offer to review!

I have a few previously closed PRs from our initial batch (#39-#49) that were high quality. I would like to reopen a few of them for your review:

These are solid, tested improvements that could add value to DevImpact. Would you have time to review them when reopened?

Thanks again for the quick turnaround on this PR! 🙏

@O2sa
Copy link
Copy Markdown
Owner

O2sa commented Apr 11, 2026

Yes, you can reopen them.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants