From 20d4048543e18571872852b9032e7f97818247e3 Mon Sep 17 00:00:00 2001 From: lgh <625458956@qq.com> Date: Sat, 21 Feb 2026 00:19:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AFType?= =?UTF-8?q?Script=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ContextManager.vue | 6 +-- frontend/src/components/LLMSettings.vue | 11 +---- frontend/src/components/SignalDashboard.vue | 49 +++++++++++---------- 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/frontend/src/components/ContextManager.vue b/frontend/src/components/ContextManager.vue index d8cf894..b8c68ed 100644 --- a/frontend/src/components/ContextManager.vue +++ b/frontend/src/components/ContextManager.vue @@ -107,7 +107,7 @@ const extractMetadata = (content: string) => { // 1. Extract Title (First H1 or first non-empty line) const titleMatch = content.match(/^#\s+(.*)/m) - if (titleMatch) { + if (titleMatch && titleMatch[1]) { title = titleMatch[1].trim() } else { const firstLine = lines.find(l => l.trim().length > 0) @@ -136,12 +136,12 @@ const extractMetadata = (content: string) => { // Look for "Core Logic", "Architecture", "Introduction" headers const logicRegex = /##\s*(Core Logic|Architecture|Introduction|About|Features)([\s\S]*?)(##|$)/i const logicMatch = content.match(logicRegex) - if (logicMatch) { + if (logicMatch && logicMatch[2]) { coreLogic = logicMatch[2].trim().substring(0, 300) + (logicMatch[2].length > 300 ? '...' : '') } else { // Fallback: First paragraph after title const paragraphs = content.split(/\n\s*\n/) - if (paragraphs.length > 1) { + if (paragraphs.length > 1 && paragraphs[1]) { coreLogic = paragraphs[1].trim().substring(0, 200) + '...' } } diff --git a/frontend/src/components/LLMSettings.vue b/frontend/src/components/LLMSettings.vue index 44d71ba..990cb79 100644 --- a/frontend/src/components/LLMSettings.vue +++ b/frontend/src/components/LLMSettings.vue @@ -52,7 +52,7 @@ -