Dax Raad 3 месяцев назад
Родитель
Сommit
28e765ef0a

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

@@ -180,7 +180,7 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
             focusedTextColor={theme.textMuted}
             focusedTextColor={theme.textMuted}
             ref={(r) => {
             ref={(r) => {
               input = r
               input = r
-              input.focus()
+              setTimeout(() => input.focus(), 1)
             }}
             }}
             placeholder="Enter search term"
             placeholder="Enter search term"
           />
           />

+ 10 - 17
packages/opencode/src/cli/cmd/tui/ui/dialog.tsx

@@ -1,23 +1,18 @@
 import { useKeyboard, useRenderer, useTerminalDimensions } from "@opentui/solid"
 import { useKeyboard, useRenderer, useTerminalDimensions } from "@opentui/solid"
-import { batch, createContext, createEffect, Show, useContext, type JSX, type ParentProps } from "solid-js"
+import {
+  batch,
+  createContext,
+  createEffect,
+  Show,
+  useContext,
+  type JSX,
+  type ParentProps,
+} from "solid-js"
 import { useTheme } from "@tui/context/theme"
 import { useTheme } from "@tui/context/theme"
 import { Renderable, RGBA } from "@opentui/core"
 import { Renderable, RGBA } from "@opentui/core"
 import { createStore } from "solid-js/store"
 import { createStore } from "solid-js/store"
 import { createEventBus } from "@solid-primitives/event-bus"
 import { createEventBus } from "@solid-primitives/event-bus"
 
 
-const Border = {
-  topLeft: "┃",
-  topRight: "┃",
-  bottomLeft: "┃",
-  bottomRight: "┃",
-  horizontal: "",
-  vertical: "┃",
-  topT: "+",
-  bottomT: "+",
-  leftT: "+",
-  rightT: "+",
-  cross: "+",
-}
 export function Dialog(
 export function Dialog(
   props: ParentProps<{
   props: ParentProps<{
     size?: "medium" | "large"
     size?: "medium" | "large"
@@ -45,11 +40,9 @@ export function Dialog(
         onMouseUp={async (e) => {
         onMouseUp={async (e) => {
           e.stopPropagation()
           e.stopPropagation()
         }}
         }}
-        customBorderChars={Border}
         width={props.size === "large" ? 80 : 60}
         width={props.size === "large" ? 80 : 60}
         maxWidth={dimensions().width - 2}
         maxWidth={dimensions().width - 2}
         backgroundColor={theme.backgroundPanel}
         backgroundColor={theme.backgroundPanel}
-        borderColor={theme.border}
         paddingTop={1}
         paddingTop={1}
       >
       >
         {props.children}
         {props.children}
@@ -138,7 +131,7 @@ function init() {
     },
     },
     get allClosedEvent() {
     get allClosedEvent() {
       return allClosedEvent
       return allClosedEvent
-    }
+    },
   }
   }
 }
 }