diff --git a/src/api/templates/contact.html b/src/api/templates/contact.html index 6d255e9..d0c1a00 100644 --- a/src/api/templates/contact.html +++ b/src/api/templates/contact.html @@ -331,7 +331,7 @@ display: flex; flex-direction: column; gap: 0.75rem; - max-height: 500px; + max-height: 600px; overflow-y: auto; padding: 0.5rem 0; } @@ -428,6 +428,29 @@ color: #aaa; font-size: 0.75rem; } + + .chat-reactions { + display: flex; + flex-wrap: wrap; + gap: 0.3rem; + margin-top: 0.25rem; + padding: 0 0.5rem; + } + + .chat-reaction { + display: inline-flex; + align-items: center; + gap: 0.15rem; + padding: 0.1rem 0.35rem; + background: rgba(0,0,0,0.05); + border-radius: 10px; + font-size: 0.65rem; + color: #555; + } + + .chat-reaction-emoji { + font-size: 0.75rem; + } @@ -592,10 +615,11 @@ {% if chat_enabled %}
Nachrichten
-
- - -
+
+ + +
+
{% endif %} @@ -665,6 +689,13 @@ } const text = m.content ? escHtml(m.content) : '[' + m.message_type + ']'; html += '
' + text + '
'; + if (m.reactions && m.reactions.length > 0) { + html += '
'; + for (const r of m.reactions) { + html += '' + escHtml(r.reaction || r.emoji || "") + '' + (r.user ? " " + escHtml(r.user) : "") + ''; + } + html += '
'; + } html += '
'; html += '' + fmtTime(m.timestamp_ms) + ''; if (m.platform) { @@ -697,7 +728,10 @@ loading.style.display = "none"; if (!data.messages || data.messages.length === 0) { if (total === 0) { - chatBox.innerHTML = '
Keine Nachrichten gefunden
'; + const empty = document.createElement("div"); + empty.className = "chat-empty"; + empty.textContent = "Keine Nachrichten gefunden"; + chatBox.insertBefore(empty, sentinel); } else { endEl.textContent = "Alle Nachrichten geladen"; endEl.style.display = ""; @@ -706,7 +740,7 @@ return; } for (const m of data.messages) { - chatBox.appendChild(renderMsg(m)); + chatBox.insertBefore(renderMsg(m), sentinel); } offset += data.messages.length; if (offset >= total) { @@ -722,7 +756,7 @@ const observer = new IntersectionObserver(entries => { if (entries[0].isIntersecting && !loading_) loadMore(); - }, { rootMargin: "200px" }); + }, { root: chatBox, rootMargin: "200px" }); observer.observe(sentinel); })();