Browse Source

tui: remove unused permission dialog component

Dax Raad 3 months ago
parent
commit
4a07bb561f

+ 0 - 2
packages/opencode/src/cli/cmd/tui/app.tsx

@@ -34,7 +34,6 @@ import { Provider } from "@/provider/provider"
 import { ArgsProvider, useArgs, type Args } from "./context/args"
 import open from "open"
 import { PromptRefProvider, usePromptRef } from "./context/prompt"
-import { Permission } from "./component/dialog-permission"
 
 async function getTerminalBackgroundColor(): Promise<"dark" | "light"> {
   // can't set raw mode if not a TTY
@@ -608,7 +607,6 @@ function App() {
         }
       }}
     >
-      <Permission />
       <Switch>
         <Match when={route.data.type === "home"}>
           <Home />

+ 0 - 53
packages/opencode/src/cli/cmd/tui/component/dialog-permission.tsx

@@ -1,53 +0,0 @@
-import { onMount } from "solid-js"
-import { useDialog } from "../ui/dialog"
-import { TextAttributes } from "@opentui/core"
-import { useTheme } from "../context/theme"
-
-export function Permission() {
-  const dialog = useDialog()
-  onMount(() => {})
-  return null
-}
-
-function DialogPermission() {
-  const dialog = useDialog()
-  const { theme } = useTheme()
-
-  onMount(() => {
-    dialog.setSize("medium")
-  })
-
-  return (
-    <box
-      gap={1}
-      paddingLeft={2}
-      paddingRight={2}
-      onKeyDown={(e) => {
-        console.log(e)
-      }}
-      ref={(r) => {
-        setTimeout(() => {
-          r?.focus()
-        }, 1)
-      }}
-    >
-      <box flexDirection="row" justifyContent="space-between">
-        <text attributes={TextAttributes.BOLD}>Permission Request</text>
-        <text fg={theme.textMuted}>esc</text>
-      </box>
-      <text fg={theme.textMuted}>Change to foo directory and create bar file</text>
-      <text>$ cd foo && touch bar</text>
-      <box paddingBottom={1}>
-        <box paddingLeft={2} paddingRight={2} backgroundColor={theme.primary}>
-          <text fg={theme.background}>Allow</text>
-        </box>
-        <box paddingLeft={2} paddingRight={2}>
-          <text>Always allow the touch command</text>
-        </box>
-        <box paddingLeft={2} paddingRight={2}>
-          <text>Reject</text>
-        </box>
-      </box>
-    </box>
-  )
-}