Skip to content

fix: enhance copy functionality in ShareOperationButton for improved text handling - #6572

Merged
wxg0103 merged 1 commit into
v2from
pr@v2@fix_share_content
Aug 4, 2026
Merged

fix: enhance copy functionality in ShareOperationButton for improved text handling#6572
wxg0103 merged 1 commit into
v2from
pr@v2@fix_share_content

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: enhance copy functionality in ShareOperationButton for improved text handling

Copilot AI review requested due to automatic review settings August 4, 2026 03:22
@shaohuzhang1

Copy link
Copy Markdown
Contributor Author

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@wxg0103
wxg0103 merged commit e0e9347 into v2 Aug 4, 2026
5 of 7 checks passed
@wxg0103
wxg0103 deleted the pr@v2@fix_share_content branch August 4, 2026 03:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the ShareOperationButton in the AI chat UI to improve “Copy” behavior by copying from structured answer_text_list when available and removing embedded <form_rander>...</form_rander> blocks before placing text on the clipboard.

Changes:

  • Switch the copy click handler to copy from the full data object (instead of only answer_text).
  • Add copy text assembly from answer_text_list and strip <form_rander> blocks before copying.
  • Remove unused Vue imports in the component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +50
const copy = (data: any) => {
try {
const text = data.answer_text_list
.map((item: Array<any>) => item.map((i) => i.content).join('\n'))
.join('\n\n')
copyClick(removeFormRander(text))
} catch (e: any) {
copyClick(removeFormRander(data?.answer_text.trim()))
}
}
Comment on lines +38 to +40
function removeFormRander(text: string) {
return text.replace(/<form_rander>.*?<\/form_rander>/gs, '').trim()
}
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