+
{{ $t('chat.contentRepetitionWarning') }}
({{ seg.truncatedChars }} chars)
@@ -1080,18 +1061,6 @@ const formatFileSize = (size: number) => {
// --- 执行过程面板 ---
const executionExpanded = ref(false)
-const expandedSupersededSegments = ref(new Set
())
-
-function isSupersededExpanded(id: string) {
- return expandedSupersededSegments.value.has(id)
-}
-
-function toggleSupersededSegment(id: string) {
- const next = new Set(expandedSupersededSegments.value)
- if (next.has(id)) next.delete(id)
- else next.add(id)
- expandedSupersededSegments.value = next
-}
// --- 分段式渲染(Claude Code 风格) ---
const parsedMetadata = computed(() => {
@@ -1715,10 +1684,6 @@ watch(isGenerating, (generating) => {
color: var(--mc-primary, #2563eb);
}
-.content-segment--superseded {
- opacity: 0.72;
-}
-
.message-wrapper {
display: flex;
gap: 12px;
diff --git a/mateclaw-ui/src/components/chat/__tests__/supersededContentDisplay.test.ts b/mateclaw-ui/src/components/chat/__tests__/supersededContentDisplay.test.ts
new file mode 100644
index 00000000..73ab10da
--- /dev/null
+++ b/mateclaw-ui/src/components/chat/__tests__/supersededContentDisplay.test.ts
@@ -0,0 +1,15 @@
+// @vitest-environment happy-dom
+import { describe, expect, it } from 'vitest'
+import messageBubbleSource from '../MessageBubble.vue?raw'
+
+describe('MessageBubble superseded content display', () => {
+ it('直接显示工具前预写内容,不渲染折叠提示或隐藏正文', () => {
+ const source = messageBubbleSource
+
+ expect(source).not.toContain('supersededPreviewCollapsed')
+ expect(source).not.toContain('supersededPreviewExpanded')
+ expect(source).not.toContain('toggleSupersededSegment')
+ expect(source).not.toContain("v-if=\"!seg.superseded || isSupersededExpanded(seg.id)\"")
+ expect(source).not.toContain('content-segment--superseded')
+ })
+})