refactor: pre-cleanup.

This commit is contained in:
sam committed 2026-08-06 01:40:15 +10:00
1 parent 0ceab9d897
commit e10cbbc92c
53 files changed
+3596 -648

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { el } from "../base/dom.js";
import { renderMarkdown } from "./markdown.js";
export function sessionTitle(session) {
return session.title || session.branch_name || `Conversation ${session.session_id.slice(0, 8)}`;
}
export function chatBubble(message) {
const from = message.from ?? message.From ?? "";
const text = message.text ?? message.Text ?? "";
const isAssistant = from !== "web";
return el(
`div.chat-bubble-row.${isAssistant ? "assistant" : "user"}`,
el(
"div.chat-bubble",
el("div.chat-bubble-meta", isAssistant ? "Archie" : "You"),
isAssistant ? renderMarkdown(text) : el("div.chat-bubble-text", text),
),
);
}