fix(desktop): improve light theme terminal color contrast#475
fix(desktop): improve light theme terminal color contrast#475
Conversation
Fix invisible text in terminal diffs when using light theme. The previous colors (especially brightWhite: #ffffff) were invisible on the white background. Updated all ANSI colors to darker variants optimized for light background readability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WalkthroughAdds light-theme extended ANSI colors and selectionInactiveBackground, introduces an optional themeType ("dark" | "light") that is threaded through the renderer, trpc router, session and env builders, and exposes COLORFGBG in the terminal environment for light/dark detection. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Path-based instructions (10)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/desktop/src/renderer/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/desktop/src/{main,renderer,preload}/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/desktop/**/*.{ts,tsx}📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
Files:
apps/desktop/src/main/**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/{components,features}/**/[!.]*.tsx📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/{components,features}/**/*.{ts,tsx,test.ts,test.tsx,stories.tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{tsx,css}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/{components,features}/**/*.tsx📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (1)📚 Learning: 2025-12-21T04:39:28.543ZApplied to files:
🧬 Code graph analysis (2)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx (2)
apps/desktop/src/main/lib/terminal/env.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (9)
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. Comment |
Standard ANSI colors are used as backgrounds in diffs, so they need to be light/pastel for dark text readability. Bright colors are used as foreground text, so they should be dark for visibility on white background. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Code diffs use white/brightWhite for text content. On light backgrounds, these must be dark colors for visibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ght theme Claude Code may use 256-color mode (colors 16-255). The grayscale colors (232-255) go from dark to light in standard palette, making light colors invisible on light backgrounds. This inverts the grayscale portion so higher indices are darker, maintaining visibility. Also adds: - selectionForeground for visible selected text - selectionInactiveBackground support in types - extendedAnsi support in theme conversion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude Code and other CLI tools use the COLORFGBG environment variable to detect light/dark terminal mode. This sets: - Light mode: COLORFGBG="0;15" (dark fg on light bg) - Dark mode: COLORFGBG="15;0" (light fg on dark bg) This allows Claude Code to adapt its color output for light terminals, making diffs and other colored output visible. Changes: - Add themeType to terminal session params - Pass theme type from renderer to main process via tRPC - Set COLORFGBG in terminal environment based on theme type 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
brightWhitefrom#ffffffto#1a1a1a- was completely invisible on white backgroundTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Style
New Features
✏️ Tip: You can customize this high-level summary in your review settings.