fix: improve text contrast on light terminal backgrounds#712
Open
altimate-harness-bot[bot] wants to merge 5 commits intomainfrom
Open
fix: improve text contrast on light terminal backgrounds#712altimate-harness-bot[bot] wants to merge 5 commits intomainfrom
altimate-harness-bot[bot] wants to merge 5 commits intomainfrom
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
added 2 commits
April 16, 2026 07:39
- Add COLORFGBG env var fallback when OSC 11 detection times out - Use dark foreground (#1a1a1a) instead of palette[7] (#c0c0c0) for light mode system theme - Use backgroundElement for inline code blocks to ensure contrast on transparent backgrounds Closes #704
- Test markup.raw.inline uses backgroundElement (non-transparent) - Test system theme light-mode foreground fallback contrast - Test COLORFGBG env var parsing logic - Update test helper to match production inline code background change
72d8b51 to
d3a4dac
Compare
added 2 commits
April 16, 2026 07:43
Adds tests that reproduce the exact bugs: - BUG test: proves palette[7] (#c0c0c0) has ~1.3:1 contrast on white (invisible) - BUG test: proves old inline code bg was transparent (no contrast) - FIX test: verifies new fg (#1a1a1a) has >=3:1 contrast on white - FIX test: verifies inline code bg is now opaque - FIX test: verifies dark mode is unaffected (still uses palette[7])
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
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
Fixes #704 (follow-up to #617). Code output was rendering as white/light text on light terminal backgrounds, making it unreadable.
Three fixes:
COLORFGBG env var fallback (
app.tsx): When OSC 11 terminal background detection times out (common in many terminal setups), fall back to checking theCOLORFGBGenvironment variable before defaulting to "dark" mode. Many terminals (iTerm2, xterm, etc.) set this to indicate their color scheme.Light-mode foreground fallback (
theme.tsx): WhendefaultForegroundis unavailable and mode is "light", use#1a1a1a(near-black) instead of ANSI palette index 7 (#c0c0c0— light gray), which is invisible on white backgrounds.Inline code background (
theme.tsx): UsebackgroundElementinstead ofbackgroundformarkup.raw.inlinescope.backgroundcan be transparent (especially in the system theme), leaving inline code with no contrast protection. This is consistent with the Asking the model to do a suggestion for rewrite of code during review returns white lines of code while terminal background is white #617 fix already applied tomarkup.raw.block.Test plan
COLORFGBGenv varRequested by @saravmajestic via harness
Summary by cubic
Fixes unreadable code and inline code on light terminal backgrounds by improving detection and safer color fallbacks. Closes #704.
COLORFGBGwhen OSC 11 detection times out to detect light terminals.#1a1a1afor missing foregrounds andbackgroundElementfor inline code (markup.raw.inline) to ensure contrast on transparent themes.COLORFGBGparsing, light-mode foreground contrast, and inline-code background; include regression tests (dark mode unchanged) and update the test helper; addaltimate_changemarkers to patched sections.Written for commit 4d06787. Summary will update on new commits.