modified: static/css/style.css

modified:   static/js/chat.js
	modified:   templates/base.html
This commit is contained in:
SimolZimol
2026-05-22 18:01:38 +02:00
parent 31e1b4618c
commit 8ff280d68d
3 changed files with 64 additions and 3 deletions

View File

@@ -64,15 +64,21 @@ export class Chat {
wrap.className = `flex ${role === 'user' ? 'justify-end' : 'justify-start'} gap-3`;
if (role === 'assistant') {
const bodyClass = isError
? 'bg-copilot-danger text-copilot-bg'
: 'bg-copilot-panel text-copilot-text';
const renderedContent = isError
? escapeHtml(content)
: (typeof marked !== 'undefined' ? marked.parse(content) : escapeHtml(content));
wrap.innerHTML = `
<div class="w-7 h-7 rounded-full bg-copilot-accent flex items-center justify-center shrink-0 mt-0.5">
<svg class="w-4 h-4 text-copilot-bg" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"/>
</svg>
</div>
<div class="max-w-[75%] rounded-2xl rounded-tl-sm px-4 py-3 text-sm leading-relaxed
${isError ? 'bg-copilot-danger text-copilot-bg' : 'bg-copilot-panel text-copilot-text'}
shadow-sm whitespace-pre-wrap">${escapeHtml(content)}</div>`;
<div class="markdown-body max-w-[75%] rounded-2xl rounded-tl-sm px-4 py-3 text-sm leading-relaxed
${bodyClass} shadow-sm">${renderedContent}</div>`;
return wrap;
} else {
wrap.innerHTML = `
<div class="max-w-[75%] rounded-2xl rounded-tr-sm px-4 py-3 text-sm leading-relaxed