Make Gemini API Key optional for 3P use case#70
Conversation
⚡ A2UI Composer PR PreviewYour automated preview is successfully live:
|
There was a problem hiding this comment.
Code Review
This pull request modifies the application behavior in third-party (3P) environments when the Gemini API key is missing. Instead of blocking startup and forcing a redirect to the settings page, the application now boots successfully but disables the Gemini Assistant chat panel, displaying a notice to add the key. The settings form has been updated to no longer require the API key as a mandatory field in 3P mode. Feedback on these changes suggests using .trim() when checking for an empty API key to handle whitespace-only values robustly, and using a neutral color instead of an error color for the non-blocking warning hint in the settings view to avoid misleading users.
- Modify StartupResolution.isEnvironmentValid to no longer require Gemini API key. - Remove required validator from apiKey control in settings view. - Update settings template to show a hint warning that Gemini Assistant won't be available when API key is empty. - Add computed property to disable chat panel when API key is empty in 3P mode. - Render disabled panel placeholder with a button to add the API key in settings. - Update tests for StartupResolution, Settings and ChatPanel to assert correct behavior. - Fix and add E2E integration tests to reflect optional API key. - Trim Gemini API key in LocalStorageAppConfigProvider on bootstrap and on setGeminiApiKey to prevent whitespace-only bypasses. - Change settings warning-hint color to neutral surface variant. - Update unit tests in local-storage-config.provider.spec.ts to verify whitespace trimming on bootstrap and save. TAG=agy CONV=972319b8-7f8f-47e0-b4a9-3c7422d69fb1
Description
Use of a Gemini API key is now optional. If not provided, the chat panel won't be available, but everything else works.
Pre-launch Checklist