فهرست منبع

tui: improve autocomplete component styling and update test command

Dax Raad 3 ماه پیش
والد
کامیت
aae0ce9921
1فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 7 4
      packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx

+ 7 - 4
packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx

@@ -334,8 +334,8 @@ export function Autocomplete(props: {
           if (e.name === "up") move(-1)
           if (e.name === "down") move(1)
           if (e.name === "escape") hide()
-          if (e.name === "return") select()
-          if (["up", "down", "return", "escape"].includes(e.name)) e.preventDefault()
+          if (e.name === "return" || e.name === "tab") select()
+          if (["up", "down", "return", "tab", "escape"].includes(e.name)) e.preventDefault()
         }
         if (!store.visible) {
           if (e.name === "@") {
@@ -391,11 +391,14 @@ export function Autocomplete(props: {
               backgroundColor={index() === store.selected ? theme.primary : undefined}
               flexDirection="row"
             >
-              <text fg={index() === store.selected ? theme.background : theme.text}>
+              <text fg={index() === store.selected ? theme.background : theme.text} flexShrink={0}>
                 {option.display}
               </text>
               <Show when={option.description}>
-                <text fg={index() === store.selected ? theme.background : theme.textMuted}>
+                <text
+                  fg={index() === store.selected ? theme.background : theme.textMuted}
+                  wrapMode="none"
+                >
                   {option.description}
                 </text>
               </Show>