fix: 兼容低版本浏览器消息复制

- 为 Chrome 90 增加剪贴板兼容回退

- 统一聊天与智能体试运行的原色对勾反馈
This commit is contained in:
2026-07-22 20:07:34 +08:00
parent 5a3d4788da
commit 9f06c238d3
15 changed files with 423 additions and 83 deletions

View File

@@ -21,6 +21,7 @@ import ChatToolCard from './ChatToolCard.vue';
const props = defineProps<{
approvalLoading?: boolean;
copyable?: boolean;
copyAction?: (item: ChatTimelineMessageItem) => boolean | Promise<boolean>;
regenerable?: boolean;
regenerateDisabled?: boolean;
assistantActionsVisible?: boolean;
@@ -118,6 +119,14 @@ function updateThinkingExpanded(partId: string, expanded: boolean) {
part.expanded = expanded;
}
}
function handleCopyAction() {
const item = messageItem.value;
if (!item || !props.copyAction) {
return false;
}
return props.copyAction(item);
}
</script>
<template>
@@ -161,6 +170,7 @@ function updateThinkingExpanded(partId: string, expanded: boolean) {
:align="messageItem.role === 'user' ? 'end' : 'start'"
:allow-copy="copyable"
:allow-regenerate="regenerable"
:copy-action="copyAction ? handleCopyAction : undefined"
:disabled-variant-next="disabledVariantNext"
:disabled-variant-previous="disabledVariantPrevious"
:regenerate-disabled="regenerateDisabled"