Skip to content

Conversation

@XiaoYingYo
Copy link

@XiaoYingYo XiaoYingYo commented Oct 25, 2025

Copy task prompts support carrying all images from the task to the clipboard and allow complete pasting in new conversations.

Description

This PR implements the functionality to copy task prompts (including images) to the clipboard and allows for complete pasting in new conversations.

Main implementation details:

  • Updated the useClipboard hook to support writing HTML content (including <img> tags) to the clipboard.
  • Modified the CopyButton component to enable it to extract and copy complete prompt content including images from task history.
  • Adjusted ChatTextArea and TaskActions to ensure that pasted content can be properly processed and rendered.
  • Extended type definitions in history.ts and taskMetadata.ts to better support tasks containing multimedia content.

Test Procedure

Perform manual testing through the following steps:

  1. Navigate to a task prompt that contains images and text.
  2. Click the "Copy" button.
  3. Start a new conversation.
  4. Paste the clipboard content into the chat input box.
  5. Verify that both text and images have been correctly pasted and displayed.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see above 'Related GitHub Issue').
  • Scope: My changes focus on the linked issue (each PR contains only one main feature/fix).
  • Self-Review: I have thoroughly self-reviewed my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered whether my changes require documentation updates (see below 'Documentation Updates' section).
  • Contribution Guidelines: I have read and agree to the Contribution Guidelines.

Screenshots / Videos

bandicam.2025-10-26.04-58-17-168.mp4

Documentation Updates

  • No need to update the document.
  • Yes, the document needs to be updated. (Please describe the content that needs to be updated or link to the PR in the document repository).

Get in Touch

xiaoyingyo_

…the clipboard and allow complete pasting in new conversations.
@XiaoYingYo XiaoYingYo requested review from cte, jr and mrubens as code owners October 25, 2025 20:59
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Oct 25, 2025
@roomote
Copy link

roomote bot commented Oct 25, 2025

PR Review Summary

I've reviewed the changes in this PR and found 1 remaining issue that needs to be addressed:

Issues Found

  • Critical: Broken HTML escaping in useClipboard.ts (line 24) - Fixed! The HTML escaping logic now correctly uses &amp;, &lt;, &gt;, and &quot; to prevent XSS vulnerabilities.

  • Hard-coded warning message in ChatTextArea.tsx (lines 656-658) - The warning message for image paste limits is hard-coded in English and won't be properly localized for non-English users. Should use i18n translation instead (e.g., t('chat:paste.imageLimit', { availableSlots, ignoredCount })).

Recommendation

The critical HTML escaping issue has been successfully resolved. The test update in the latest commit correctly matches the new copy function signature. The remaining i18n issue should be addressed for proper internationalization support.


View Job

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 25, 2025
Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Review complete. Found 2 issues that need to be addressed before this PR can be approved. Please see the inline comments for details.

@daniel-lxs
Copy link
Member

Thanks for the contribution! This feature isn’t planned for inclusion right now, so we’ll be closing this PR for the time being. We really appreciate you taking the time to implement and document it - please don’t hesitate to open a discussion first if you’d like to revisit this idea in the future.

@daniel-lxs daniel-lxs closed this Oct 29, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Oct 29, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants