mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-16 21:10:40 -07:00
fix(cli): add missing custom theme properties to settings schema
- Add 'text.response', 'ui.active', and 'ui.focus' to CustomTheme schema. - Synchronize 'CustomTheme' interface in core with schema by adding 'border.focused'. - Add validation tests for the new properties. Fixes https://github.com/google-gemini/gemini-cli/issues/25689
This commit is contained in:
@@ -273,6 +273,36 @@ describe('settings-validation', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should validate complex nested customThemes configuration', () => {
|
it('should validate complex nested customThemes configuration', () => {
|
||||||
|
const validSettings = {
|
||||||
|
ui: {
|
||||||
|
customThemes: {
|
||||||
|
'my-theme': {
|
||||||
|
type: 'custom' as const,
|
||||||
|
name: 'My Theme',
|
||||||
|
text: {
|
||||||
|
primary: '#ffffff',
|
||||||
|
secondary: '#cccccc',
|
||||||
|
link: '#0000ff',
|
||||||
|
accent: '#ff00ff',
|
||||||
|
response: '#00ff00',
|
||||||
|
},
|
||||||
|
ui: {
|
||||||
|
comment: '#888888',
|
||||||
|
symbol: '#ffffff',
|
||||||
|
active: '#0000ff',
|
||||||
|
focus: '#00ff00',
|
||||||
|
gradient: ['#000000', '#ffffff'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const result = validateSettings(validSettings);
|
||||||
|
expect(result.success).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should reject invalid customThemes configuration', () => {
|
||||||
const invalidSettings = {
|
const invalidSettings = {
|
||||||
ui: {
|
ui: {
|
||||||
customThemes: {
|
customThemes: {
|
||||||
|
|||||||
@@ -3118,6 +3118,7 @@ export const SETTINGS_SCHEMA_DEFINITIONS: Record<
|
|||||||
secondary: { type: 'string' },
|
secondary: { type: 'string' },
|
||||||
link: { type: 'string' },
|
link: { type: 'string' },
|
||||||
accent: { type: 'string' },
|
accent: { type: 'string' },
|
||||||
|
response: { type: 'string' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
background: {
|
background: {
|
||||||
@@ -3149,6 +3150,8 @@ export const SETTINGS_SCHEMA_DEFINITIONS: Record<
|
|||||||
properties: {
|
properties: {
|
||||||
comment: { type: 'string' },
|
comment: { type: 'string' },
|
||||||
symbol: { type: 'string' },
|
symbol: { type: 'string' },
|
||||||
|
active: { type: 'string' },
|
||||||
|
focus: { type: 'string' },
|
||||||
gradient: {
|
gradient: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
items: { type: 'string' },
|
items: { type: 'string' },
|
||||||
|
|||||||
@@ -309,6 +309,7 @@ export interface CustomTheme {
|
|||||||
};
|
};
|
||||||
border?: {
|
border?: {
|
||||||
default?: string;
|
default?: string;
|
||||||
|
focused?: string;
|
||||||
};
|
};
|
||||||
ui?: {
|
ui?: {
|
||||||
comment?: string;
|
comment?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user