// ── Reply / Quote ── let pendingReply = null; // { index, role, text } - Zitierte Nachricht function setReply(reply) { pendingReply = reply; renderReplyPreview(); document.getElementById('input')?.focus(); } function clearReply() { pendingReply = null; renderReplyPreview(); } function renderReplyPreview() { const container = $('#replyPreview'); if (!container) return; if (!pendingReply) { container.innerHTML = ''; container.hidden = true; return; } const roleLabel = pendingReply.role === 'user' ? 'User' : 'Assistant'; const timeLabel = _formatTimestamp(pendingReply.timestamp) || 'Jetzt'; const preview = truncate(pendingReply.text, 150); container.innerHTML = `
`; container.hidden = false; }