From b237f716dd201fe8945e1be0a0cc4814e2367b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Fri, 19 Jun 2026 12:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84:=20=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E4=B8=80=E8=87=B4=E6=80=A7=E8=B0=83=E6=95=B4?= =?UTF-8?q?(=E4=BD=8E=E9=A3=8E=E9=99=A9=C2=B72=E5=A4=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ToolCard.vue:392 MAX→MAX_DIFF_LINES(描述性, 对齐项目常量规范) - ConversationSidebar.vue:365 BUCKET_LABELS→bucketLabels(computed用camelCase非UPPER_SNAKE) 命名审查整体一致(A95): 文件/组件/变量/类型/常量/composable/api函数/emit事件名/props全合规 留待(中高风险): store模式统一(useXxxStore vs createXxxStore跨文件) / defineEmits写法统一(14组件) / KnowledgeConfig snake_case后端契约 --- src/components/ToolCard.vue | 6 +++--- src/components/ai/ConversationSidebar.vue | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/ToolCard.vue b/src/components/ToolCard.vue index 0b43794..edb2cb0 100644 --- a/src/components/ToolCard.vue +++ b/src/components/ToolCard.vue @@ -389,15 +389,15 @@ const diffLines = computed(() => { const resultDiffLines = computed(() => { const d = parsed.value?.diff if (!d) return [] - const MAX = 120 + const MAX_DIFF_LINES = 120 const lines = d.split('\n').map(line => { if (line === '') return null if (line.startsWith('+')) return { kind: 'add', text: line } if (line.startsWith('-')) return { kind: 'del', text: line } return { kind: 'ctx', text: line } }).filter((x): x is { kind: string; text: string } => x !== null) - if (lines.length > MAX) { - lines.splice(MAX) + if (lines.length > MAX_DIFF_LINES) { + lines.splice(MAX_DIFF_LINES) lines.push({ kind: 'ctx', text: '…' }) } return lines diff --git a/src/components/ai/ConversationSidebar.vue b/src/components/ai/ConversationSidebar.vue index b5b2e1e..15ef76c 100644 --- a/src/components/ai/ConversationSidebar.vue +++ b/src/components/ai/ConversationSidebar.vue @@ -362,7 +362,7 @@ function formatTime(ts: string): string { } // ── 对话分组:今天 / 昨天 / 更早 ── -const BUCKET_LABELS = computed>(() => ({ +const bucketLabels = computed>(() => ({ today: t('aiChat.today'), yesterday: t('aiChat.yesterday'), earlier: t('aiChat.earlier'), @@ -400,7 +400,7 @@ const groupedActive = computed(() => { const groups: { key: string; label: string; items: AiConversationSummary[] }[] = [] for (const key of ['today', 'yesterday', 'earlier']) { const items = map.get(key) || [] - if (key === 'today' || items.length) groups.push({ key, label: BUCKET_LABELS.value[key], items }) + if (key === 'today' || items.length) groups.push({ key, label: bucketLabels.value[key], items }) } return groups })