mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 23:02:02 +03:00
fix (tui): keep assistant text contrast theme-adaptive
This commit is contained in:
@@ -7,7 +7,9 @@ export class AssistantMessageComponent extends Container {
|
|||||||
constructor(text: string) {
|
constructor(text: string) {
|
||||||
super();
|
super();
|
||||||
this.body = new Markdown(text, 1, 0, markdownTheme, {
|
this.body = new Markdown(text, 1, 0, markdownTheme, {
|
||||||
color: (line) => theme.fg(line),
|
// 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(new Spacer(1));
|
||||||
this.addChild(this.body);
|
this.addChild(this.body);
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ function highlightCode(code: string, lang?: string): string[] {
|
|||||||
|
|
||||||
export const theme = {
|
export const theme = {
|
||||||
fg: fg(palette.text),
|
fg: fg(palette.text),
|
||||||
|
assistantText: (text: string) => text,
|
||||||
dim: fg(palette.dim),
|
dim: fg(palette.dim),
|
||||||
accent: fg(palette.accent),
|
accent: fg(palette.accent),
|
||||||
accentSoft: fg(palette.accentSoft),
|
accentSoft: fg(palette.accentSoft),
|
||||||
|
|||||||
Reference in New Issue
Block a user