fix(tui): allow mouse escape via "esc" labels in dialogs (#11421)
This commit is contained in:
@@ -154,7 +154,9 @@ function AutoMethod(props: AutoMethodProps) {
|
|||||||
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
||||||
{props.title}
|
{props.title}
|
||||||
</text>
|
</text>
|
||||||
<text fg={theme.textMuted}>esc</text>
|
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
|
||||||
|
esc
|
||||||
|
</text>
|
||||||
</box>
|
</box>
|
||||||
<box gap={1}>
|
<box gap={1}>
|
||||||
<Link href={props.authorization.url} fg={theme.primary} />
|
<Link href={props.authorization.url} fg={theme.primary} />
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { TextAttributes } from "@opentui/core"
|
import { TextAttributes } from "@opentui/core"
|
||||||
import { useTheme } from "../context/theme"
|
import { useTheme } from "../context/theme"
|
||||||
|
import { useDialog } from "@tui/ui/dialog"
|
||||||
import { useSync } from "@tui/context/sync"
|
import { useSync } from "@tui/context/sync"
|
||||||
import { For, Match, Switch, Show, createMemo } from "solid-js"
|
import { For, Match, Switch, Show, createMemo } from "solid-js"
|
||||||
import { Installation } from "@/installation"
|
import { Installation } from "@/installation"
|
||||||
@@ -9,6 +10,7 @@ export type DialogStatusProps = {}
|
|||||||
export function DialogStatus() {
|
export function DialogStatus() {
|
||||||
const sync = useSync()
|
const sync = useSync()
|
||||||
const { theme } = useTheme()
|
const { theme } = useTheme()
|
||||||
|
const dialog = useDialog()
|
||||||
|
|
||||||
const enabledFormatters = createMemo(() => sync.data.formatter.filter((f) => f.enabled))
|
const enabledFormatters = createMemo(() => sync.data.formatter.filter((f) => f.enabled))
|
||||||
|
|
||||||
@@ -43,7 +45,9 @@ export function DialogStatus() {
|
|||||||
<text fg={theme.text} attributes={TextAttributes.BOLD}>
|
<text fg={theme.text} attributes={TextAttributes.BOLD}>
|
||||||
Status
|
Status
|
||||||
</text>
|
</text>
|
||||||
<text fg={theme.textMuted}>esc</text>
|
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
|
||||||
|
esc
|
||||||
|
</text>
|
||||||
</box>
|
</box>
|
||||||
<text fg={theme.textMuted}>OpenCode v{Installation.VERSION}</text>
|
<text fg={theme.textMuted}>OpenCode v{Installation.VERSION}</text>
|
||||||
<Show when={Object.keys(sync.data.mcp).length > 0} fallback={<text fg={theme.text}>No MCP Servers</text>}>
|
<Show when={Object.keys(sync.data.mcp).length > 0} fallback={<text fg={theme.text}>No MCP Servers</text>}>
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ export function DialogAlert(props: DialogAlertProps) {
|
|||||||
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
||||||
{props.title}
|
{props.title}
|
||||||
</text>
|
</text>
|
||||||
<text fg={theme.textMuted}>esc</text>
|
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
|
||||||
|
esc
|
||||||
|
</text>
|
||||||
</box>
|
</box>
|
||||||
<box paddingBottom={1}>
|
<box paddingBottom={1}>
|
||||||
<text fg={theme.textMuted}>{props.message}</text>
|
<text fg={theme.textMuted}>{props.message}</text>
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ export function DialogConfirm(props: DialogConfirmProps) {
|
|||||||
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
||||||
{props.title}
|
{props.title}
|
||||||
</text>
|
</text>
|
||||||
<text fg={theme.textMuted}>esc</text>
|
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
|
||||||
|
esc
|
||||||
|
</text>
|
||||||
</box>
|
</box>
|
||||||
<box paddingBottom={1}>
|
<box paddingBottom={1}>
|
||||||
<text fg={theme.textMuted}>{props.message}</text>
|
<text fg={theme.textMuted}>{props.message}</text>
|
||||||
|
|||||||
@@ -80,7 +80,9 @@ export function DialogExportOptions(props: DialogExportOptionsProps) {
|
|||||||
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
||||||
Export Options
|
Export Options
|
||||||
</text>
|
</text>
|
||||||
<text fg={theme.textMuted}>esc</text>
|
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
|
||||||
|
esc
|
||||||
|
</text>
|
||||||
</box>
|
</box>
|
||||||
<box gap={1}>
|
<box gap={1}>
|
||||||
<box>
|
<box>
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ export function DialogHelp() {
|
|||||||
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
||||||
Help
|
Help
|
||||||
</text>
|
</text>
|
||||||
<text fg={theme.textMuted}>esc/enter</text>
|
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
|
||||||
|
esc/enter
|
||||||
|
</text>
|
||||||
</box>
|
</box>
|
||||||
<box paddingBottom={1}>
|
<box paddingBottom={1}>
|
||||||
<text fg={theme.textMuted}>
|
<text fg={theme.textMuted}>
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ export function DialogPrompt(props: DialogPromptProps) {
|
|||||||
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
<text attributes={TextAttributes.BOLD} fg={theme.text}>
|
||||||
{props.title}
|
{props.title}
|
||||||
</text>
|
</text>
|
||||||
<text fg={theme.textMuted}>esc</text>
|
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
|
||||||
|
esc
|
||||||
|
</text>
|
||||||
</box>
|
</box>
|
||||||
<box gap={1}>
|
<box gap={1}>
|
||||||
{props.description}
|
{props.description}
|
||||||
|
|||||||
@@ -226,7 +226,9 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|||||||
<text fg={theme.text} attributes={TextAttributes.BOLD}>
|
<text fg={theme.text} attributes={TextAttributes.BOLD}>
|
||||||
{props.title}
|
{props.title}
|
||||||
</text>
|
</text>
|
||||||
<text fg={theme.textMuted}>esc</text>
|
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
|
||||||
|
esc
|
||||||
|
</text>
|
||||||
</box>
|
</box>
|
||||||
<box paddingTop={1}>
|
<box paddingTop={1}>
|
||||||
<input
|
<input
|
||||||
|
|||||||
Reference in New Issue
Block a user