Repository navigation
fix(tui): improve body text contrast against Solarized background - #213
Merged
Merged
Conversation
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
mohitranka
added a commit
that referenced
this pull request
Sep 11, 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.
Audit findings
1. Actual Solarized Dark hex values in use (
crates/forge-tui/themes/solarized-dark.toml) — this is the canonical Ethan Schoonover palette, not a customized variant:background = #002B36(base03)text_primary = #839496(base0) — already correct; this istheme::text()/theme::text_primary_color(), used for primary body text app-wide.text_secondary = #657B83(base00),text_muted = #586E75(base01) — these backtheme::muted()/theme::dim(), correctly reserved for de-emphasized metadata (unaffected by this change).accent = #268BD2(Solarized blue),info = #2AA198(Solarized cyan) — the interactive/status hues, used bytheme::accent()/theme::brand()(links, active tab, tool tags) andtheme::info()/theme::tool().tag = #93A1A1— already exactly Solarized base1, currently only used for thetagbadge role.So the default body text color (
theme::text()) was already base0, not blue/cyan — contrary to the generic Solarized-Dark-low-contrast concern, this app's config already applies the higher-contrast tone by default. The actual problem was narrower: one call site reusing the interactive cyan color for body content.2. Call sites where body text shared color with interactive elements — audited every non-test usage of
theme::info()/theme::tool()/theme::accent()/theme::brand()inforge-tui/src:conversation.rs:2076— inline`backtick code`inside assistant/user message prose was styled withtheme::tool()(cyan, same value astheme::info()—toolis literally sourced from theinfopalette field). This is genuine body text (part of the sentence being read), not a link — fixed.file_source()/file_data()(clickable file-tree entries,info/tool),directory()(brand(), clickable), banner/status labels ("running", "waiting for approval", BannerKind::Info callouts — parallel to Warn/Error/Ok, not paragraph prose), dialog/heading titles inoverlays.rsandsource_viewer.rs(brand(), headers not body text, explicitly out of scope).3–4. Fix — added
theme::text_secondary_color()/theme::text_secondary()to the theme module, sourced from the existingtagpalette field (already base1#93A1A1for Solarized Dark) rather than a new hardcoded hex or a new required theme-file field (allThemePalettefields are required with no serde defaults, so adding one would break any custom user theme TOML).text_primary_color()already existed and needed no change. Changed the one flagged call site totheme::text_secondary(). Interactive elements (accent(),info()/tool(),brand()) are untouched and remain visually distinct.5. Contrast ratio (WCAG relative-luminance formula, against
backgroundbase03#002B36):text_secondary(base1,#93A1A1) vs base03 ≈ 5.6:1 — passes AA (≥4.5:1) with margin.text_primary(base0,#839496) vs base03 ≈ 4.75:1 — passes AA, confirmed by a new test (previously untested).Test plan
cargo fmt --all -- --checkcargo test --package forge-tui --lib(716 passed), including new tests:text_secondary_is_solarized_base1_and_distinct_from_interactive_colors,body_text_colors_meet_wcag_aa_against_the_background,inline_code_in_body_text_uses_secondary_body_color_not_interactive_accent.git diff --check