fix(tui): use gray list highlights (#36669)

Co-authored-by: Dax Raad <thdxr@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot] 2026-07-13 10:15:30 -04:00 committed by GitHub
commit 823bc20427
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 21 additions and 24 deletions

View file

@ -13,7 +13,7 @@ import { getScrollAcceleration } from "../../util/scroll"
import { useTuiPaths } from "../../context/runtime" import { useTuiPaths } from "../../context/runtime"
import { useConfig } from "../../config" import { useConfig } from "../../config"
import { useLocation } from "../../context/location" import { useLocation } from "../../context/location"
import { useTheme, selectedForeground } from "../../context/theme" import { useTheme } from "../../context/theme"
import { SplitBorder } from "../../ui/border" import { SplitBorder } from "../../ui/border"
import { useTerminalDimensions } from "@opentui/solid" import { useTerminalDimensions } from "@opentui/solid"
import { Locale } from "../../util/locale" import { Locale } from "../../util/locale"
@ -746,7 +746,7 @@ export function Autocomplete(props: {
<box <box
paddingLeft={1} paddingLeft={1}
paddingRight={1} paddingRight={1}
backgroundColor={index === store.selected ? theme.primary : undefined} backgroundColor={index === store.selected ? theme.backgroundElement : undefined}
flexDirection="row" flexDirection="row"
onMouseMove={() => { onMouseMove={() => {
setStore("input", "mouse") setStore("input", "mouse")
@ -761,11 +761,11 @@ export function Autocomplete(props: {
}} }}
onMouseUp={() => select()} onMouseUp={() => select()}
> >
<text fg={index === store.selected ? selectedForeground(theme) : theme.text} flexShrink={0}> <text fg={theme.text} flexShrink={0}>
{option().display} {option().display}
</text> </text>
<Show when={option().description}> <Show when={option().description}>
<text fg={index === store.selected ? selectedForeground(theme) : theme.textMuted} wrapMode="none"> <text fg={index === store.selected ? theme.text : theme.textMuted} wrapMode="none">
{" " + option().description?.trimStart()} {" " + option().description?.trimStart()}
</text> </text>
</Show> </Show>

View file

@ -82,17 +82,17 @@ export function DiffViewerFileTree(props: DiffViewerFileTreeProps) {
<box <box
flexDirection="row" flexDirection="row"
width="100%" width="100%"
backgroundColor={highlighted() ? props.theme.primary : undefined} backgroundColor={highlighted() ? props.theme.backgroundElement : undefined}
onMouseUp={() => props.onRowClick?.(row)} onMouseUp={() => props.onRowClick?.(row)}
> >
<text fg={highlighted() ? props.theme.background : fadedColor()} wrapMode="none" flexShrink={0}> <text fg={highlighted() ? props.theme.text : fadedColor()} wrapMode="none" flexShrink={0}>
{prefix()} {prefix()}
</text> </text>
<box flexGrow={1} minWidth={0}> <box flexGrow={1} minWidth={0}>
<text <text
fg={ fg={
highlighted() highlighted()
? props.theme.background ? props.theme.text
: selected() : selected()
? props.theme.primary ? props.theme.primary
: reviewed() || row.kind === "directory" : reviewed() || row.kind === "directory"
@ -105,7 +105,7 @@ export function DiffViewerFileTree(props: DiffViewerFileTreeProps) {
</text> </text>
</box> </box>
<text <text
fg={highlighted() ? props.theme.background : props.theme.textMuted} fg={highlighted() ? props.theme.text : props.theme.textMuted}
wrapMode="none" wrapMode="none"
flexShrink={0} flexShrink={0}
> >

View file

@ -1,10 +1,10 @@
import { createMemo, For, Show, createEffect, onMount, onCleanup } from "solid-js" import { createMemo, For, Show, createEffect, onMount, onCleanup } from "solid-js"
import { createStore } from "solid-js/store" import { createStore } from "solid-js/store"
import { TextAttributes, RGBA, ScrollBoxRenderable } from "@opentui/core" import { TextAttributes, ScrollBoxRenderable } from "@opentui/core"
import { useData } from "../../../context/data" import { useData } from "../../../context/data"
import { useLocation } from "../../../context/location" import { useLocation } from "../../../context/location"
import { useSDK } from "../../../context/sdk" import { useSDK } from "../../../context/sdk"
import { useTheme, selectedForeground } from "../../../context/theme" import { useTheme } from "../../../context/theme"
import { useBindings, useCommandShortcut } from "../../../keymap" import { useBindings, useCommandShortcut } from "../../../keymap"
import { useComposerTab } from "./index" import { useComposerTab } from "./index"
@ -13,7 +13,6 @@ export function ShellTab(props: { sessionID: string }) {
const location = useLocation() const location = useLocation()
const sdk = useSDK() const sdk = useSDK()
const { theme } = useTheme() const { theme } = useTheme()
const fg = selectedForeground(theme)
const composer = useComposerTab() const composer = useComposerTab()
const killHint = useCommandShortcut("composer.shell.kill") const killHint = useCommandShortcut("composer.shell.kill")
@ -114,11 +113,11 @@ export function ShellTab(props: { sessionID: string }) {
flexDirection="row" flexDirection="row"
paddingLeft={1} paddingLeft={1}
paddingRight={1} paddingRight={1}
backgroundColor={active() ? theme.primary : RGBA.fromInts(0, 0, 0, 0)} backgroundColor={active() ? theme.backgroundElement : undefined}
onMouseOver={() => setStore("selected", index())} onMouseOver={() => setStore("selected", index())}
> >
<text <text
fg={active() ? fg : theme.text} fg={theme.text}
attributes={active() ? TextAttributes.BOLD : undefined} attributes={active() ? TextAttributes.BOLD : undefined}
wrapMode="none" wrapMode="none"
> >

View file

@ -1,10 +1,10 @@
import { createMemo, For, Show, createEffect, onMount, onCleanup } from "solid-js" import { createMemo, For, Show, createEffect, onMount, onCleanup } from "solid-js"
import { createStore } from "solid-js/store" import { createStore } from "solid-js/store"
import { TextAttributes, RGBA, ScrollBoxRenderable } from "@opentui/core" import { TextAttributes, ScrollBoxRenderable } from "@opentui/core"
import { useRoute, useRouteData } from "../../../context/route" import { useRoute, useRouteData } from "../../../context/route"
import { useData } from "../../../context/data" import { useData } from "../../../context/data"
import { useSDK } from "../../../context/sdk" import { useSDK } from "../../../context/sdk"
import { useTheme, selectedForeground } from "../../../context/theme" import { useTheme } from "../../../context/theme"
import { Locale } from "../../../util/locale" import { Locale } from "../../../util/locale"
import { useBindings, useCommandShortcut } from "../../../keymap" import { useBindings, useCommandShortcut } from "../../../keymap"
import { useComposerTab } from "./index" import { useComposerTab } from "./index"
@ -22,7 +22,6 @@ export function SubagentsTab(props: { sessionID: string }) {
const data = useData() const data = useData()
const sdk = useSDK() const sdk = useSDK()
const { theme } = useTheme() const { theme } = useTheme()
const fg = selectedForeground(theme)
const navigate = useRoute().navigate const navigate = useRoute().navigate
const composer = useComposerTab() const composer = useComposerTab()
const interruptHint = useCommandShortcut("composer.subagent.interrupt") const interruptHint = useCommandShortcut("composer.subagent.interrupt")
@ -215,7 +214,7 @@ export function SubagentsTab(props: { sessionID: string }) {
flexDirection="row" flexDirection="row"
paddingLeft={1} paddingLeft={1}
paddingRight={1} paddingRight={1}
backgroundColor={active() ? theme.primary : RGBA.fromInts(0, 0, 0, 0)} backgroundColor={active() ? theme.backgroundElement : undefined}
onMouseOver={() => setStore("selected", index())} onMouseOver={() => setStore("selected", index())}
onMouseUp={() => { onMouseUp={() => {
setStore("selected", index()) setStore("selected", index())
@ -224,7 +223,7 @@ export function SubagentsTab(props: { sessionID: string }) {
> >
<box flexGrow={1} minWidth={0} flexDirection="row"> <box flexGrow={1} minWidth={0} flexDirection="row">
<text <text
fg={active() ? fg : entry.current ? theme.primary : theme.text} fg={entry.current ? theme.primary : theme.text}
attributes={active() ? TextAttributes.BOLD : undefined} attributes={active() ? TextAttributes.BOLD : undefined}
wrapMode="none" wrapMode="none"
> >
@ -232,7 +231,7 @@ export function SubagentsTab(props: { sessionID: string }) {
</text> </text>
</box> </box>
<Show when={status()}> <Show when={status()}>
<text fg={active() ? fg : theme.textMuted} wrapMode="none"> <text fg={active() ? theme.text : theme.textMuted} wrapMode="none">
{status()} {status()}
</text> </text>
</Show> </Show>

View file

@ -674,7 +674,7 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
active() active()
? actionFocused() ? actionFocused()
? theme.backgroundElement ? theme.backgroundElement
: (option.bg ?? theme.primary) : (option.bg ?? theme.backgroundElement)
: RGBA.fromInts(0, 0, 0, 0) : RGBA.fromInts(0, 0, 0, 0)
} }
> >
@ -749,9 +749,8 @@ function Option(props: {
onMouseOver?: () => void onMouseOver?: () => void
}) { }) {
const { theme } = useTheme() const { theme } = useTheme()
const fg = selectedForeground(theme)
const text = createMemo(() => { const text = createMemo(() => {
if (props.active && !props.muted) return fg if (props.active && !props.muted) return theme.text
if (props.muted && (props.active || props.current)) return theme.textMuted if (props.muted && (props.active || props.current)) return theme.textMuted
if (props.current) return theme.primary if (props.current) return theme.primary
return theme.text return theme.text
@ -784,12 +783,12 @@ function Option(props: {
? Locale.truncateLeft(props.title, props.titleWidth ?? 61) ? Locale.truncateLeft(props.title, props.titleWidth ?? 61)
: Locale.truncate(props.title, props.titleWidth ?? 61))} : Locale.truncate(props.title, props.titleWidth ?? 61))}
<Show when={props.description}> <Show when={props.description}>
<span style={{ fg: props.active && !props.muted ? fg : theme.textMuted }}> {props.description}</span> <span style={{ fg: props.active && !props.muted ? theme.text : theme.textMuted }}> {props.description}</span>
</Show> </Show>
</text> </text>
<Show when={props.footer}> <Show when={props.footer}>
<box flexShrink={0}> <box flexShrink={0}>
<text fg={props.active && !props.muted ? fg : theme.textMuted}>{props.footer}</text> <text fg={props.active && !props.muted ? theme.text : theme.textMuted}>{props.footer}</text>
</box> </box>
</Show> </Show>
</> </>