fix: fence lone commands and give the prompt some warmth (#12)
This commit was merged in pull request #12.
This commit is contained in:
+5
-4
@@ -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._";
|
||||
|
||||
Reference in New Issue
Block a user