feat(ui): standardize focus/selection color and integrate visualizer into theme dialog

This commit is contained in:
Keith Guerin
2026-02-28 22:46:24 -08:00
parent 7e7e775dcc
commit 4e812232a8
13 changed files with 26 additions and 14 deletions
@@ -38,6 +38,7 @@ describe('ColorsDisplay', () => {
comment: '#666666',
symbol: '#cccccc',
dark: '#333333',
focus: '#0000ff',
gradient: undefined,
},
status: {
@@ -108,6 +108,7 @@ describe('<Header />', () => {
comment: '',
symbol: '',
dark: '',
focus: '',
gradient: undefined,
},
status: {
@@ -7,6 +7,7 @@
import type React from 'react';
import { useState, useCallback, useMemo, useEffect, useRef } from 'react';
import { Box, Text } from 'ink';
import { theme } from '../semantic-colors.js';
import { Colors } from '../colors.js';
import { useTerminalSize } from '../hooks/useTerminalSize.js';
import { useKeypress } from '../hooks/useKeypress.js';
@@ -436,7 +437,7 @@ const SessionItem = ({
if (isDisabled) {
return Colors.Gray;
}
return isActive ? Colors.AccentPurple : c;
return isActive ? theme.ui.focus : c;
};
const prefix = isActive ? ' ' : ' ';
@@ -84,7 +84,7 @@ export function SuggestionsDisplay({
const originalIndex = startIndex + index;
const isActive = originalIndex === activeIndex;
const isExpanded = originalIndex === expandedIndex;
const textColor = isActive ? theme.text.accent : theme.text.secondary;
const textColor = isActive ? theme.ui.focus : theme.text.secondary;
const isLong = suggestion.value.length >= MAX_WIDTH;
const labelElement = (
<ExpandableText
@@ -47,6 +47,7 @@ exports[`Initial Theme Selection > should default to a dark theme when terminal
│ │ #6C7086 ui.comment │ │
│ │ #89DCEB ui.symbol │ │
│ │ #3d3f51 ui.dark │ │
│ │ #89B4FA ui.focus │ │
│ │ #F38BA8 status.error │ │
│ │ #A6E3A1 status.success │ │
│ │ #F9E2AF status.warning │ │
@@ -108,6 +109,7 @@ exports[`Initial Theme Selection > should default to a light theme when terminal
│ │ #97a0b0 ui.comment │ │
│ │ #06B6D4 ui.symbol │ │
│ │ #d2d6dc ui.dark │ │
│ │ #3B82F6 ui.focus │ │
│ │ #DD4C4C status.error │ │
│ │ #3CA84B status.success │ │
│ │ #D5A40A status.warning │ │
@@ -169,6 +171,7 @@ exports[`Initial Theme Selection > should use the theme from settings even if te
│ │ #6C7086 ui.comment │ │
│ │ #89DCEB ui.symbol │ │
│ │ #3d3f51 ui.dark │ │
│ │ #89B4FA ui.focus │ │
│ │ #F38BA8 status.error │ │
│ │ #A6E3A1 status.success │ │
│ │ #F9E2AF status.warning │ │
@@ -244,6 +247,7 @@ exports[`ThemeDialog Snapshots > should render correctly in theme selection mode
│ │ #6C7086 ui.comment │ │
│ │ #6C7086 ui.symbol │ │
│ │ #3d3f51 ui.dark │ │
│ │ #89B4FA ui.focus │ │
│ │ #F38BA8 status.error │ │
│ │ #A6E3A1 status.success │ │
│ │ #F9E2AF status.warning │ │
@@ -117,8 +117,8 @@ export function BaseSelectionList<
let numberColor = theme.text.primary;
if (isSelected) {
titleColor = theme.status.success;
numberColor = theme.status.success;
titleColor = theme.ui.focus;
numberColor = theme.ui.focus;
} else if (item.disabled) {
titleColor = theme.text.secondary;
numberColor = theme.text.secondary;
@@ -141,7 +141,7 @@ export function BaseSelectionList<
{/* Radio button indicator */}
<Box minWidth={2} flexShrink={0}>
<Text
color={isSelected ? theme.status.success : theme.text.primary}
color={isSelected ? theme.ui.focus : theme.text.primary}
aria-hidden
>
{isSelected ? '●' : ' '}
@@ -517,9 +517,7 @@ export function BaseSettingsDialog({
<Box marginX={1} flexDirection="row" alignItems="flex-start">
<Box minWidth={2} flexShrink={0}>
<Text
color={
isActive ? theme.status.success : theme.text.secondary
}
color={isActive ? theme.ui.focus : theme.text.secondary}
>
{isActive ? '●' : ''}
</Text>
@@ -536,9 +534,7 @@ export function BaseSettingsDialog({
minWidth={0}
>
<Text
color={
isActive ? theme.status.success : theme.text.primary
}
color={isActive ? theme.ui.focus : theme.text.primary}
>
{item.label}
{item.scopeMessage && (
@@ -557,7 +553,7 @@ export function BaseSettingsDialog({
<Text
color={
isActive
? theme.status.success
? theme.ui.focus
: item.isGreyedOut
? theme.text.secondary
: theme.text.primary