feat(settings): organize system preferences by category
This commit is contained in:
1 parent
cf0327fcaf
commit
a88a7f550f
16 files changed
+110
-21
No files matched your search
@@ -18,6 +18,8 @@ assert.match(assets.addonsJs, /api\/lifeos-sync/);
|
||||
assert.match(assets.i18nRenderersJs, /dialog\.goals/);
|
||||
assert.match(assets.i18nRenderersJs, /shell\.wallpaperTitle/);
|
||||
assert.match(assets.i18nRenderersJs, /window\.museumApp/);
|
||||
assert.ok(assets.indexHtml.indexOf('window.systemApp = container =>') < assets.indexHtml.indexOf('system-settings-shell'), 'category layout wraps existing settings renderers');
|
||||
for (const group of ['appearance', 'notifications', 'language', 'data', 'about']) assert.match(assets.i18nRenderersJs, new RegExp(`data-settings-group="${group}"`));
|
||||
assert.equal(assets.manifest.includes('"description"'), false);
|
||||
const flatten = (value, prefix = "") => Object.entries(value).flatMap(([key, child]) => child && typeof child === "object" && !Array.isArray(child) ? flatten(child, prefix ? `${prefix}.${key}` : key) : [prefix ? `${prefix}.${key}` : key]).sort();
|
||||
const enKeys = flatten(assets.localeEn), zhKeys = flatten(assets.localeZh);
|
||||
@@ -50,11 +52,11 @@ assert.doesNotMatch(assets.indexHtml, /setTimeout\(applyLanguage\s*,/);
|
||||
assert.doesNotMatch(assets.addonsJs, /(?<![\w.])applyLanguage\s*\(/, "add-on actions must not call a missing global locale function");
|
||||
assert.match(assets.indexHtml, /window\.renderIcons=renderIcons;window\.renderAll=renderAll/, "shared renderers are explicitly exposed to locale scripts");
|
||||
const shippedScripts = [...assets.indexHtml.matchAll(/<script>([\s\S]*?)<\/script>/g)].map(match => match[1]);
|
||||
assert.equal(shippedScripts.length, 17, "the complete desktop script chain is present in the served HTML");
|
||||
assert.equal(shippedScripts.length, 18, "the complete desktop script chain is present in the served HTML");
|
||||
assert.doesNotMatch(assets.indexHtml, /<script\s+src=/, "the desktop cannot silently fall back when an app script fails to load");
|
||||
assert.ok(assets.indexHtml.indexOf('window.systemApp =') < assets.indexHtml.lastIndexOf("window.init()"), "locale renderers run before desktop initialization");
|
||||
for (const script of shippedScripts) new vm.Script(script);
|
||||
for (const script of [assets.i18nJs, assets.dataActionsJs, assets.terminalAppJs, assets.dbAdminJs, assets.tasksJs, assets.calendarJs, assets.notificationsJs, assets.i18nRenderersJs, assets.desktopPersonalizationJs, assets.desktopWidgetsJs, assets.browserAppJs, assets.addonsJs]) new vm.Script(script);
|
||||
for (const script of [assets.i18nJs, assets.dataActionsJs, assets.terminalAppJs, assets.dbAdminJs, assets.tasksJs, assets.calendarJs, assets.notificationsJs, assets.i18nRenderersJs, assets.desktopPersonalizationJs, assets.desktopWidgetsJs, assets.systemNavigationJs, assets.browserAppJs, assets.addonsJs]) new vm.Script(script);
|
||||
const reminderStorage = new Map(), delivered = [];
|
||||
reminderStorage.set('lifeos_notifications_v1', JSON.stringify(Object.fromEntries(['memory', 'tasks', 'goals'].map(kind => [kind, { enabled: true, time: '12:00' }]))));
|
||||
const reminderContext = vm.createContext({
|
||||
@@ -203,7 +205,7 @@ assert.ok(command('date').message.length > 8);
|
||||
assert.ok(command('time').message.includes(':'));
|
||||
assert.ok(command('datetime').message.length > 12);
|
||||
assert.equal(command('uptime').message, 'terminal.uptime');
|
||||
assert.equal(command('version').message, 'Life OS v1.15.0');
|
||||
assert.equal(command('version').message, 'Life OS v1.16.0');
|
||||
assert.equal(command('status').message, 'terminal.status');
|
||||
assert.match(command('apps').message, /calendar/);
|
||||
assert.equal(command('echo "hello Life OS"').message, 'hello Life OS');
|
||||
|
||||
Reference in new issue
Block a user