fix(tui): expand MCP server errors in dialog (#35243)

This commit is contained in:
Aiden Cline 2026-07-03 18:19:16 -05:00 committed by GitHub
commit b04d8d53e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 92 additions and 37 deletions

View file

@ -59,6 +59,8 @@ export interface DialogSelectOption<T = any> {
value: T
description?: string
details?: string[]
detailsColor?: RGBA
detailsWrap?: boolean
footer?: JSX.Element | string
titleWidth?: number
truncateTitle?: boolean | "left"
@ -697,8 +699,13 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
<For each={option.details}>
{(detail) => (
<box paddingLeft={3} paddingRight={3}>
<text fg={theme.textMuted} wrapMode="none">
{Locale.truncateMiddle(detail, Math.max(1, Math.min(76, dimensions().width - 12)))}
<text
fg={option.detailsColor ?? theme.textMuted}
wrapMode={option.detailsWrap ? "word" : "none"}
>
{option.detailsWrap
? detail
: Locale.truncateMiddle(detail, Math.max(1, Math.min(76, dimensions().width - 12)))}
</text>
</box>
)}