Apply PR #11548: fix(tui): Fix tip text truncation in TUI (issue #11154)

This commit is contained in:
opencode-agent[bot]
2026-02-01 14:06:42 +00:00
2 changed files with 5 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import { createMemo, createSignal, For } from "solid-js"
import { DEFAULT_THEMES, useTheme } from "@tui/context/theme"
import { Locale } from "@/util/locale"
const themeCount = Object.keys(DEFAULT_THEMES).length
const themeTip = `Use {highlight}/theme{/highlight} or {highlight}Ctrl+X T{/highlight} to switch between ${themeCount} built-in themes`
@@ -35,11 +36,11 @@ export function Tips() {
const parts = parse(TIPS[Math.floor(Math.random() * TIPS.length)])
return (
<box flexDirection="row" maxWidth="100%">
<box flexDirection="row" width="100%">
<text flexShrink={0} style={{ fg: theme.warning }}>
Tip{" "}
</text>
<text flexShrink={1}>
<text flexGrow={1} wrapMode="word">
<For each={parts}>
{(part) => <span style={{ fg: part.highlight ? theme.text : theme.textMuted }}>{part.text}</span>}
</For>

View File

@@ -93,7 +93,7 @@ export function Home() {
return (
<>
<box flexGrow={1} justifyContent="center" alignItems="center" paddingLeft={2} paddingRight={2} gap={1}>
<box flexGrow={1} justifyContent="center" paddingLeft={2} paddingRight={2} gap={1}>
<box height={3} />
<Logo />
<box width="100%" maxWidth={75} zIndex={1000} paddingTop={1}>
@@ -105,7 +105,7 @@ export function Home() {
hint={Hint}
/>
</box>
<box height={3} width="100%" maxWidth={75} alignItems="center" paddingTop={2}>
<box width="100%" paddingTop={2}>
<Show when={showTips()}>
<Tips />
</Show>