MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / insertMention

Function insertMention

deployments/desktop/static/desktop.js:4660–4683  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

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;

Callers 1

bindEventsFunction · 0.85

Calls 3

mentionQueryAtCursorFunction · 0.85
renderChatMentionChipsFunction · 0.85
$Function · 0.70

Tested by

no test coverage detected