feat(tui, coding-agent): add configurable code block indent setting (#855)
Add markdown.codeBlockIndent setting to customize indentation prefix for rendered code blocks. Default remains 2 spaces for visual clarity, but setting to empty string removes indentation for easier copy/paste of code snippets to scripts, editors, or other tools. Changes: - tui: add optional codeBlockIndent to MarkdownTheme interface - coding-agent: add MarkdownSettings with codeBlockIndent property - coding-agent: compose theme with settings at call sites (no global state) - coding-agent: update message components to accept optional MarkdownTheme Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { Container, Markdown, Spacer } from "@mariozechner/pi-tui";
|
||||
import { Container, Markdown, type MarkdownTheme, Spacer } from "@mariozechner/pi-tui";
|
||||
import { getMarkdownTheme, theme } from "../theme/theme.js";
|
||||
|
||||
/**
|
||||
* Component that renders a user message
|
||||
*/
|
||||
export class UserMessageComponent extends Container {
|
||||
constructor(text: string) {
|
||||
constructor(text: string, markdownTheme: MarkdownTheme = getMarkdownTheme()) {
|
||||
super();
|
||||
this.addChild(new Spacer(1));
|
||||
this.addChild(
|
||||
new Markdown(text, 1, 1, getMarkdownTheme(), {
|
||||
new Markdown(text, 1, 1, markdownTheme, {
|
||||
bgColor: (text: string) => theme.bg("userMessageBg", text),
|
||||
color: (text: string) => theme.fg("userMessageText", text),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user