Skip to content

Commit a2fc22d

Browse files
committed
Rename the legacy TUI palette so OpenTUI can own theme.ts
The ANSI SemanticRole helpers and the OpenTUI UI palette both lived at theme.ts once the shells share a directory. Move the older helpers to semantic-theme.ts and point their importers at the new path; leave the OpenTUI palette API alone.
1 parent 7ce7609 commit a2fc22d

9 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎src/tui-opentui/tool-args.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
import { isMcpToolName } from "../mcp/tool-name.js"
15-
import type { SemanticRole } from "../tui/theme.js"
15+
import type { SemanticRole } from "../tui/semantic-theme.js"
1616
import { summarizeToolArgs } from "../tui/tool-formatter.js"
1717
import { validateView, viewToLines, type ViewNode } from "../tui/view/index.js"
1818
import type { StyledBodyLine } from "./stream.js"

‎src/tui/markdown-parser.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, test } from "bun:test";
22
import { createMemoizedParseMarkdown, parseMarkdown, type StyledSegment } from "./markdown-parser.js";
3-
import { color } from "./theme.js";
3+
import { color } from "./semantic-theme.js";
44

55
function firstLine(text: string): StyledSegment[] {
66
return parseMarkdown(text)[0] ?? [];

‎src/tui/syntax-highlight.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, test } from "bun:test";
22
import type { StyledSegment } from "./markdown-parser.js";
33
import { highlightCode } from "./syntax-highlight.js";
4-
import { color } from "./theme.js";
4+
import { color } from "./semantic-theme.js";
55

66
function segmentFor(lines: StyledSegment[][], text: string): StyledSegment | undefined {
77
return lines.flat().find((seg) => seg.text === text);

‎src/tui/syntax-highlight.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// already fall back to plain code.
44
import hljs from "highlight.js/lib/common";
55
import type { StyledSegment } from "./markdown-parser.js";
6-
import { color, type SemanticRole } from "./theme.js";
6+
import { color, type SemanticRole } from "./semantic-theme.js";
77

88
// Map highlight.js scope classes to the semantic syntax palette. hljs emits a
99
// class attribute whose first token is prefixed `hljs-` and whose optional

‎src/tui/tool-formatter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type } from "arktype";
22
import { relative, isAbsolute } from "node:path";
3-
import type { SemanticRole } from "./theme.js";
3+
import type { SemanticRole } from "./semantic-theme.js";
44
import { isMcpToolName, humanizeMcpTool } from "../mcp/tool-name.js";
55
import { formatMcpResult } from "./mcp-result-format.js";
66

‎src/tui/view/lines.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { StyledSegment } from "../markdown-parser.js";
2-
import { color, type SemanticRole } from "../theme.js";
2+
import { color, type SemanticRole } from "../semantic-theme.js";
33
import { wrapLines } from "./height.js";
44
import type { Tone, ViewNode } from "./spec.js";
55
import { VIEW_GRID_MAX_ROWS } from "./spec.js";

‎src/tui/view/registry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { SemanticRole } from "../theme.js";
1+
import type { SemanticRole } from "../semantic-theme.js";
22
import type { Tone } from "./spec.js";
33

44
export const GAP = 2;

‎tests/unit/tui/theme.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect, afterEach, beforeEach } from "bun:test";
2-
import { color, color256, palette, supportsTrueColor } from "../../../src/tui/theme.js";
2+
import { color, color256, palette, supportsTrueColor } from "../../../src/tui/semantic-theme.js";
33

44
const originalColorterm = process.env.COLORTERM;
55

0 commit comments

Comments
 (0)