重构: 前端命名一致性调整(低风险·2处)
- 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后端契约
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user