Skip to content

Conversation

@mamertofabian
Copy link
Contributor

@mamertofabian mamertofabian commented Feb 11, 2025

Description

This PR adds functionality to copy the system prompt to clipboard via a new UI button. It also refactors the system prompt generation logic into a separate function to avoid code duplication between preview and copy features.

image

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (minor enhancement)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

The copy system prompt functionality has been tested through the following steps:

  1. Manual Testing of Basic Functionality:

    • Clicked the new copy button in the UI
    • Verified the success notification "System prompt successfully copied to clipboard" appears
    • Pasted the content into different text editors (VS Code, Notepad) to verify the clipboard content
    • Verified the copied content matches the system prompt preview
  2. Validation of Clipboard State:

    • Tested clipboard isolation by:
      • First copying a random text ("test123")
      • Then using the system prompt copy feature
      • Pasting to verify the system prompt replaced the previous clipboard content
      • Copying another random text to ensure clipboard continues to work normally afterward
  3. UI Testing:

    • Verified the copy button icon displays correctly
    • Confirmed the button tooltip "Copy system prompt to clipboard" appears on hover
    • Checked that the button is properly aligned with the existing "Preview System Prompt" button

This testing approach ensures both the functional correctness and user experience aspects of the new copy system prompt feature.

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

Related Issues

Reviewers

@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2025

⚠️ No Changeset found

Latest commit: 18fe01b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

data-testid="preview-prompt-button">
Preview System Prompt
</VSCodeButton>
<VSCodeButton
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding an accessibility attribute (e.g. an aria-label) to the copy system prompt button to improve accessibility, since the button only displays an icon.

Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@mrubens mrubens merged commit e4a1b35 into RooCodeInc:main Feb 11, 2025
9 checks passed
@mamertofabian
Copy link
Contributor Author

Thanks @mrubens! This merge is just in time for my upcoming YouTube video about Roo Code 😊

@bramburn
Copy link
Contributor

sexy idea . good job.

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