Skip to content

Commit be2ed8b

Browse files
Apply PR #24810: upgrade opentui to 0.2.0
2 parents 62de3ae + 8682a32 commit be2ed8b

5 files changed

Lines changed: 31 additions & 24 deletions

File tree

bun.lock

Lines changed: 13 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"@types/cross-spawn": "6.0.6",
3535
"@octokit/rest": "22.0.0",
3636
"@hono/zod-validator": "0.4.2",
37-
"@opentui/core": "0.1.105",
38-
"@opentui/solid": "0.1.105",
37+
"@opentui/core": "0.2.0",
38+
"@opentui/solid": "0.2.0",
3939
"ulid": "3.0.1",
4040
"@kobalte/core": "0.13.11",
4141
"@types/luxon": "3.7.1",

packages/opencode/src/cli/cmd/run/theme.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ type SharedSyntaxTheme = TuiThemeCurrent & {
8686
export const transparent = RGBA.fromValues(0, 0, 0, 0)
8787

8888
function alpha(color: RGBA, value: number): RGBA {
89-
return RGBA.fromValues(color.r, color.g, color.b, Math.max(0, Math.min(1, value)), color.tag)
89+
const result = RGBA.clone(color)
90+
result.a = Math.max(0, Math.min(1, value))
91+
return result
9092
}
9193

9294
function rgba(hex: string, value?: number): RGBA {

packages/opencode/test/cli/run/theme.test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ function spread(color: RGBA) {
5959
return Math.max(r, g, b) - Math.min(r, g, b)
6060
}
6161

62+
function expectIndexed(color: unknown) {
63+
const rgba = expectRgba(color)
64+
expect(rgba.intent).toBe("indexed")
65+
expect(rgba.slot).toBeGreaterThanOrEqual(0)
66+
expect(rgba.slot).toBeLessThan(256)
67+
}
68+
6269
test("falls back when palette lookup fails", async () => {
6370
expect(await resolveRunTheme(renderer({ fail: true }))).toBe(RUN_THEME_FALLBACK)
6471
})
@@ -71,10 +78,10 @@ test("returns syntax styles and indexed splash colors", async () => {
7178
expect(theme.block.subtleSyntax).toBeDefined()
7279
expect([...theme.block.syntax!.getAllStyles()].length).toBeGreaterThan(0)
7380
expect([...theme.block.subtleSyntax!.getAllStyles()].length).toBeGreaterThan(0)
74-
expect(RGBA.getIntentTag(expectRgba(theme.splash.left))).toBeLessThan(256)
75-
expect(RGBA.getIntentTag(expectRgba(theme.splash.right))).toBeLessThan(256)
76-
expect(RGBA.getIntentTag(expectRgba(theme.splash.leftShadow))).toBeLessThan(256)
77-
expect(RGBA.getIntentTag(expectRgba(theme.splash.rightShadow))).toBeLessThan(256)
81+
expectIndexed(theme.splash.left)
82+
expectIndexed(theme.splash.right)
83+
expectIndexed(theme.splash.leftShadow)
84+
expectIndexed(theme.splash.rightShadow)
7885
expectRgba(theme.footer.highlight)
7986
expectRgba(theme.footer.surface)
8087
} finally {

packages/plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"zod": "catalog:"
2323
},
2424
"peerDependencies": {
25-
"@opentui/core": ">=0.1.105",
26-
"@opentui/solid": ">=0.1.105"
25+
"@opentui/core": ">=0.2.0",
26+
"@opentui/solid": ">=0.2.0"
2727
},
2828
"peerDependenciesMeta": {
2929
"@opentui/core": {

0 commit comments

Comments
 (0)