Skip to content

feat: add copy-to-clipboard button on result card URL#190

Open
GeethaBurigalla wants to merge 1 commit into
Mrinalray:mainfrom
GeethaBurigalla:feat/copy-url-button
Open

feat: add copy-to-clipboard button on result card URL#190
GeethaBurigalla wants to merge 1 commit into
Mrinalray:mainfrom
GeethaBurigalla:feat/copy-url-button

Conversation

@GeethaBurigalla

Copy link
Copy Markdown

Closes #179

Changes

  • Added a "Copy" button next to the URL shown in the result card
  • Uses navigator.clipboard.writeText() with a document.execCommand('copy') fallback for unsupported browsers
  • Button shows a checkmark + "Copied" label for 2 seconds after a successful copy, then reverts
  • Styled to match the existing cyan accent / result-card design system, with a green "copied" state and light-mode support

Files changed

  • script.js — updated showResult() markup, added copyResultUrl() and fallbackCopy()
  • style.css — updated .result-url to flex layout, added .copy-url-btn styles

Testing

  • Verified copy works on a safe result, danger result, and error result (URL present in all three)
  • Verified button reverts to "Copy" after timeout and on repeat clicks
  • Checked light mode and dark mode rendering

@GeethaBurigalla

Copy link
Copy Markdown
Author

PR is ready for review!!

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.

Title: Add "Copy URL" button to the result card

1 participant