diff options
Diffstat (limited to 'packages/cli/src/ui/components')
| -rw-r--r-- | packages/cli/src/ui/components/AuthDialog.test.tsx | 14 | ||||
| -rw-r--r-- | packages/cli/src/ui/components/ThemeDialog.tsx | 20 |
2 files changed, 27 insertions, 7 deletions
diff --git a/packages/cli/src/ui/components/AuthDialog.test.tsx b/packages/cli/src/ui/components/AuthDialog.test.tsx index 60a8a930..d9f1bd2c 100644 --- a/packages/cli/src/ui/components/AuthDialog.test.tsx +++ b/packages/cli/src/ui/components/AuthDialog.test.tsx @@ -30,6 +30,10 @@ describe('AuthDialog', () => { const settings: LoadedSettings = new LoadedSettings( { + settings: {}, + path: '', + }, + { settings: { selectedAuthType: AuthType.USE_GEMINI, }, @@ -87,6 +91,12 @@ describe('AuthDialog', () => { path: '', }, { + settings: { + selectedAuthType: undefined, + }, + path: '', + }, + { settings: {}, path: '', }, @@ -148,6 +158,10 @@ describe('AuthDialog', () => { const onSelect = vi.fn(); const settings: LoadedSettings = new LoadedSettings( { + settings: {}, + path: '', + }, + { settings: { selectedAuthType: AuthType.USE_GEMINI, }, diff --git a/packages/cli/src/ui/components/ThemeDialog.tsx b/packages/cli/src/ui/components/ThemeDialog.tsx index 9351d5a1..ba49f8e3 100644 --- a/packages/cli/src/ui/components/ThemeDialog.tsx +++ b/packages/cli/src/ui/components/ThemeDialog.tsx @@ -57,6 +57,7 @@ export function ThemeDialog({ const scopeItems = [ { label: 'User Settings', value: SettingScope.User }, { label: 'Workspace Settings', value: SettingScope.Workspace }, + { label: 'System Settings', value: SettingScope.System }, ]; const handleThemeSelect = (themeName: string) => { @@ -86,16 +87,21 @@ export function ThemeDialog({ } }); + const otherScopes = Object.values(SettingScope).filter( + (scope) => scope !== selectedScope, + ); + + const modifiedInOtherScopes = otherScopes.filter( + (scope) => settings.forScope(scope).settings.theme !== undefined, + ); + let otherScopeModifiedMessage = ''; - const otherScope = - selectedScope === SettingScope.User - ? SettingScope.Workspace - : SettingScope.User; - if (settings.forScope(otherScope).settings.theme !== undefined) { + if (modifiedInOtherScopes.length > 0) { + const modifiedScopesStr = modifiedInOtherScopes.join(', '); otherScopeModifiedMessage = settings.forScope(selectedScope).settings.theme !== undefined - ? `(Also modified in ${otherScope})` - : `(Modified in ${otherScope})`; + ? `(Also modified in ${modifiedScopesStr})` + : `(Modified in ${modifiedScopesStr})`; } // Constants for calculating preview pane layout. |
