fix: switch new installs to OpenChamber themes

New installs now default to OpenChamber light and dark themes.
Existing Flexoki theme preferences continue to be preserved during migration.
This commit is contained in:
Bohdan Triapitsyn
2026-09-04 12:51:49 +03:00
parent 0d8709a72e
commit 8afec51480
2 changed files with 31 additions and 2 deletions
@@ -692,8 +692,8 @@ export const createSettingsRuntime = (deps) => {
return { settings, changed: false }; return { settings, changed: false };
} }
const defaultLight = 'flexoki-light'; const defaultLight = 'openchamber-light';
const defaultDark = 'flexoki-dark'; const defaultDark = 'openchamber-dark';
let nextLightThemeId = hasLight ? settings.lightThemeId : undefined; let nextLightThemeId = hasLight ? settings.lightThemeId : undefined;
let nextDarkThemeId = hasDark ? settings.darkThemeId : undefined; let nextDarkThemeId = hasDark ? settings.darkThemeId : undefined;
@@ -39,6 +39,35 @@ const createRuntime = async () => {
}; };
describe('settings runtime', () => { describe('settings runtime', () => {
it('uses OpenChamber themes when a new install has no theme preferences', async () => {
const { runtime, cleanup } = await createRuntime();
try {
await expect(runtime.readSettingsFromDiskMigrated()).resolves.toMatchObject({
lightThemeId: 'openchamber-light',
darkThemeId: 'openchamber-dark',
});
} finally {
await cleanup();
}
});
it('preserves existing theme preferences during theme migration', async () => {
const { runtime, settingsFilePath, cleanup } = await createRuntime();
try {
await fsPromises.writeFile(settingsFilePath, JSON.stringify({
lightThemeId: 'flexoki-light',
darkThemeId: 'flexoki-dark',
}), 'utf8');
await expect(runtime.readSettingsFromDiskMigrated()).resolves.toMatchObject({
lightThemeId: 'flexoki-light',
darkThemeId: 'flexoki-dark',
});
} finally {
await cleanup();
}
});
it('round-trips shared sidebar preferences through settings.json', async () => { it('round-trips shared sidebar preferences through settings.json', async () => {
const { runtime, settingsFilePath, cleanup } = await createRuntime(); const { runtime, settingsFilePath, cleanup } = await createRuntime();
const preferences = { const preferences = {