Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

Add individual copy buttons to publisher-finish-payout view

This PR adds convenient individual copy buttons to the publisher-finish-payout view that allow staff members to easily copy each payout field (email, amount, and subject) independently to their clipboard for pasting into PayPal.

Plan:

  • Add individual copy buttons to the publisher-payout-finish.html template
  • Implement JavaScript functionality to copy amount, email, and subject text to clipboard
  • Style the buttons to match existing Bootstrap 4 design patterns
  • Add tests to verify the copy buttons are present in the view
  • Manually test the functionality in a browser to ensure it works correctly
  • Address code review feedback (reduce duplication)
  • Run security checks

Changes Made:

  1. Template Update: Added individual copy icon buttons next to email, amount, and subject fields
  2. JavaScript: Implemented clipboard functionality with:
    • Modern Clipboard API with fallback for older browsers
    • Individual copy buttons for each field
    • Visual feedback (button turns green with checkmark for 1.5 seconds)
    • Proper error handling
  3. IDs: Added IDs to amount, email, and subject fields for JavaScript access
  4. Test: Added assertions to verify copy buttons are present in existing test
  5. Code Quality: Refactored to eliminate duplication using constants and helper function

UI Preview:

Individual copy buttons next to each field:
Individual copy buttons

After clicking (button turns green with checkmark):
Success state

How it works:

  • Click the copy icon next to any field (email, amount, or subject) to copy just that value
  • The button briefly turns green with a checkmark to confirm the copy
  • Each field can be copied independently for pasting into PayPal

Security Summary:

  • ✅ No security vulnerabilities detected by CodeQL
  • ✅ No user input is processed - only copying displayed data
  • ✅ Uses standard browser APIs safely
Original prompt

Add a copy button to the publisher-finish-payout view that allows me to easily copy the amount, email, and text


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@davidfischer
Copy link
Collaborator

We probably just want little paste icons next to email, amount, and description, right?

@ericholscher
Copy link
Member

@davidfischer you shouldn't be reviewing these until they're marked Ready for review, but yea, that is what I wanted, but didn't specify clearly enough :)

@copilot fix it

Copy link
Contributor Author

Copilot AI commented Dec 16, 2025

@davidfischer you shouldn't be reviewing these until they're marked Ready for review, but yea, that is what I wanted, but didn't specify clearly enough :)

@copilot fix it

Done in commit e367b72. Added individual copy icons next to email, amount, and subject fields. Each button copies just that field's value and shows a green checkmark for visual feedback.

UI with individual copy buttons:
Individual copy buttons

After clicking (button turns green with checkmark):
Success state

Copilot AI changed the title [WIP] Add copy button to publisher finish payout view Add individual copy buttons to publisher finish payout view Dec 16, 2025
@ericholscher ericholscher marked this pull request as ready for review December 17, 2025 09:17
@ericholscher ericholscher requested a review from a team as a code owner December 17, 2025 09:17
@ericholscher
Copy link
Member

ericholscher commented Dec 17, 2025

@davidfischer This is looking close now. Not sure if this is the best way to copy text, but seems workable. It works great locally 💯

@ericholscher

This comment was marked as outdated.

This comment was marked as outdated.

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.

3 participants