From e6cc466a0ec7c8c3834cd002331116c7508f9675 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Sat, 7 Mar 2026 12:52:19 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20AI=20=EC=96=B4=EC=8B=9C=EC=8A=A4?= =?UTF-8?q?=ED=84=B4=ED=8A=B8=20=EB=A7=88=ED=81=AC=EB=8B=A4=EC=9A=B4=20?= =?UTF-8?q?=EB=A0=8C=EB=8D=94=EB=A7=81=20=EB=B0=8F=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - marked.js 라이브러리 추가, AI 답변 마크다운 렌더링 - AI 답변 prose 스타일 적용 (제목, 목록, 굵은글씨, 인용) - health 응답 파싱 개선 (이중 중첩 구조 fallback 추가) - JS/CSS 버전 캐시 무효화 (v=20260307) Co-Authored-By: Claude Opus 4.6 --- system3-nonconformance/web/ai-assistant.html | 5 +++-- .../web/static/css/ai-assistant.css | 14 ++++++++++++++ .../web/static/js/pages/ai-assistant.js | 12 +++++++++--- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/system3-nonconformance/web/ai-assistant.html b/system3-nonconformance/web/ai-assistant.html index 776b8ed..2ea6c40 100644 --- a/system3-nonconformance/web/ai-assistant.html +++ b/system3-nonconformance/web/ai-assistant.html @@ -8,7 +8,8 @@ - + + @@ -279,6 +280,6 @@ - + diff --git a/system3-nonconformance/web/static/css/ai-assistant.css b/system3-nonconformance/web/static/css/ai-assistant.css index 3640338..69e4b49 100644 --- a/system3-nonconformance/web/static/css/ai-assistant.css +++ b/system3-nonconformance/web/static/css/ai-assistant.css @@ -67,6 +67,20 @@ padding: 10px 16px; } +/* AI 답변 마크다운 스타일 */ +.chat-bubble-ai .prose { color: #1e293b; } +.chat-bubble-ai .prose h1, +.chat-bubble-ai .prose h2, +.chat-bubble-ai .prose h3 { font-size: 0.95em; font-weight: 700; margin: 0.8em 0 0.3em; color: #334155; } +.chat-bubble-ai .prose p { margin: 0.4em 0; } +.chat-bubble-ai .prose ul, +.chat-bubble-ai .prose ol { margin: 0.3em 0; padding-left: 1.4em; } +.chat-bubble-ai .prose li { margin: 0.15em 0; } +.chat-bubble-ai .prose strong { color: #7c3aed; } +.chat-bubble-ai .prose code { background: #e2e8f0; padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.85em; } +.chat-bubble-ai .prose blockquote { border-left: 3px solid #7c3aed; padding-left: 0.8em; margin: 0.5em 0; color: #64748b; } +.chat-bubble-ai .prose hr { border-color: #e2e8f0; margin: 0.6em 0; } + .chat-bubble-ai .source-link { color: #7c3aed; cursor: pointer; diff --git a/system3-nonconformance/web/static/js/pages/ai-assistant.js b/system3-nonconformance/web/static/js/pages/ai-assistant.js index 418340c..d9492b8 100644 --- a/system3-nonconformance/web/static/js/pages/ai-assistant.js +++ b/system3-nonconformance/web/static/js/pages/ai-assistant.js @@ -127,7 +127,8 @@ async function checkAiHealth() { const model = health.model || health.llm_model - || (health.ollama?.models?.[0]); + || health.ollama?.ollama?.models?.[0] + || health.ollama?.models?.[0]; if (model) { modelName.textContent = model; } @@ -193,8 +194,13 @@ function appendChatMessage(role, content, sources) { // 내용 렌더링 const contentDiv = document.createElement('div'); - contentDiv.className = 'text-sm whitespace-pre-line'; - contentDiv.textContent = content; + if (role === 'ai' && typeof marked !== 'undefined') { + contentDiv.className = 'text-sm prose prose-sm max-w-none'; + contentDiv.innerHTML = marked.parse(content); + } else { + contentDiv.className = 'text-sm whitespace-pre-line'; + contentDiv.textContent = content; + } bubble.appendChild(contentDiv); // AI 답변 참고 사례