fix: fence lone commands and give the prompt some warmth (#12)

This commit was merged in pull request #12.
This commit is contained in:
2026-10-03 22:00:38 +00:00
parent 75fc914eca
commit 95edbcd20b
4 changed files with 199 additions and 18 deletions
+5 -4
View File
@@ -1,4 +1,4 @@
import { labelCodeFences } from "./code";
import { repairCodeBlocks } from "./code";
import type { ChatTurn, ThreadMessage } from "./types";
/**
@@ -55,9 +55,10 @@ function renderMessage(message: ThreadMessage, options: TranscriptOptions): stri
// stands in and the user can see what Lam is actually doing.
const placeholder = message.status ? `_${message.status}…_` : "_Thinking…_";
const body = message.text.trim()
? // Fences without a language render as a plain dark panel; labelling them
// lets Vicinae colour the code (`MdCodeBlock.qml` + KSyntaxHighlighting).
labelCodeFences(message.text.trim())
? // Fences without a language render as a plain dark panel, and a lone
// inline command renders as a chip with no Copy button at all. Both are
// repaired before the markdown reaches the renderer.
repairCodeBlocks(message.text.trim())
: message.isStreaming
? placeholder
: "_No response._";