Skip to content

Commit aae0ce9

Browse files
committed
tui: improve autocomplete component styling and update test command
1 parent 81b94d8 commit aae0ce9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ export function Autocomplete(props: {
334334
if (e.name === "up") move(-1)
335335
if (e.name === "down") move(1)
336336
if (e.name === "escape") hide()
337-
if (e.name === "return") select()
338-
if (["up", "down", "return", "escape"].includes(e.name)) e.preventDefault()
337+
if (e.name === "return" || e.name === "tab") select()
338+
if (["up", "down", "return", "tab", "escape"].includes(e.name)) e.preventDefault()
339339
}
340340
if (!store.visible) {
341341
if (e.name === "@") {
@@ -391,11 +391,14 @@ export function Autocomplete(props: {
391391
backgroundColor={index() === store.selected ? theme.primary : undefined}
392392
flexDirection="row"
393393
>
394-
<text fg={index() === store.selected ? theme.background : theme.text}>
394+
<text fg={index() === store.selected ? theme.background : theme.text} flexShrink={0}>
395395
{option.display}
396396
</text>
397397
<Show when={option.description}>
398-
<text fg={index() === store.selected ? theme.background : theme.textMuted}>
398+
<text
399+
fg={index() === store.selected ? theme.background : theme.textMuted}
400+
wrapMode="none"
401+
>
399402
{option.description}
400403
</text>
401404
</Show>

0 commit comments

Comments
 (0)