tui: fix text wrapping to prevent layout overflow in terminal UI

This commit is contained in:
Dax Raad 2025-10-23 17:23:58 -04:00
parent f2b8a3ada4
commit 754c264ea1
4 changed files with 5 additions and 5 deletions

View file

@ -222,7 +222,7 @@ function App() {
tab
</text>
<text fg={local.agent.color(local.agent.current().name)}>{""}</text>
<text bg={local.agent.color(local.agent.current().name)} fg={Theme.background} wrap={false}>
<text bg={local.agent.color(local.agent.current().name)} fg={Theme.background} wrapMode="none">
<span style={{ bold: true }}> {local.agent.current().name.toUpperCase()}</span>
<span> AGENT </span>
</text>

View file

@ -369,7 +369,7 @@ export function Prompt(props: PromptProps) {
<box backgroundColor={Theme.backgroundElement} width={1} justifyContent="center" alignItems="center"></box>
</box>
<box flexDirection="row" justifyContent="space-between">
<text flexShrink={0} wrap={false}>
<text flexShrink={0} wrapMode="none">
<span style={{ fg: Theme.textMuted }}>{local.model.parsed().provider}</span>{" "}
<span style={{ bold: true }}>{local.model.parsed().model}</span>
</text>

View file

@ -47,13 +47,13 @@ export function Header() {
<text fg={Theme.textMuted}>{session().share!.url}</text>
</Match>
<Match when={true}>
<text wrap={false}>
<text wrapMode="none">
/share <span style={{ fg: Theme.textMuted }}>to create a shareable link</span>
</text>
</Match>
</Switch>
<Show when={context()}>
<text fg={Theme.textMuted} wrap={false}>
<text fg={Theme.textMuted} wrapMode="none">
{context()} ({cost()})
</text>
</Show>

View file

@ -254,7 +254,7 @@ function Option(props: {
fg={props.active ? Theme.background : props.current ? Theme.primary : Theme.text}
attributes={props.active ? TextAttributes.BOLD : undefined}
overflow="hidden"
wrap={false}
wrapMode="none"
>
{Locale.truncate(props.title, 62)}
<span style={{ fg: props.active ? Theme.background : Theme.textMuted }}> {props.description}</span>