Skip to content

fix(tui): unreadable emphasized text on light themes#3530

Merged
Sayt-0 merged 1 commit into
mainfrom
fix/tui-light-theme-contrast
Jul 8, 2026
Merged

fix(tui): unreadable emphasized text on light themes#3530
Sayt-0 merged 1 commit into
mainfrom
fix/tui-light-theme-contrast

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Key hints such as "Esc to interrupt" were invisible on light themes: emphasized styles used styles.White, which maps to the theme's selected_fg (pure white in default-light). That color is meant for text on the blue selection background, not for text drawn directly on the app background.

Cause White = selected_fg (#FFFFFF in light) used as foreground on the app background (#FAFAFA), contrast ratio ~1.02
Fix Expose the theme's existing text_bright color as styles.TextBright (#0F1420 light / #E5F2FC dark) and use it for on-background emphasis
Dark theme impact None visible: #E5F2FC is nearly identical to the previous white

Affected styles

Style Visible as
HighlightWhiteStyle "Esc to interrupt", "/pause to resume", statusbar keys, dialog help keys, tour, customize dialog, working dir picker tabs
PaletteCategoryStyle command palette category headers
ThumbActiveStyle active scrollbar thumb
ResizeHandleActiveStyle sidebar resize handle
selection in elicitation.go Yes/No and enum options in MCP elicitation dialogs

Styles rendering on the blue selection background (PaletteSelected*, CompletionSelected*) keep White, which is correct there.

Testing

  • New TestEmphasisStylesReadableOnLightTheme applies default-light and asserts WCAG contrast >= 4.5 for each emphasized style against the background it renders on (fails at ~1.02 before the fix).
  • go build ./..., golangci-lint run and go test ./pkg/tui/... pass. The only go test ./... failures (pkg/tools/builtin/fetch, pkg/tools/builtin/openapi) are network-dependent and pre-exist on main.

White maps to the theme's selected_fg (pure white in light themes) and is
meant for text on the selection background. Key hints like "Esc to
interrupt", palette categories, the active scrollbar thumb and resize
handle used it directly on the app background, making them invisible on
light themes. Expose text_bright as styles.TextBright and use it for
these styles, with a contrast regression test on the light theme.
@Sayt-0
Sayt-0 requested a review from a team as a code owner July 8, 2026 11:13
@Sayt-0
Sayt-0 merged commit aa4e89c into main Jul 8, 2026
14 checks passed
@Sayt-0
Sayt-0 deleted the fix/tui-light-theme-contrast branch July 8, 2026 11:18
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.

2 participants