Skip to content

UI: standardize "focus" (fka "selection") color across themes - #17372

Closed
keithguerin wants to merge 1 commit into
google-gemini:mainfrom
keithguerin:feat/standardize-selection-color-v2
Closed

UI: standardize "focus" (fka "selection") color across themes#17372
keithguerin wants to merge 1 commit into
google-gemini:mainfrom
keithguerin:feat/standardize-selection-color-v2

Conversation

@keithguerin

@keithguerin keithguerin commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Standardize the selection color in the CLI across all themes and UI components using a new selection semantic token. This decouples selection highlighting from the status.success color.

Details

  • Semantic Tokens: Added selection to the SemanticColors interface and mapped it to AccentGreen in all base themes (light, dark, ANSI).
  • Theme Support: Updated the Theme constructor and createCustomTheme to support the new token, ensuring custom themes can also define their own selection color.
  • UI Components:
    • Updated SuggestionsDisplay (autocomplete menu for / and @) to use the selection token.
    • Updated SettingsDialog to use the selection token for active items.
    • Updated SessionBrowser (session resume menu) to use the selection token.
    • Updated BaseSelectionList (and by extension RadioButtonSelect) to use the selection token.
  • Built-in Themes: Updated DefaultDark and DefaultLight to explicitly pass their semantic color definitions.
  • Tests: Updated Header.test.tsx and no-color.ts mocks to include the new property.

Related Issues

None.

How to Validate

  1. Run npm run build to ensure the project compiles without errors.
  2. Open various menus (/, /settings, /resume) and verify that the selection color is consistent and follows the theme's green accent (or custom selection color if defined).

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run build
      • typecheck

Fixes #18719

@keithguerin
keithguerin requested a review from a team as a code owner January 23, 2026 08:20
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @keithguerin, 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 introduces a significant improvement to the CLI's user interface by standardizing the selection color across all available themes. By consistently applying the AccentGreen token, the change aims to provide a more cohesive and predictable visual experience for users, enhancing usability and aesthetic uniformity throughout the application.

Highlights

  • Standardized Selection Color: The selection color in the CLI has been standardized across all themes to use the AccentGreen semantic token, ensuring visual consistency.
  • SemanticColors Interface Update: The SemanticColors interface now includes a selection property to support the new standardized color.
  • Theme Configuration Updates: The createCustomTheme function and the Theme constructor have been updated to properly handle and apply the new selection semantic color.
  • NoColorTheme and Test File Adjustments: The NoColorTheme and Header.test.tsx files were updated to include the selection property, ensuring comprehensive theme support and test coverage.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request effectively standardizes the selection color across themes by introducing a selection semantic token and mapping it to AccentGreen. The changes are consistently applied across the different theme definitions, the Theme class, and test mocks.

I've left one comment in packages/cli/src/ui/themes/theme.ts regarding a logical redundancy and a potential design improvement in the createCustomTheme function. Addressing this will improve code clarity and maintainability. Overall, this is a good enhancement for theme consistency.

Comment thread packages/cli/src/ui/themes/theme.ts Outdated
comment: customTheme.ui?.comment ?? colors.Comment,
symbol: customTheme.ui?.symbol ?? colors.Gray,
dark: colors.DarkGray,
selection: customTheme.status?.success ?? colors.AccentGreen,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Tying the selection color to status.success for custom themes might be inflexible, as a user may want to configure them independently. A better long-term solution would be to add a selection property to the ui object in the CustomTheme interface for separate customization.

For the current implementation, there is a logical redundancy. The expression customTheme.status?.success ?? colors.AccentGreen is unnecessarily complex because colors.AccentGreen (defined on line 274) is already configured to use customTheme.status?.success as its primary source.

You can simplify this to make the code cleaner and avoid the redundant check.

Suggested change
selection: customTheme.status?.success ?? colors.AccentGreen,
selection: colors.AccentGreen,

@keithguerin
keithguerin force-pushed the feat/standardize-selection-color-v2 branch from 1aa6c77 to 9da4c75 Compare January 23, 2026 08:29
@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Jan 23, 2026
@keithguerin
keithguerin force-pushed the feat/standardize-selection-color-v2 branch 3 times, most recently from f210812 to bcea72a Compare January 23, 2026 17:18
@keithguerin
keithguerin requested a review from a team as a code owner January 23, 2026 17:18
Comment thread packages/cli/package.json Outdated
"@types/shell-quote": "^1.7.5",
"@types/tar": "^6.1.13",
"@types/yargs": "^17.0.32",
"@vitest/coverage-v8": "^3.2.4",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

revert changes to all the package.json files. These are spurious

@jacob314 jacob314 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved once *.json are reverted from the PR and plan.md is reverted.

@keithguerin
keithguerin force-pushed the feat/standardize-selection-color-v2 branch 2 times, most recently from 26a9575 to eb0fe67 Compare January 23, 2026 22:21
@gemini-cli

gemini-cli Bot commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

Hi there! Thank you for your contribution to Gemini CLI.

To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md.

This pull request is being closed because it is not currently linked to an issue. You can easily reopen this PR once you have linked it to an issue.

How to link an issue:
Add a keyword followed by the issue number (e.g., Fixes #123) in the description of your pull request. For more details, see the GitHub Documentation.

Thank you for your understanding and for being a part of our community!

@gemini-cli gemini-cli Bot closed this Jan 24, 2026
@jacob314 jacob314 reopened this Jan 30, 2026
@gemini-cli

gemini-cli Bot commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Hi there! Thank you for your contribution to Gemini CLI.

To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md.

This pull request is being closed because it is not currently linked to an issue. Once you have updated the description of this PR to link an issue (e.g., by adding Fixes #123 or Related to #123), it will be automatically reopened.

How to link an issue:
Add a keyword followed by the issue number (e.g., Fixes #123) in the description of your pull request. For more details on supported keywords and how linking works, please refer to the GitHub Documentation on linking pull requests to issues.

Thank you for your understanding and for being a part of our community!

@gemini-cli gemini-cli Bot closed this Jan 31, 2026
@keithguerin keithguerin reopened this Feb 10, 2026
@keithguerin
keithguerin force-pushed the feat/standardize-selection-color-v2 branch 4 times, most recently from 20b979b to e881211 Compare February 10, 2026 08:14
@gemini-cli gemini-cli Bot added priority/p2 Important but can be addressed in a future release. area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. and removed status/need-issue Pull requests that need to have an associated issue. labels Feb 10, 2026
@keithguerin
keithguerin force-pushed the feat/standardize-selection-color-v2 branch from e881211 to 18c9004 Compare February 10, 2026 08:26
@keithguerin keithguerin changed the title feat(cli): standardize selection color across themes UI: standardize "focus" (fka "selection") color across themes Feb 10, 2026
@keithguerin
keithguerin force-pushed the feat/standardize-selection-color-v2 branch from 9efa855 to 2af88ad Compare February 27, 2026 20:28
@keithguerin

Copy link
Copy Markdown
Contributor Author

Merged into #20489 to consolidate color changes.

@sripasg sripasg added the size/s A small PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. priority/p2 Important but can be addressed in a future release. size/s A small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize selection color across themes and UI components

3 participants