fix(tui): satisfy strict dialog prompt types

This commit is contained in:
Sebastian Herrlinger 2026-06-30 11:54:43 +02:00
commit 5030097b55
2 changed files with 8 additions and 3 deletions

View file

@ -1528,7 +1528,7 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
customBorderChars={SplitBorder.customBorderChars}
borderColor={theme.error}
>
<text fg={theme.textMuted}>{props.message.error?.data.message}</text>
<text fg={theme.textMuted}>{String(props.message.error?.data.message ?? "")}</text>
</box>
</Show>
<Switch>

View file

@ -8,7 +8,7 @@ import { useBindings, useCommandShortcut } from "../keymap"
export type DialogPromptProps = {
title: string
description?: () => JSX.Element
description?: JSX.Element | (() => JSX.Element)
placeholder?: string
value?: string
busy?: boolean
@ -25,6 +25,11 @@ export function DialogPrompt(props: DialogPromptProps) {
const [textareaTarget, setTextareaTarget] = createSignal<TextareaRenderable>()
let textarea: TextareaRenderable
const description = () => {
if (typeof props.description === "function") return props.description()
return props.description
}
function confirm() {
if (props.busy) return
props.onConfirm?.(textarea.plainText)
@ -83,7 +88,7 @@ export function DialogPrompt(props: DialogPromptProps) {
</text>
</box>
<box gap={1}>
{props.description}
{description()}
<textarea
height={3}
ref={(val: TextareaRenderable) => {