(node)
| 4658 | |
| 4659 | function chatIntroHtml() { |
| 4660 | return ` |
| 4661 | <div class="message assistant"> |
| 4662 | <div class="avatar">AI</div> |
| 4663 | <div class="bubble"> |
| 4664 | <p>${escapeHtml(ui().chat.intro)}</p> |
| 4665 | </div> |
| 4666 | </div> |
| 4667 | `; |
| 4668 | } |
| 4669 | |
| 4670 | function resetChatThread() { |
| 4671 | state.chatMessages = []; |
| 4672 | $("chatThread").innerHTML = chatIntroHtml(); |
| 4673 | renderChatSources(); |
| 4674 | window.setTimeout(() => { |
| 4675 | $("chatThread").scrollTop = $("chatThread").scrollHeight; |
| 4676 | }, 0); |
| 4677 | } |
| 4678 | |
| 4679 | function formatChatDateLabel(dateValue) { |
| 4680 | const date = String(dateValue || "").slice(0, 10); |
| 4681 | if (!date) return ui().chat.ungrouped; |
| 4682 | if (date === todayDateValue()) return ui().chat.today; |
| 4683 | const yesterday = new Date(); |
| 4684 | yesterday.setDate(yesterday.getDate() - 1); |
| 4685 | const yesterdayValue = `${yesterday.getFullYear()}-${String(yesterday.getMonth() + 1).padStart(2, "0")}-${String(yesterday.getDate()).padStart(2, "0")}`; |
| 4686 | if (date === yesterdayValue) return ui().chat.yesterday; |
no test coverage detected