11import { createStore } from "solid-js/store"
2- import { createMemo , For , Show } from "solid-js"
2+ import { createMemo , createSignal , For , Show } from "solid-js"
33import { useKeyboard } from "@opentui/solid"
44import type { TextareaRenderable } from "@opentui/core"
55import { useKeybind } from "../../context/keybind"
@@ -19,6 +19,7 @@ export function QuestionPrompt(props: { request: QuestionRequest }) {
1919 const questions = createMemo ( ( ) => props . request . questions )
2020 const single = createMemo ( ( ) => questions ( ) . length === 1 && questions ( ) [ 0 ] ?. multiple !== true )
2121 const tabs = createMemo ( ( ) => ( single ( ) ? 1 : questions ( ) . length + 1 ) ) // questions + confirm tab (no confirm for single select)
22+ const [ tabHover , setTabHover ] = createSignal < number | "confirm" | null > ( null )
2223 const [ store , setStore ] = createStore ( {
2324 tab : 0 ,
2425 answers : [ ] as QuestionAnswer [ ] ,
@@ -269,7 +270,15 @@ export function QuestionPrompt(props: { request: QuestionRequest }) {
269270 < box
270271 paddingLeft = { 1 }
271272 paddingRight = { 1 }
272- backgroundColor = { isActive ( ) ? theme . accent : theme . backgroundElement }
273+ backgroundColor = {
274+ isActive ( )
275+ ? theme . accent
276+ : tabHover ( ) === index ( )
277+ ? theme . backgroundElement
278+ : theme . backgroundPanel
279+ }
280+ onMouseOver = { ( ) => setTabHover ( index ( ) ) }
281+ onMouseOut = { ( ) => setTabHover ( null ) }
273282 onMouseUp = { ( ) => selectTab ( index ( ) ) }
274283 >
275284 < text
@@ -290,7 +299,11 @@ export function QuestionPrompt(props: { request: QuestionRequest }) {
290299 < box
291300 paddingLeft = { 1 }
292301 paddingRight = { 1 }
293- backgroundColor = { confirm ( ) ? theme . accent : theme . backgroundElement }
302+ backgroundColor = {
303+ confirm ( ) ? theme . accent : tabHover ( ) === "confirm" ? theme . backgroundElement : theme . backgroundPanel
304+ }
305+ onMouseOver = { ( ) => setTabHover ( "confirm" ) }
306+ onMouseOut = { ( ) => setTabHover ( null ) }
294307 onMouseUp = { ( ) => selectTab ( questions ( ) . length ) }
295308 >
296309 < text fg = { confirm ( ) ? selectedForeground ( theme , theme . accent ) : theme . textMuted } > Confirm</ text >
0 commit comments