Procházet zdrojové kódy

tui: wrap dialog option descriptions (#5083)

ry2009 před 2 měsíci
rodič
revize
03324d4277

+ 4 - 2
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx

@@ -299,11 +299,13 @@ function Option(props: {
         fg={props.active ? fg : props.current ? theme.primary : theme.text}
         fg={props.active ? fg : props.current ? theme.primary : theme.text}
         attributes={props.active ? TextAttributes.BOLD : undefined}
         attributes={props.active ? TextAttributes.BOLD : undefined}
         overflow="hidden"
         overflow="hidden"
-        wrapMode="none"
+        wrapMode="word"
         paddingLeft={3}
         paddingLeft={3}
       >
       >
         {Locale.truncate(props.title, 62)}
         {Locale.truncate(props.title, 62)}
-        <span style={{ fg: props.active ? fg : theme.textMuted }}> {props.description}</span>
+        <Show when={props.description}>
+          <span style={{ fg: props.active ? fg : theme.textMuted }}> {props.description}</span>
+        </Show>
       </text>
       </text>
       <Show when={props.footer}>
       <Show when={props.footer}>
         <box flexShrink={0}>
         <box flexShrink={0}>