Skip to content

refactor(cli): categorize built-in themes into dark/ and light/ directories#18634

Merged
jacob314 merged 24 commits intogoogle-gemini:mainfrom
JayadityaGit:refactor/reorganize-cli-themes
Mar 5, 2026
Merged

refactor(cli): categorize built-in themes into dark/ and light/ directories#18634
jacob314 merged 24 commits intogoogle-gemini:mainfrom
JayadityaGit:refactor/reorganize-cli-themes

Conversation

@JayadityaGit
Copy link
Contributor

Summary

Reorganize the built-in CLI themes into a clearer, categorized directory structure by separating dark and light themes into dedicated folders. This improves maintainability, discoverability, and overall codebase organization.

Details

  • Moved all dark theme files to:
    packages/cli/src/ui/themes/builtin/dark/

  • Moved all light theme files to:
    packages/cli/src/ui/themes/builtin/light/

  • Updated all affected import paths across the CLI package, including:

    • settings
    • hooks
    • theme manager
  • Updated useTerminalTheme.test.tsx:

    • Adjusted imports to match the new directory structure
    • Updated theme name casing to align with the current implementation
  • Performed a clean build and verified that theme switching works correctly after the refactor

Impact

  • No functional changes to theme behavior
  • Improves logical grouping of themes by type (dark vs light)
  • Makes future theme additions more structured and predictable

Related Issues

#18633

@JayadityaGit JayadityaGit requested a review from a team as a code owner February 9, 2026 15:55
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @JayadityaGit, 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 focuses on improving the maintainability and organization of the CLI's built-in themes. By categorizing themes into distinct 'dark' and 'light' directories, the codebase becomes more structured and future theme additions will be more predictable. The changes are purely structural, with no impact on the existing theme behavior or functionality.

Highlights

  • Theme Reorganization: Built-in CLI themes have been reorganized into a clearer directory structure, separating dark and light themes into dedicated dark/ and light/ subdirectories within packages/cli/src/ui/themes/builtin/.
  • Import Path Updates: All affected import paths across the CLI package, including settings, hooks, and the theme manager, have been updated to reflect the new directory structure.
  • Test File Adjustments: The useTerminalTheme.test.tsx file has been updated to align with the new directory structure and theme name casing, ensuring tests remain valid.
  • Functional Verification: A clean build was performed, and theme switching functionality was verified to work correctly after the refactor, confirming no functional regressions.
Changelog
  • packages/cli/src/config/settings.ts
    • Updated import paths for DefaultLight and DefaultDark to reflect their new locations under builtin/light/ and builtin/dark/ respectively.
  • packages/cli/src/ui/hooks/useSnowfall.ts
    • Updated the import path for the Holiday theme to its new location under builtin/dark/.
  • packages/cli/src/ui/hooks/useTerminalTheme.test.tsx
    • Adjusted isDefaultTheme logic and DEFAULT_THEME name to use 'Default' and 'Default Light' casing.
    • Updated the mock import path for DefaultLight to its new builtin/light/ location.
    • Modified theme names in test assertions from lowercase ('default', 'default-light') to title case ('Default', 'Default Light').
  • packages/cli/src/ui/hooks/useTerminalTheme.ts
    • Updated the import path for DefaultLight to its new location under builtin/light/.
  • packages/cli/src/ui/themes/ansi-light.ts
    • Renamed to packages/cli/src/ui/themes/builtin/light/ansi-light.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/ansi.ts
    • Renamed to packages/cli/src/ui/themes/builtin/dark/ansi.ts.
    • Updated relative import paths within the file to correctly reference theme.js and semantic-tokens.js.
  • packages/cli/src/ui/themes/atom-one-dark.ts
    • Renamed to packages/cli/src/ui/themes/builtin/dark/atom-one-dark.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/ayu-light.ts
    • Renamed to packages/cli/src/ui/themes/builtin/light/ayu-light.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/ayu.ts
    • Renamed to packages/cli/src/ui/themes/builtin/dark/ayu.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/default-light.ts
    • Renamed to packages/cli/src/ui/themes/builtin/light/default-light.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/default.ts
    • Renamed to packages/cli/src/ui/themes/builtin/dark/default.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/dracula.ts
    • Renamed to packages/cli/src/ui/themes/builtin/dark/dracula.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/github-dark.ts
    • Renamed to packages/cli/src/ui/themes/builtin/dark/github-dark.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/github-light.ts
    • Renamed to packages/cli/src/ui/themes/builtin/light/github-light.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/googlecode.ts
    • Renamed to packages/cli/src/ui/themes/builtin/light/googlecode.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/holiday.ts
    • Renamed to packages/cli/src/ui/themes/builtin/dark/holiday.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/no-color.ts
    • Renamed to packages/cli/src/ui/themes/builtin/dark/no-color.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/shades-of-purple.ts
    • Renamed to packages/cli/src/ui/themes/builtin/dark/shades-of-purple.ts.
    • Updated relative import paths within the file.
  • packages/cli/src/ui/themes/theme-manager.ts
    • Updated all theme import statements to reflect the new builtin/dark and builtin/light subdirectories for their respective themes.
  • packages/cli/src/ui/themes/xcode.ts
    • Renamed to packages/cli/src/ui/themes/builtin/light/xcode.ts.
    • Updated relative import paths within the file.
Activity
  • No human activity (comments, reviews) has been recorded on this pull request yet.
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.

Copy link
Contributor

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

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 refactors the theme files by organizing them into dark/ and light/ subdirectories, which improves the project structure. While this is a good change, I've found a critical issue: the renaming of default themes from lowercase to capitalized strings (e.g., 'default' to 'Default') is a breaking change for users with existing settings. My review includes a comment detailing this issue and recommends a solution to ensure backward compatibility. Apart from this, the file moves and import path updates are correctly implemented.

Comment on lines +53 to +54
isDefaultTheme: (name: string) =>
name === 'default' || name === 'default-light',
name === 'Default' || name === 'Default Light',
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

Changing the default theme names from lowercase ('default', 'default-light') to capitalized ('Default', 'Default Light') is a breaking change for users who have the old names in their settings.json. Without a migration path, their configured theme will no longer be found, and the CLI will fall back to the default dark theme. This contradicts the PR's goal of being a pure refactor with "No functional changes to theme behavior".

To ensure backward compatibility, please add a migration for these legacy theme names. One approach is to handle this in packages/cli/src/config/settings.ts during settings load, similar to how 'VS' and 'VS2015' are handled:

// In packages/cli/src/config/settings.ts, inside loadSettings()

// ...
// Support legacy theme names
if (userSettings.ui?.theme === 'VS' || userSettings.ui?.theme === 'default-light') {
  userSettings.ui.theme = DefaultLight.name;
} else if (userSettings.ui?.theme === 'VS2015' || userSettings.ui?.theme === 'default') {
  userSettings.ui.theme = DefaultDark.name;
}
// ... and similarly for workspaceSettings

Since the relevant lines in settings.ts are not part of this diff, I cannot add a direct code suggestion there. Please apply this fix to maintain user configuration.

@JayadityaGit
Copy link
Contributor Author

when i was navigating the themes folder, I thought it was necessary to separate the main logic and the built in themes for better maintainability !

@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality priority/p3 Backlog - a good idea but not currently a priority. labels Feb 9, 2026
…solve conflicts in theme-manager.ts and useTerminalTheme.test.tsx
@JayadityaGit
Copy link
Contributor Author

At present this branch has conflicts , i dont know if the maintainers are interested in this change..

if the community show interest, I will resolve the conflicts

@jacob314 (tagging for visibility)

Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@JayadityaGit
Copy link
Contributor Author

Thanks for the review @jacob314 !

@JayadityaGit
Copy link
Contributor Author

please check on the build and running the application (just in case)

thank you !

@JayadityaGit
Copy link
Contributor Author

meme

made a meme just for fun.

just sending for small reminder, thanks for the time !

@JayadityaGit
Copy link
Contributor Author

The sheer quantity of the PR's i am seeing is astonishing, thanks for reviewing the community PR's @jacob314 and the whole team...

well I can just wait in this moment. my PR is so small compared to rest of community, no wonder it is p3 priority.

thanks again !

@JayadityaGit
Copy link
Contributor Author

JayadityaGit commented Feb 25, 2026

will resolve the conflicts soon !

please let me know if i missed something !

@JayadityaGit
Copy link
Contributor Author

/gemini review

Copy link
Contributor

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

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 reorganizes the built-in themes into dark and light categories, which significantly improves the project structure and maintainability. The changes are well-executed, with all import paths correctly updated across the codebase. I have one suggestion regarding the categorization of the NoColorTheme to further enhance the logical grouping.

import { NoColorTheme } from './no-color.js';
import { ANSI } from './builtin/dark/ansi.js';
import { ANSILight } from './builtin/light/ansi-light.js';
import { NoColorTheme } from './builtin/dark/no-color.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The NoColorTheme is being categorized as a 'dark' theme by placing it in the builtin/dark/ directory. While this might be a fallback for dark themes, a "no color" theme is conceptually neutral, neither dark nor light. Placing it in the dark directory could be misleading for future maintenance.

To better reflect its neutral nature, consider moving no-color.ts to the root of the builtin directory (e.g., packages/cli/src/ui/themes/builtin/no-color.ts).

Suggested change
import { NoColorTheme } from './builtin/dark/no-color.js';
import { NoColorTheme } from './builtin/no-color.js';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

eagle eyed ! Bravo

- Moved no-color.ts to the root of the builtin/ directory.
- Renamed light and dark themes to append '-light.ts' and '-dark.ts' to
  ensure consistency.
- Updated import statements in theme-manager.ts and affected components.
- Bumped copyright headers to 2026 for all modified theme files.
@JayadityaGit
Copy link
Contributor Author

Previously, some theme files followed a consistent naming convention (e.g., including -light or -dark), while others did not. For example, a light theme file such as solarized.ts did not explicitly indicate that it was a light variant.

To improve clarity and maintain consistency, I renamed such files to explicitly include their variant in the filename (e.g., solarized-light.ts). The same convention has been applied to all dark theme files as well.

Now:

All light theme files end with -light

All dark theme files end with -dark

This ensures a consistent naming pattern across the codebase and helps future contributors avoid the confusion I initially experienced when navigating and extending the theme system.

@JayadityaGit
Copy link
Contributor Author

Also updated copyright to 2026, i only updated the files i touched !

@JayadityaGit
Copy link
Contributor Author

/gemini review

Copy link
Contributor

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

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 is a well-executed refactoring that reorganizes the built-in CLI themes into dark and light directories. All file moves and import path updates are consistent with the new structure, improving the codebase's organization and maintainability. I have reviewed the changes and found no issues.

@JayadityaGit
Copy link
Contributor Author

The more i contribute here , the more i realize the importance of Human eyes and constant questioning one's own sanity !

@JayadityaGit
Copy link
Contributor Author

/gemini review

Copy link
Contributor

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

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 is a refactoring that reorganizes the built-in CLI themes into dark/ and light/ subdirectories, which improves the project's structure and maintainability. The changes are consistent across the codebase, with all relevant import paths updated to reflect the new file locations. The refactoring appears to be complete and correct, with no functional changes introduced.

Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@jacob314 jacob314 enabled auto-merge March 5, 2026 09:06
@jacob314 jacob314 added this pull request to the merge queue Mar 5, 2026
Merged via the queue into google-gemini:main with commit 013d5df Mar 5, 2026
27 checks passed
@JayadityaGit JayadityaGit deleted the refactor/reorganize-cli-themes branch March 5, 2026 10:08
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 priority/p3 Backlog - a good idea but not currently a priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants