Files
t3tui/src/ui/theme.ts
T
Callum Alpass cea1409f40 Stable thread updates, folded work view, always-on composer
- Track selection by thread id and sort active threads by run start, so
  reordering no longer resubscribes and reloads the open thread
- Cache blocks per turn item, reuse unchanged segments, memoize views,
  and batch streamed updates to one redraw per frame
- Keep left threads subscribed for a minute so switching back is instant
- Fold runs of tool calls and reasoning into one summary line; clip long
  user messages; e expands both
- Always-visible multi-line composer with per-thread drafts and
  typing/navigation modes
2026-11-02 17:06:06 +11:00

49 lines
1.3 KiB
TypeScript

import { SyntaxStyle } from "@opentui/core";
import type { Tone } from "../model/transcript.ts";
export const colors = {
bg: "#16161e",
panel: "#1a1b26",
border: "#2f334d",
borderFocused: "#7aa2f7",
text: "#c0caf5",
muted: "#737aa2",
faint: "#545c7e",
accent: "#7aa2f7",
user: "#7dcfff",
userBg: "#1f2335",
good: "#9ece6a",
bad: "#f7768e",
warn: "#e0af68",
selectedBg: "#283457",
} as const;
export const toneColor: Record<Tone, string> = {
normal: colors.text,
muted: colors.muted,
good: colors.good,
bad: colors.bad,
warn: colors.warn,
};
let markdownStyle: SyntaxStyle | undefined;
/** Created lazily: SyntaxStyle needs the native renderer library loaded. */
export function getMarkdownStyle(): SyntaxStyle {
markdownStyle ??= SyntaxStyle.fromStyles({
default: { fg: colors.text },
"markup.heading": { fg: colors.accent, bold: true },
"markup.strong": { bold: true },
"markup.italic": { italic: true },
"markup.strikethrough": { dim: true },
"markup.link": { fg: colors.user, underline: true },
"markup.link.label": { fg: colors.user },
"markup.link.url": { fg: colors.faint, underline: true },
"markup.quote": { fg: colors.muted, italic: true },
"markup.raw": { fg: colors.warn },
"markup.raw.block": { fg: colors.text },
});
return markdownStyle;
}