Skip to content

Commit 32394b6

Browse files
committed
Revert "feat(tui): highlight esc label on hover in dialog (anomalyco#12383)"
This reverts commit 683d234.
1 parent 1226286 commit 32394b6

File tree

8 files changed

+29
-95
lines changed

8 files changed

+29
-95
lines changed

packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ function AutoMethod(props: AutoMethodProps) {
109109
const dialog = useDialog()
110110
const sync = useSync()
111111
const toast = useToast()
112-
const [hover, setHover] = createSignal(false)
113112

114113
useKeyboard((evt) => {
115114
if (evt.name === "c" && !evt.ctrl && !evt.meta) {
@@ -140,16 +139,9 @@ function AutoMethod(props: AutoMethodProps) {
140139
<text attributes={TextAttributes.BOLD} fg={theme.text}>
141140
{props.title}
142141
</text>
143-
<box
144-
paddingLeft={1}
145-
paddingRight={1}
146-
backgroundColor={hover() ? theme.primary : undefined}
147-
onMouseOver={() => setHover(true)}
148-
onMouseOut={() => setHover(false)}
149-
onMouseUp={() => dialog.clear()}
150-
>
151-
<text fg={hover() ? theme.selectedListItemText : theme.textMuted}>esc</text>
152-
</box>
142+
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
143+
esc
144+
</text>
153145
</box>
154146
<box gap={1}>
155147
<Link href={props.authorization.url} fg={theme.primary} />

packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { fileURLToPath } from "bun"
33
import { useTheme } from "../context/theme"
44
import { useDialog } from "@tui/ui/dialog"
55
import { useSync } from "@tui/context/sync"
6-
import { For, Match, Switch, Show, createMemo, createSignal } from "solid-js"
6+
import { For, Match, Switch, Show, createMemo } from "solid-js"
77
import { Installation } from "@/installation"
88

99
export type DialogStatusProps = {}
@@ -12,7 +12,6 @@ export function DialogStatus() {
1212
const sync = useSync()
1313
const { theme } = useTheme()
1414
const dialog = useDialog()
15-
const [hover, setHover] = createSignal(false)
1615

1716
const enabledFormatters = createMemo(() => sync.data.formatter.filter((f) => f.enabled))
1817

@@ -47,16 +46,9 @@ export function DialogStatus() {
4746
<text fg={theme.text} attributes={TextAttributes.BOLD}>
4847
Status
4948
</text>
50-
<box
51-
paddingLeft={1}
52-
paddingRight={1}
53-
backgroundColor={hover() ? theme.primary : undefined}
54-
onMouseOver={() => setHover(true)}
55-
onMouseOut={() => setHover(false)}
56-
onMouseUp={() => dialog.clear()}
57-
>
58-
<text fg={hover() ? theme.selectedListItemText : theme.textMuted}>esc</text>
59-
</box>
49+
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
50+
esc
51+
</text>
6052
</box>
6153
<text fg={theme.textMuted}>OpenCode v{Installation.VERSION}</text>
6254
<Show when={Object.keys(sync.data.mcp).length > 0} fallback={<text fg={theme.text}>No MCP Servers</text>}>

packages/opencode/src/cli/cmd/tui/ui/dialog-alert.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { TextAttributes } from "@opentui/core"
22
import { useTheme } from "../context/theme"
33
import { useDialog, type DialogContext } from "./dialog"
44
import { useKeyboard } from "@opentui/solid"
5-
import { createSignal } from "solid-js"
65

76
export type DialogAlertProps = {
87
title: string
@@ -13,7 +12,6 @@ export type DialogAlertProps = {
1312
export function DialogAlert(props: DialogAlertProps) {
1413
const dialog = useDialog()
1514
const { theme } = useTheme()
16-
const [hover, setHover] = createSignal(false)
1715

1816
useKeyboard((evt) => {
1917
if (evt.name === "return") {
@@ -27,16 +25,9 @@ export function DialogAlert(props: DialogAlertProps) {
2725
<text attributes={TextAttributes.BOLD} fg={theme.text}>
2826
{props.title}
2927
</text>
30-
<box
31-
paddingLeft={1}
32-
paddingRight={1}
33-
backgroundColor={hover() ? theme.primary : undefined}
34-
onMouseOver={() => setHover(true)}
35-
onMouseOut={() => setHover(false)}
36-
onMouseUp={() => dialog.clear()}
37-
>
38-
<text fg={hover() ? theme.selectedListItemText : theme.textMuted}>esc</text>
39-
</box>
28+
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
29+
esc
30+
</text>
4031
</box>
4132
<box paddingBottom={1}>
4233
<text fg={theme.textMuted}>{props.message}</text>

packages/opencode/src/cli/cmd/tui/ui/dialog-confirm.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TextAttributes } from "@opentui/core"
22
import { useTheme } from "../context/theme"
33
import { useDialog, type DialogContext } from "./dialog"
44
import { createStore } from "solid-js/store"
5-
import { createSignal, For } from "solid-js"
5+
import { For } from "solid-js"
66
import { useKeyboard } from "@opentui/solid"
77
import { Locale } from "@/util/locale"
88

@@ -16,7 +16,6 @@ export type DialogConfirmProps = {
1616
export function DialogConfirm(props: DialogConfirmProps) {
1717
const dialog = useDialog()
1818
const { theme } = useTheme()
19-
const [hover, setHover] = createSignal(false)
2019
const [store, setStore] = createStore({
2120
active: "confirm" as "confirm" | "cancel",
2221
})
@@ -38,16 +37,9 @@ export function DialogConfirm(props: DialogConfirmProps) {
3837
<text attributes={TextAttributes.BOLD} fg={theme.text}>
3938
{props.title}
4039
</text>
41-
<box
42-
paddingLeft={1}
43-
paddingRight={1}
44-
backgroundColor={hover() ? theme.primary : undefined}
45-
onMouseOver={() => setHover(true)}
46-
onMouseOut={() => setHover(false)}
47-
onMouseUp={() => dialog.clear()}
48-
>
49-
<text fg={hover() ? theme.selectedListItemText : theme.textMuted}>esc</text>
50-
</box>
40+
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
41+
esc
42+
</text>
5143
</box>
5244
<box paddingBottom={1}>
5345
<text fg={theme.textMuted}>{props.message}</text>

packages/opencode/src/cli/cmd/tui/ui/dialog-export-options.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TextareaRenderable, TextAttributes } from "@opentui/core"
22
import { useTheme } from "../context/theme"
33
import { useDialog, type DialogContext } from "./dialog"
44
import { createStore } from "solid-js/store"
5-
import { createSignal, onMount, Show, type JSX } from "solid-js"
5+
import { onMount, Show, type JSX } from "solid-js"
66
import { useKeyboard } from "@opentui/solid"
77

88
export type DialogExportOptionsProps = {
@@ -25,7 +25,6 @@ export function DialogExportOptions(props: DialogExportOptionsProps) {
2525
const dialog = useDialog()
2626
const { theme } = useTheme()
2727
let textarea: TextareaRenderable
28-
const [hover, setHover] = createSignal(false)
2928
const [store, setStore] = createStore({
3029
thinking: props.defaultThinking,
3130
toolDetails: props.defaultToolDetails,
@@ -81,16 +80,9 @@ export function DialogExportOptions(props: DialogExportOptionsProps) {
8180
<text attributes={TextAttributes.BOLD} fg={theme.text}>
8281
Export Options
8382
</text>
84-
<box
85-
paddingLeft={1}
86-
paddingRight={1}
87-
backgroundColor={hover() ? theme.primary : undefined}
88-
onMouseOver={() => setHover(true)}
89-
onMouseOut={() => setHover(false)}
90-
onMouseUp={() => dialog.clear()}
91-
>
92-
<text fg={hover() ? theme.selectedListItemText : theme.textMuted}>esc</text>
93-
</box>
83+
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
84+
esc
85+
</text>
9486
</box>
9587
<box gap={1}>
9688
<box>

packages/opencode/src/cli/cmd/tui/ui/dialog-help.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import { useTheme } from "@tui/context/theme"
33
import { useDialog } from "./dialog"
44
import { useKeyboard } from "@opentui/solid"
55
import { useKeybind } from "@tui/context/keybind"
6-
import { createSignal } from "solid-js"
76

87
export function DialogHelp() {
98
const dialog = useDialog()
109
const { theme } = useTheme()
1110
const keybind = useKeybind()
12-
const [hover, setHover] = createSignal(false)
1311

1412
useKeyboard((evt) => {
1513
if (evt.name === "return" || evt.name === "escape") {
@@ -23,16 +21,9 @@ export function DialogHelp() {
2321
<text attributes={TextAttributes.BOLD} fg={theme.text}>
2422
Help
2523
</text>
26-
<box
27-
paddingLeft={1}
28-
paddingRight={1}
29-
backgroundColor={hover() ? theme.primary : undefined}
30-
onMouseOver={() => setHover(true)}
31-
onMouseOut={() => setHover(false)}
32-
onMouseUp={() => dialog.clear()}
33-
>
34-
<text fg={hover() ? theme.selectedListItemText : theme.textMuted}>esc/enter</text>
35-
</box>
24+
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
25+
esc/enter
26+
</text>
3627
</box>
3728
<box paddingBottom={1}>
3829
<text fg={theme.textMuted}>

packages/opencode/src/cli/cmd/tui/ui/dialog-prompt.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { TextareaRenderable, TextAttributes } from "@opentui/core"
22
import { useTheme } from "../context/theme"
33
import { useDialog, type DialogContext } from "./dialog"
4-
import { createSignal, onMount, type JSX } from "solid-js"
4+
import { onMount, type JSX } from "solid-js"
55
import { useKeyboard } from "@opentui/solid"
66

77
export type DialogPromptProps = {
@@ -17,7 +17,6 @@ export function DialogPrompt(props: DialogPromptProps) {
1717
const dialog = useDialog()
1818
const { theme } = useTheme()
1919
let textarea: TextareaRenderable
20-
const [hover, setHover] = createSignal(false)
2120

2221
useKeyboard((evt) => {
2322
if (evt.name === "return") {
@@ -40,16 +39,9 @@ export function DialogPrompt(props: DialogPromptProps) {
4039
<text attributes={TextAttributes.BOLD} fg={theme.text}>
4140
{props.title}
4241
</text>
43-
<box
44-
paddingLeft={1}
45-
paddingRight={1}
46-
backgroundColor={hover() ? theme.primary : undefined}
47-
onMouseOver={() => setHover(true)}
48-
onMouseOut={() => setHover(false)}
49-
onMouseUp={() => dialog.clear()}
50-
>
51-
<text fg={hover() ? theme.selectedListItemText : theme.textMuted}>esc</text>
52-
</box>
42+
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
43+
esc
44+
</text>
5345
</box>
5446
<box gap={1}>
5547
{props.description}

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { InputRenderable, RGBA, ScrollBoxRenderable, TextAttributes } from "@opentui/core"
22
import { useTheme, selectedForeground } from "@tui/context/theme"
33
import { entries, filter, flatMap, groupBy, pipe, take } from "remeda"
4-
import { batch, createEffect, createMemo, createSignal, For, Show, type JSX, on } from "solid-js"
4+
import { batch, createEffect, createMemo, For, Show, type JSX, on } from "solid-js"
55
import { createStore } from "solid-js/store"
66
import { useKeyboard, useTerminalDimensions } from "@opentui/solid"
77
import * as fuzzysort from "fuzzysort"
@@ -49,7 +49,6 @@ export type DialogSelectRef<T> = {
4949
export function DialogSelect<T>(props: DialogSelectProps<T>) {
5050
const dialog = useDialog()
5151
const { theme } = useTheme()
52-
const [hover, setHover] = createSignal(false)
5352
const [store, setStore] = createStore({
5453
selected: 0,
5554
filter: "",
@@ -227,16 +226,9 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
227226
<text fg={theme.text} attributes={TextAttributes.BOLD}>
228227
{props.title}
229228
</text>
230-
<box
231-
paddingLeft={1}
232-
paddingRight={1}
233-
backgroundColor={hover() ? theme.primary : undefined}
234-
onMouseOver={() => setHover(true)}
235-
onMouseOut={() => setHover(false)}
236-
onMouseUp={() => dialog.clear()}
237-
>
238-
<text fg={hover() ? theme.selectedListItemText : theme.textMuted}>esc</text>
239-
</box>
229+
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
230+
esc
231+
</text>
240232
</box>
241233
<box paddingTop={1}>
242234
<input

0 commit comments

Comments
 (0)