feat(theme): introduce safe and rich themes with true color support#23719
feat(theme): introduce safe and rich themes with true color support#23719
Conversation
|
Hi @clocky, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the visual experience of the CLI by introducing a dual-theme system. It provides visually richer, Material Design-inspired themes for modern terminals with true color support, while simultaneously refining existing themes to ensure optimal compatibility and readability in 256-color environments. This intelligent adaptation ensures users always experience the best possible interface based on their terminal's capabilities. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Size Change: +2.22 kB (+0.01%) Total Size: 26.3 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request refactors the theme system in the CLI to dynamically select between 'rich' and 'safe' color themes based on the terminal's true color support and whether it's an Apple Terminal. It introduces new richLightTheme and richDarkTheme alongside updated safeLightTheme and safeDarkTheme definitions. A high-severity issue was identified where the hex color value for Gray in safeLightTheme contains trailing whitespace, which is likely a typo and could lead to parsing errors or unexpected behavior.
Note: Security Review is unavailable for this PR.
There was a problem hiding this comment.
Code Review
This pull request introduces dynamic theme selection based on terminal capabilities, distinguishing between 'rich' and 'safe' light/dark themes. The 'rich' themes are designed for true-color compatible terminals, while 'safe' themes provide a more basic color palette for broader compatibility. A review comment suggests optimizing the richDarkTheme by pre-calculating color values that currently use interpolateColor at runtime, to improve performance and maintainability.
Summary
Introduced "rich" themes for terminals with true color support and refined "safe" themes specifically for 256-color terminals. This addresses consistency issues in 256-color mode by providing explicit, high-visibility ANSI 256 color mappings for input backgrounds, message backgrounds, and focus states.
Details
lightThemeanddarkThemewith separatesafeandrichversions.richLightThemeandrichDarkThemewith Material Design 3 inspired color palettes for true color environments.safeLightThemeandsafeDarkThemeto use explicit ANSI 256 color codes (e.g.,#212121for ANSI 235) for maximum compatibility and visual consistency.Related Issues
Fixes #21832
How to Validate
gemini --theme lightorgemini --theme darkin different terminal emulators (e.g., iTerm2, Alacritty, Apple Terminal).export COLORTERM=truecolororunset COLORTERMto simulate different support levels.npm run test -w @google/gemini-cli -- src/ui/themes/theme.test.tspasses.Pre-Merge Checklist