mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 01:31:23 +00:00
refactor(tui): dedupe handlers and formatter test setup
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
import { Container, Markdown, Spacer } from "@mariozechner/pi-tui";
|
||||
import { markdownTheme, theme } from "../theme/theme.js";
|
||||
|
||||
export class AssistantMessageComponent extends Container {
|
||||
private body: Markdown;
|
||||
import { theme } from "../theme/theme.js";
|
||||
import { MarkdownMessageComponent } from "./markdown-message.js";
|
||||
|
||||
export class AssistantMessageComponent extends MarkdownMessageComponent {
|
||||
constructor(text: string) {
|
||||
super();
|
||||
this.body = new Markdown(text, 1, 0, markdownTheme, {
|
||||
super(text, 0, {
|
||||
// Keep assistant body text in terminal default foreground so contrast
|
||||
// follows the user's terminal theme (dark or light).
|
||||
color: (line) => theme.assistantText(line),
|
||||
});
|
||||
this.addChild(new Spacer(1));
|
||||
this.addChild(this.body);
|
||||
}
|
||||
|
||||
setText(text: string) {
|
||||
this.body.setText(text);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user