refactor(tui): remove dialog show helpers (#39948)

Co-authored-by: Kit Langton <kit.langton@gmail.com>
This commit is contained in:
opencode-agent[bot] 2026-07-31 20:28:02 -04:00 committed by GitHub
commit 6d3f84b4ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 30 deletions

View file

@ -1,7 +1,7 @@
import { TextAttributes } from "@opentui/core"
import { Keymap } from "../context/keymap"
import { useTheme } from "../context/theme"
import { useDialog, type DialogContext } from "./dialog"
import { useDialog } from "./dialog"
export type DialogAlertProps = {
title: string
@ -56,12 +56,3 @@ export function DialogAlert(props: DialogAlertProps) {
</box>
)
}
DialogAlert.show = (dialog: DialogContext, title: string, message: string) => {
return new Promise<void>((resolve) => {
dialog.replace(
() => <DialogAlert title={title} message={message} onConfirm={() => resolve()} />,
() => resolve(),
)
})
}

View file

@ -1,7 +1,7 @@
import { TextAttributes } from "@opentui/core"
import { Keymap } from "../context/keymap"
import { useTheme } from "../context/theme"
import { useDialog, type DialogContext } from "./dialog"
import { useDialog } from "./dialog"
import { createStore } from "solid-js/store"
import { For } from "solid-js"
import { Locale } from "../util/locale"
@ -17,8 +17,6 @@ export type DialogConfirmProps = {
}
}
export type DialogConfirmResult = boolean | undefined
export function DialogConfirm(props: DialogConfirmProps) {
const dialog = useDialog()
const theme = useTheme("elevated")
@ -93,20 +91,3 @@ export function DialogConfirm(props: DialogConfirmProps) {
</box>
)
}
DialogConfirm.show = (dialog: DialogContext, title: string, message: string, label?: DialogConfirmProps["label"]) => {
return new Promise<DialogConfirmResult>((resolve) => {
dialog.replace(
() => (
<DialogConfirm
title={title}
message={message}
onConfirm={() => resolve(true)}
onCancel={() => resolve(false)}
label={label}
/>
),
() => resolve(undefined),
)
})
}