fix: register themes on extension load not start#22148
Conversation
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 addresses a critical issue where custom themes provided by extensions failed to load correctly on application startup, leading to errors and a degraded user experience. By shifting the theme registration process to an earlier stage in the extension loading sequence, themes are now available before the application's configuration is fully initialized. This ensures that users who have selected an extension theme will see it applied correctly and without errors immediately upon launching the application. Highlights
Changelog
Activity
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. 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly addresses an issue where extension themes were not available on startup by registering them earlier in the application lifecycle. The changes are logical and include corresponding tests. I've identified one opportunity to improve maintainability by refactoring duplicated code.
|
Size Change: +603 B (0%) Total Size: 26.5 MB ℹ️ View Unchanged
|
|
/patch preview |
|
🚀 [Step 1/4] Patch workflow(s) waiting for approval! 📋 Details:
⏳ Status: The patch creation workflow has been triggered and is waiting for deployment approval. Please visit the specific workflow links below and approve the runs. 🔗 Track Progress: |
# Conflicts: # packages/cli/src/config/extension-manager.test.ts
|
🚀 [Step 2/4] Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 [Step 3/4] Patch Release Waiting for Approval! 📋 Release Details:
⏳ Status: The patch release has been triggered and is waiting for deployment approval. Please visit the specific workflow run link below and approve the deployment. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ [Step 4/4] Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
Summary
This PR fixes an issue where extension-provided themes could not be used on launch, causing errors when a user had previously selected a custom extension theme in a previous session.
By registering themes earlier in the extension loading lifecycle, we ensure they are available before the application's configuration is fully initialized.
Details
ExtensionManager.loadExtensions()andloadExtension()to register declarativetheme data immediately after extensions are loaded. This decouples theme availability from MCP server initialization in
startExtension().ThemeManager.hasExtensionThemes()to track and prevent redundant theme registrations.Related Issues
How to Validate
npm test -w @google/gemini-cli -- src/config/extension-manager.test.ts src/ui/themes/theme-manager.test.tsPre-Merge Checklist