Introduce system defaults (vs system overrides) (#6724)

This commit is contained in:
Billy Biggs
2025-08-24 21:21:22 -07:00
committed by GitHub
parent 1918f4466b
commit 04953d60c1
9 changed files with 241 additions and 26 deletions

View File

@@ -287,6 +287,10 @@ describe('App UI', () => {
path: '/system/settings.json',
settings: settings.system || {},
};
const systemDefaultsFile: SettingsFile = {
path: '/system/system-defaults.json',
settings: {},
};
const userSettingsFile: SettingsFile = {
path: '/user/settings.json',
settings: settings.user || {},
@@ -297,6 +301,7 @@ describe('App UI', () => {
};
return new LoadedSettings(
systemSettingsFile,
systemDefaultsFile,
userSettingsFile,
workspaceSettingsFile,
[],

View File

@@ -34,6 +34,10 @@ describe('AuthDialog', () => {
settings: { customThemes: {}, mcpServers: {} },
path: '',
},
{
settings: {},
path: '',
},
{
settings: {
selectedAuthType: AuthType.USE_GEMINI,
@@ -74,6 +78,10 @@ describe('AuthDialog', () => {
},
path: '',
},
{
settings: {},
path: '',
},
{
settings: { customThemes: {}, mcpServers: {} },
path: '',
@@ -108,6 +116,10 @@ describe('AuthDialog', () => {
},
path: '',
},
{
settings: {},
path: '',
},
{
settings: { customThemes: {}, mcpServers: {} },
path: '',
@@ -142,6 +154,10 @@ describe('AuthDialog', () => {
},
path: '',
},
{
settings: {},
path: '',
},
{
settings: { customThemes: {}, mcpServers: {} },
path: '',
@@ -177,6 +193,10 @@ describe('AuthDialog', () => {
},
path: '',
},
{
settings: {},
path: '',
},
{
settings: { customThemes: {}, mcpServers: {} },
path: '',
@@ -207,6 +227,10 @@ describe('AuthDialog', () => {
},
path: '',
},
{
settings: {},
path: '',
},
{
settings: { customThemes: {}, mcpServers: {} },
path: '',
@@ -239,6 +263,10 @@ describe('AuthDialog', () => {
},
path: '',
},
{
settings: {},
path: '',
},
{
settings: { customThemes: {}, mcpServers: {} },
path: '',
@@ -271,6 +299,10 @@ describe('AuthDialog', () => {
settings: { customThemes: {}, mcpServers: {} },
path: '',
},
{
settings: {},
path: '',
},
{
settings: {
selectedAuthType: undefined,
@@ -311,6 +343,10 @@ describe('AuthDialog', () => {
settings: { customThemes: {}, mcpServers: {} },
path: '',
},
{
settings: {},
path: '',
},
{
settings: {
selectedAuthType: undefined,
@@ -354,6 +390,10 @@ describe('AuthDialog', () => {
settings: { customThemes: {}, mcpServers: {} },
path: '',
},
{
settings: {},
path: '',
},
{
settings: {
selectedAuthType: AuthType.USE_GEMINI,

View File

@@ -43,6 +43,10 @@ const createMockSettings = (
settings: { customThemes: {}, mcpServers: {}, ...systemSettings },
path: '/system/settings.json',
},
{
settings: {},
path: '/system/system-defaults.json',
},
{
settings: {
customThemes: {},
@@ -155,6 +159,10 @@ describe('SettingsDialog', () => {
settings: { customThemes: {}, mcpServers: {}, ...systemSettings },
path: '/system/settings.json',
},
{
settings: {},
path: '/system/system-defaults.json',
},
{
settings: {
customThemes: {},

View File

@@ -22,6 +22,7 @@ describe('<MarkdownDisplay />', () => {
{ path: '', settings: {} },
{ path: '', settings: {} },
{ path: '', settings: {} },
{ path: '', settings: {} },
[],
true,
);
@@ -221,6 +222,7 @@ Another paragraph.
it('hides line numbers in code blocks when showLineNumbers is false', () => {
const text = '```javascript\nconst x = 1;\n```'.replace(/\n/g, EOL);
const settings = new LoadedSettings(
{ path: '', settings: {} },
{ path: '', settings: {} },
{ path: '', settings: { showLineNumbers: false } },
{ path: '', settings: {} },