diff --git a/wwwroot/js/history.js b/wwwroot/js/history.js index 300aa39..5c7ab13 100644 --- a/wwwroot/js/history.js +++ b/wwwroot/js/history.js @@ -111,6 +111,18 @@ async function loadLatestArchive() { case 'text': div.className = msg.role === 'user' ? 'msg user archived' : 'msg assistant archived'; div.textContent = msg.content; + if (msg.role === 'user' && msg.attachmentCount > 0) { + let names = []; + try { if (msg.attachmentNames) names = JSON.parse(msg.attachmentNames); } catch {} + const nameList = names.filter(n => n).join(', '); + const ind = document.createElement('div'); + ind.className = 'attachment-indicator'; + ind.textContent = `📎 ${msg.attachmentCount} Datei${msg.attachmentCount > 1 ? 'en' : ''}` + (nameList ? `: ${nameList}` : ''); + ind.style.cursor = 'pointer'; + ind.title = 'Klicken zum Anzeigen'; + ind.addEventListener('click', () => loadAndShowAttachments(msg.id, ind)); + div.appendChild(ind); + } break; case 'tool_use': div.className = 'tool-box archived';