fix(chat): support code block copy feedback (#349)

This commit is contained in:
Lanke
2026-04-30 18:36:00 +08:00
committed by GitHub
parent e82674039c
commit 05f15da90b
5 changed files with 66 additions and 20 deletions
@@ -199,8 +199,16 @@ onBeforeUnmount(() => {
renderGeneration += 1
})
function handleMarkdownClick(event: MouseEvent): void {
void handleCodeBlockCopyClick(event)
async function handleMarkdownClick(event: MouseEvent): Promise<void> {
const copyResult = await handleCodeBlockCopyClick(event)
if (copyResult !== null) {
if (copyResult) {
message.success(t('common.copied'))
} else {
message.error(t('chat.copyFailed'))
}
return
}
// Handle file path link clicks for download
const target = event.target as HTMLElement