Skip to content

fix: white-on-white text in light terminal themes#640

Merged
anandgupta42 merged 3 commits intomainfrom
fix/light-theme-white-text
Apr 4, 2026
Merged

fix: white-on-white text in light terminal themes#640
anandgupta42 merged 3 commits intomainfrom
fix/light-theme-white-text

Conversation

@anandgupta42
Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes invisible (white-on-white) text when using light terminal themes with the experimental markdown renderer. Two root causes:

  1. The <markdown> element was missing fg={theme.text}, falling back to OpenTUI's hardcoded white default (RGBA(1,1,1,1))
  2. The markup.raw / markup.raw.block syntax scopes lacked a background property, so fenced code blocks had no contrast on light backgrounds

This is a well-known upstream issue (anomalyco/opencode#17323, #17935, #18353) with no merged fix.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Issue for this PR

Closes #617

How did you verify your code works?

  • Added 30 E2E tests across 3 light themes (GitHub, Solarized, Flexoki) verifying:
    • markup.raw scope has background set
    • Default foreground is never white on light backgrounds
    • All syntax foregrounds have WCAG-derived contrast ratios
    • Dark mode regression checks
  • bun run typecheck passes with 0 errors
  • bun run build:local succeeds
  • Full test suite: 6759 pass, 0 fail across 7240 tests

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes
  • I have added tests that prove my fix is effective

Multi-model code review: Reviewed by 6 models (Claude, GPT 5.2 Codex, Gemini 3.1 Pro, Kimi K2.5, MiniMax M2.5, GLM-5). Convergence: 1 round. fg type issue caught during convergence and fixed with @ts-expect-error.

🤖 Generated with Claude Code

Two upstream bugs caused invisible text on light terminal backgrounds:

1. The experimental `<markdown>` element was missing `fg={theme.text}`,
   falling back to OpenTUI's hardcoded white default (`RGBA(1,1,1,1)`)
2. The `markup.raw` / `markup.raw.block` syntax scopes lacked a
   `background` property, so fenced code blocks had no contrast

Fixes:
- Add `fg={theme.text}` to the `<markdown>` element (matching all
  sibling `<code>` elements)
- Add `background: theme.backgroundElement` to `markup.raw` scope
- Add 30 E2E tests verifying light theme contrast across 3 themes

Related upstream: anomalyco/opencode#17323, #17935, #18353

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

Warning

Rate limit exceeded

@anandgupta42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 48 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 15 minutes and 48 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2e054cb1-bf77-4f4f-951e-2a81a43ce8e2

📥 Commits

Reviewing files that changed from the base of the PR and between 0d34855 and 67a5c34.

📒 Files selected for processing (3)
  • packages/opencode/src/cli/cmd/tui/context/theme.tsx
  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
  • packages/opencode/test/cli/tui/theme-light-mode.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/light-theme-white-text

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

anandgupta42 and others added 2 commits April 4, 2026 08:51
…background distinction

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@anandgupta42 anandgupta42 merged commit dd0c323 into main Apr 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Asking the model to do a suggestion for rewrite of code during review returns white lines of code while terminal background is white

1 participant