瀏覽代碼

fix dialog

Dax Raad 3 月之前
父節點
當前提交
28e765ef0a
共有 2 個文件被更改,包括 11 次插入18 次删除
  1. 1 1
      packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx
  2. 10 17
      packages/opencode/src/cli/cmd/tui/ui/dialog.tsx

+ 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}
             ref={(r) => {
               input = r
-              input.focus()
+              setTimeout(() => input.focus(), 1)
             }}
             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 { 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 { Renderable, RGBA } from "@opentui/core"
 import { createStore } from "solid-js/store"
 import { createEventBus } from "@solid-primitives/event-bus"
 
-const Border = {
-  topLeft: "┃",
-  topRight: "┃",
-  bottomLeft: "┃",
-  bottomRight: "┃",
-  horizontal: "",
-  vertical: "┃",
-  topT: "+",
-  bottomT: "+",
-  leftT: "+",
-  rightT: "+",
-  cross: "+",
-}
 export function Dialog(
   props: ParentProps<{
     size?: "medium" | "large"
@@ -45,11 +40,9 @@ export function Dialog(
         onMouseUp={async (e) => {
           e.stopPropagation()
         }}
-        customBorderChars={Border}
         width={props.size === "large" ? 80 : 60}
         maxWidth={dimensions().width - 2}
         backgroundColor={theme.backgroundPanel}
-        borderColor={theme.border}
         paddingTop={1}
       >
         {props.children}
@@ -138,7 +131,7 @@ function init() {
     },
     get allClosedEvent() {
       return allClosedEvent
-    }
+    },
   }
 }