Skip to content

fix(tui): make the question selection highlight visible in light themes - #153

Merged
quickbeard merged 1 commit into
mainfrom
question-selection-highlight
Aug 2, 2026
Merged

quickbeard merged 1 commit into
mainfrom
question-selection-highlight

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Problem

In the question panel (AskUserQuestion), the selected answer row and the hovered question tab paint theme.backgroundElement over theme.backgroundPanel. In light themes those are adjacent gray steps — #f5f5f5 on #fafafa for codev, a 1.04x contrast ratio — so the selection had no visible highlight at all.

Fix

A highlight memo — tint(theme.backgroundPanel, theme.text, 0.1) — now backs the active option's number/label boxes, the "Type your own answer" row, and the tab hover state. Blending the panel toward the theme's own text color keeps the band neutral and works for any theme, including the terminal-generated system one, instead of hardcoding a darker gray.

Measured highlight-vs-panel contrast, before → after:

theme light dark
codev / opencode 1.04x → 1.22x 1.11x → 1.28x
catppuccin 1.09x → 1.15x 1.07x → 1.26x
everforest 1.05x → 1.13x 1.04x → 1.24x

The selected label text (theme.secondary) still clears 3.9x against the new background on codev.

Notes

  • bun typecheck passes in packages/tui.
  • Verified the color math directly against the theme module; a live question prompt was not driven in the TUI (needs a real model turn to trigger).
  • DIVERGENCES.md gains a row for question.tsx; CHANGELOG.md gains an Unreleased TUI entry.

🤖 Generated with Claude Code

The selected answer row and the hovered question tab painted
theme.backgroundElement over theme.backgroundPanel. In light themes those
are adjacent gray steps (#f5f5f5 on #fafafa for codev, 1.04x contrast), so
the highlight was effectively invisible.

Derive the highlight from the panel blended toward the theme's text color
instead, which keeps a neutral band at ~1.2x in both modes and works for
generated themes too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 139d48d into main Aug 2, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the question-selection-highlight branch August 2, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant