fix(tui): unreadable emphasized text on light themes#3530
Merged
Conversation
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.
dgageot
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key hints such as "Esc to interrupt" were invisible on light themes: emphasized styles used
styles.White, which maps to the theme'sselected_fg(pure white indefault-light). That color is meant for text on the blue selection background, not for text drawn directly on the app background.White=selected_fg(#FFFFFFin light) used as foreground on the app background (#FAFAFA), contrast ratio ~1.02text_brightcolor asstyles.TextBright(#0F1420light /#E5F2FCdark) and use it for on-background emphasis#E5F2FCis nearly identical to the previous whiteAffected styles
HighlightWhiteStylePaletteCategoryStyleThumbActiveStyleResizeHandleActiveStyleelicitation.goStyles rendering on the blue selection background (
PaletteSelected*,CompletionSelected*) keepWhite, which is correct there.Testing
TestEmphasisStylesReadableOnLightThemeappliesdefault-lightand 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 runandgo test ./pkg/tui/...pass. The onlygo test ./...failures (pkg/tools/builtin/fetch,pkg/tools/builtin/openapi) are network-dependent and pre-exist onmain.