fix(tui): support single categorical theme hue
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
Reference in New Issue
Block a user