Compare commits

...
1 Commits
Author SHA1 Message Date
Kit Langton fdd08abc0b fix(tui): support single categorical theme hue 2026-08-10 16:41:21 +00:00
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ export function generateSyntax(theme: ResolvedThemeTokens, mode: Mode) {
rule(["prompt"], theme.hue.accent[step]),
rule(["extmark.file"], feedback.warning.default, { bold: true }),
rule(["extmark.agent"], theme.categorical[0][step], { bold: true }),
rule(["extmark.skill"], theme.categorical[1][step], { bold: true }),
rule(["extmark.skill"], (theme.categorical[1] ?? theme.categorical[0])[step], { bold: true }),
// V1 migration preserves its selected/inverse foreground in this action state.
rule(["extmark.paste"], theme.text.action.primary.focused, {
background: feedback.warning.default,
+12
View File
@@ -0,0 +1,12 @@
import { expect, test } from "bun:test"
import { generateSyntax, resolveThemeDocument } from "@opencode-ai/theme/tui"
import { SyntaxStyle } from "@opentui/core"
import { parseTheme } from "../../../src/theme"
test("generates syntax for a single categorical hue", () => {
const theme = resolveThemeDocument(parseTheme({ version: 2, light: { categorical: ["red"] } }), "light")
const syntax = generateSyntax(theme, "light")
expect(syntax).toBeInstanceOf(SyntaxStyle)
syntax.destroy()
})