diff options
| author | Maharshi Patel <[email protected]> | 2026-02-04 19:28:22 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-04 18:28:22 -0600 |
| commit | 31e2feb347e32adf173ab239b4ecb98d5127679a (patch) | |
| tree | c0579d59dec90b90344070abba30127d8cd126bd | |
| parent | 2896b8a863909f345468a959669f62cc7feca7c9 (diff) | |
| download | opencode-31e2feb347e32adf173ab239b4ecb98d5127679a.tar.gz opencode-31e2feb347e32adf173ab239b4ecb98d5127679a.zip | |
fix(tui): add hover states to question tool tabs (#12203)
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/routes/session/question.tsx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/question.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/question.tsx index 88e99c6ea..1565a3008 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/question.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/question.tsx @@ -1,5 +1,5 @@ import { createStore } from "solid-js/store" -import { createMemo, For, Show } from "solid-js" +import { createMemo, createSignal, For, Show } from "solid-js" import { useKeyboard } from "@opentui/solid" import type { TextareaRenderable } from "@opentui/core" import { useKeybind } from "../../context/keybind" @@ -19,6 +19,7 @@ export function QuestionPrompt(props: { request: QuestionRequest }) { const questions = createMemo(() => props.request.questions) const single = createMemo(() => questions().length === 1 && questions()[0]?.multiple !== true) const tabs = createMemo(() => (single() ? 1 : questions().length + 1)) // questions + confirm tab (no confirm for single select) + const [tabHover, setTabHover] = createSignal<number | "confirm" | null>(null) const [store, setStore] = createStore({ tab: 0, answers: [] as QuestionAnswer[], @@ -269,7 +270,15 @@ export function QuestionPrompt(props: { request: QuestionRequest }) { <box paddingLeft={1} paddingRight={1} - backgroundColor={isActive() ? theme.accent : theme.backgroundElement} + backgroundColor={ + isActive() + ? theme.accent + : tabHover() === index() + ? theme.backgroundElement + : theme.backgroundPanel + } + onMouseOver={() => setTabHover(index())} + onMouseOut={() => setTabHover(null)} onMouseUp={() => selectTab(index())} > <text @@ -290,7 +299,11 @@ export function QuestionPrompt(props: { request: QuestionRequest }) { <box paddingLeft={1} paddingRight={1} - backgroundColor={confirm() ? theme.accent : theme.backgroundElement} + backgroundColor={ + confirm() ? theme.accent : tabHover() === "confirm" ? theme.backgroundElement : theme.backgroundPanel + } + onMouseOver={() => setTabHover("confirm")} + onMouseOut={() => setTabHover(null)} onMouseUp={() => selectTab(questions().length)} > <text fg={confirm() ? selectedForeground(theme, theme.accent) : theme.textMuted}>Confirm</text> |
