From dc924157066fef130bee70dabdc231e2472dab52 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 12 Oct 2026 19:57:05 -0600 Subject: [PATCH] feat(memories): add quick moments alongside daily summaries --- CHANGELOG.md | 8 +++++ README.md | 4 +-- package.json | 5 +-- public/addons.js | 4 +-- public/backup.js | 2 +- public/calendar.js | 2 +- public/data-actions.js | 11 ++++--- public/i18n-renderers.js | 62 +++++++++++++++++++++++++++++++------ public/index.html | 2 +- public/locales/ar.json | 12 +++++++ public/locales/en.json | 12 +++++++ public/locales/es.json | 12 +++++++ public/locales/fr.json | 12 +++++++ public/locales/ja.json | 12 +++++++ public/locales/ru.json | 12 +++++++ public/locales/zh-CN.json | 12 +++++++ public/locales/zh-HK.json | 12 +++++++ public/locales/zh-MO.json | 12 +++++++ public/locales/zh-TW.json | 12 +++++++ public/notifications.js | 2 +- public/service-worker.js | 2 +- public/system-navigation.js | 2 +- public/terminal-app.js | 8 ++--- scripts/build.mjs | 2 +- scripts/test-cloud.mjs | 9 +++++- scripts/test-moments.mjs | 39 +++++++++++++++++++++++ scripts/validate.mjs | 12 ++++++- 27 files changed, 264 insertions(+), 32 deletions(-) create mode 100644 scripts/test-moments.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c67b51..378b5dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 本项目按 `v主版本.次版本.修订版本` 标记应用版本;按需创建 Git tag。下列内容以对应提交和已发布功能为准。 +## v1.23.0 — 2026-10-13 + +- 新增桌面快速记录入口和今日瞬间列表;同一天可保存多条文字瞬间,支持标题、日期、标签、草稿恢复和后续编辑。 +- 每日总结与瞬间独立保存,旧记忆按每日总结兼容,更新每日总结不会覆盖当天瞬间。 +- 瞬间沿用记忆的时间线、日历、搜索、收藏、SQLite 持久化、记录级云同步和 JSON 备份;合并导入保留同日多条瞬间。 +- 连续记录天数按日期去重;快速记录未填写天气或能量时不纳入相应统计。 +- 增加同日记录共存、旧日记更新、删除隔离、合并幂等性和云端同日记录测试。 + ## v1.22.1 — 2026-10-13 - 修复同步状态观察器重复改写自身 DOM 的刷新循环;同步中心状态变化时实时更新,支持 Esc 关闭。 diff --git a/README.md b/README.md index e9acb5d..e89be54 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ 以桌面操作系统为交互方式的个人记录网站。用 App 记录日常、管理目标与待办,并沿时间线回看已经留下的内容。 -在线站点:[Life OS](https://life-os-personal-desktop.biss0.chatgpt.site) · 当前应用版本:**v1.22.1** · [更新日志](CHANGELOG.md) +在线站点:[Life OS](https://life-os-personal-desktop.biss0.chatgpt.site) · 当前应用版本:**v1.23.0** · [更新日志](CHANGELOG.md) ## 功能 | App | 用途 | | --- | --- | -| 今日 | 为选定日期写记忆,记录天气、1–5 能量、标题、标签、地点和关联任务;每日电影是写作提示,不会替代记忆标题。 | +| 今日 | 为选定日期写每日总结,并查看当日瞬间;快速记录支持一天多条文字、标题和标签,独立于每日总结。总结可记录天气、1–5 能量、地点和关联任务;每日电影是写作提示。 | | 时间线 | 按日期浏览记忆,使用关键词或标签筛选,编辑、删除和收藏。 | | 博物馆 | 回看收藏的记忆。 | | 目标与待办 | 创建和编辑目标、待办,调整日期、优先级、关联目标与完成状态;目标倒计时可选择显示在桌面。 | diff --git a/package.json b/package.json index 24d2361..4f0bf90 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { "name": "life-os", - "version": "1.22.1", + "version": "1.23.0", "private": true, "type": "module", "scripts": { "build": "node scripts/build.mjs", "validate": "node scripts/validate.mjs", "test:cloud": "node scripts/test-cloud.mjs", - "test:reliability": "node scripts/test-reliability.mjs" + "test:reliability": "node scripts/test-reliability.mjs", + "test:moments": "node scripts/test-moments.mjs" }, "dependencies": { "@sqlite.org/sqlite-wasm": "3.53.4-build1" diff --git a/public/addons.js b/public/addons.js index bab13c1..5dd7837 100644 --- a/public/addons.js +++ b/public/addons.js @@ -3,7 +3,7 @@ const DRAFT_KEY = 'lifeos_today_draft_v1'; const localDay = () => { const d = new Date(); return `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')}`; }; const escapeHtml = value => String(value || '').replace(/[&<>"']/g, char => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[char])); - const APP_VERSION = '1.22.1'; + const APP_VERSION = '1.23.0'; window.LifeOSVersion = APP_VERSION; const appIds = ['today', 'timeline', 'museum', 'insights', 'profile', 'tasks', 'calendar', 'system', 'browser', 'terminal', 'database']; const t = (key, values) => LifeI18n.t(key, values); @@ -34,7 +34,7 @@ setTimeout(() => { const today = (typeof todayTargetDate !== 'undefined' && todayTargetDate) || localDay(); try { - const saved = JSON.parse(localStorage.getItem('lifeos_memories') || '[]').some(m => m.date === today); + const saved = JSON.parse(localStorage.getItem('lifeos_memories') || '[]').some(m => m.date === today && m.kind !== 'moment'); if (saved) localStorage.removeItem(DRAFT_KEY); } catch {} }, 700); diff --git a/public/backup.js b/public/backup.js index 706b8a8..3a8b589 100644 --- a/public/backup.js +++ b/public/backup.js @@ -22,7 +22,7 @@ const stored = records(); return { app: 'Life OS', - version: window.LifeOSVersion || '1.22.1', + version: window.LifeOSVersion || '1.23.0', schemaVersion: BACKUP_SCHEMA, exportedAt: new Date().toISOString(), profile: json('lifeos_profile', {}), diff --git a/public/calendar.js b/public/calendar.js index 2f64b68..85bd39c 100644 --- a/public/calendar.js +++ b/public/calendar.js @@ -65,7 +65,7 @@ function eventsFor(key) { const events = []; - for (const memory of mems()) if (memory.date === key) events.push({ kind: 'memory', rank: 0, title: memory.title || memory.text?.trim().split('\n')[0].slice(0, 64) || t('timeline.untitled'), detail: memory.text || LifeI18n.t('timeline.noNote'), time: '', id: memory.id, mood: memory.mood, energy: memory.energy }); + for (const memory of mems()) if (memory.date === key) events.push({ kind: 'memory', rank: 0, title: memory.title || memory.text?.trim().split('\n')[0].slice(0, 64) || t('timeline.untitled'), detail: memory.text || LifeI18n.t('timeline.noNote'), time: '', id: memory.id, mood: memory.contextRecorded === false ? '' : memory.mood, energy: memory.contextRecorded === false ? null : memory.energy }); const board = system().tasksBoard || { goals: [], tasks: [] }; for (const task of board.tasks || []) { const due = task.dueDate === key, completed = localDatePart(task.completedAt) === key; diff --git a/public/data-actions.js b/public/data-actions.js index c36e6bd..46b4166 100644 --- a/public/data-actions.js +++ b/public/data-actions.js @@ -72,17 +72,20 @@ data.tasks.forEach(task => { if (task.goalId === id) task.goalId = ''; }); persistBoard(data); return goal; }, - createMemory({ date = day(), title, text = '', mood = 'cloudy', energy = 3, tags = [], location = '', taskId = '', replace = false }) { + createMemory({ date = day(), title, text = '', mood = 'cloudy', energy = 3, tags = [], location = '', taskId = '', replace = false, kind = 'daily' }) { title = String(title || '').trim(); if (title.length > 120) throw new Error('invalidTitle'); if (!validDate(date) || !date) throw new Error('invalidDate'); if (!['clear', 'light', 'cloudy', 'rain', 'storm'].includes(mood) || !Number.isInteger(Number(energy)) || Number(energy) < 1 || Number(energy) > 5) throw new Error('invalidValue'); if (taskId && !board().tasks.some(task => task.id === taskId)) throw new Error('notFound'); - const all = mems(), old = all.find(item => item.date === date); + if (!['daily', 'moment'].includes(kind)) throw new Error('invalidValue'); + if (kind === 'moment' && !String(text).trim() && !title) throw new Error('invalidTitle'); + const all = mems(), old = kind === 'daily' ? all.find(item => item.date === date && item.kind !== 'moment') : null; if (old && !replace) throw new Error('memoryExists'); const film = filmFor(mood, Number(energy)), now = new Date().toISOString(); - const memory = { ...old, id: old?.id || `memory_${crypto.randomUUID()}`, date, title, text: String(text).trim(), mood, energy: Number(energy), tags: [...new Set(tags.map(tag => String(tag).trim()).filter(Boolean))].slice(0, 12), location: String(location).trim().slice(0, 100), taskId, filmTitle: film.filmTitle, filmSubtitle: film.filmSubtitle, filmLine: film.filmLine, createdAt: old?.createdAt || now, updatedAt: now }; - save('lifeos_memories', [...all.filter(item => item.date !== date), memory].sort((a, b) => b.date.localeCompare(a.date))); renderAll(); return memory; + const memory = { ...old, id: old?.id || `memory_${crypto.randomUUID()}`, kind, date, title, text: String(text).trim(), mood, energy: Number(energy), tags: [...new Set(tags.map(tag => String(tag).trim()).filter(Boolean))].slice(0, 12), location: String(location).trim().slice(0, 100), taskId, filmTitle: film.filmTitle, filmSubtitle: film.filmSubtitle, filmLine: film.filmLine, createdAt: old?.createdAt || now, updatedAt: now }; + if (kind === 'moment') memory.contextRecorded = false; + save('lifeos_memories', [...all.filter(item => item.id !== memory.id), memory].sort((a, b) => b.date.localeCompare(a.date) || String(b.createdAt || '').localeCompare(String(a.createdAt || '')))); renderAll(); return memory; }, deleteMemory(id) { const all = mems(), memory = all.find(item => item.id === id); diff --git a/public/i18n-renderers.js b/public/i18n-renderers.js index 1db99c7..76c5cd3 100644 --- a/public/i18n-renderers.js +++ b/public/i18n-renderers.js @@ -18,12 +18,22 @@ window.moodName = weather; window.fmtDate = uiDate; window.shortDate = short; - window.addMemoryForDate = date => { todayTargetDate = date; todayDraft = null; todayTitleDraft = null; openApp('today'); }; + window.longest = records => { + const dates = [...new Set(records.map(item => item.date))].sort(); let best = 0, run = 0, previous = ''; + for (const date of dates) { run = previous && (new Date(date) - new Date(previous)) / 864e5 === 1 ? run + 1 : 1; best = Math.max(best, run); previous = date; } + return best; + }; + window.streak = records => { + const dates = new Set(records.map(item => item.date)); let count = 0, date = new Date(); + while (dates.has(`${date.getFullYear()}-${String(date.getMonth()+1).padStart(2,'0')}-${String(date.getDate()).padStart(2,'0')}`)) { count++; date.setDate(date.getDate()-1); } + return count; + }; + window.addMemoryForDate = date => { todayTargetDate = date; todayDraft = null; todayTitleDraft = null; openApp('today'); const container = document.querySelector('#content-today'); if (container) window.today(container); }; window.closeModal = () => { rootModal().innerHTML = ''; }; window.applyLanguage = () => { document.documentElement.lang = LifeI18n.locale(); document.documentElement.dir = lang() === 'ar' ? 'rtl' : 'ltr'; document.title = t('shell.pageTitle'); const brand = document.querySelector('#desktop-brand'), launcher = document.querySelector('#life-launcher'), boot = document.querySelector('#boot span'); if (brand) brand.textContent = t('shell.brand'); if (launcher) launcher.textContent = t('shell.life'); if (boot) boot.textContent = t('shell.initializing'); if (settings().wallpaper) applyWallpaper(settings().wallpaper); }; window.applyWallpaper = wallpaper => { if (!wallpaper?.url) return; const desktop = document.querySelector('#desktop'); desktop.style.backgroundImage = `linear-gradient(120deg,color-mix(in srgb,var(--bg) 68%,transparent),color-mix(in srgb,var(--bg) 36%,transparent)),url('${wallpaper.url}')`; desktop.style.backgroundSize = 'cover'; desktop.style.backgroundPosition = 'center'; desktop.title = t('shell.wallpaperTitle', { title: wallpaper.title || t('wallpaper.dailyImage') }); }; window.today = container => { - const entryDate = todayTargetDate || day(), memory = mems().find(item => item.date === entryDate); + const entryDate = todayTargetDate || day(), memory = mems().find(item => item.date === entryDate && item.kind !== 'moment'); if (todayDraft === null) { selectedMood = memory?.mood || 'cloudy'; selectedEnergy = memory?.energy || 3; } const film = filmFor(selectedMood, selectedEnergy), text = todayDraft === null ? (memory?.text || '') : todayDraft; container.innerHTML = `
${weekday(entryDate).toUpperCase()}

${uiDate(entryDate)}

${t('today.prompt')} ${entryDate !== day() ? `` : ''}

${memoryMetaFields(memory)}
`; @@ -34,6 +44,39 @@ status.textContent = t('today.archiving'); setTimeout(() => { todayDraft = null; todayTitleDraft = null; window.LifeOSActions.createMemory(draft); }, 360); }; + // Moments share record-level sync, search, favorites and backup with daily summaries. + const MOMENT_DRAFT = 'lifeos_moment_draft_v1'; + const readMomentDraft = () => { try { return JSON.parse(localStorage.getItem(MOMENT_DRAFT) || '{}'); } catch { return {}; } }; + window.openQuickMemory = (date = day()) => { + const draft = readMomentDraft(); + rootModal().innerHTML = ``; + rootModal().querySelector('textarea')?.focus(); + }; + window.saveQuickDraft = form => { + const field = name => form.elements.namedItem(name).value; + localStorage.setItem(MOMENT_DRAFT, JSON.stringify({ text:field('text'), title:field('title'), date:field('date'), tags:field('tags') })); + }; + window.saveQuickMemory = event => { + event.preventDefault(); const form = event.currentTarget, field = name => form.elements.namedItem(name).value; + try { + window.LifeOSActions.createMemory({ kind:'moment', date:field('date'), title:field('title'), text:field('text'), tags:tagList(field('tags')) }); + localStorage.removeItem(MOMENT_DRAFT); closeModal(); toast(t('moments.saved')); + } catch { form.querySelector('.moment-error').textContent = t('moments.invalid'); } + }; + const originalToday = window.today; + window.today = container => { + originalToday(container); + const date = todayTargetDate || day(), moments = mems().filter(item => item.date === date && item.kind === 'moment'); + container.insertAdjacentHTML('beforeend', `
${t('moments.label')}

${t('moments.count', { count:moments.length })}

${moments.length ? `
${moments.map(item => ``).join('')}
` : `

${t('moments.empty')}

`}
`); + }; + const quickButton = document.createElement('button'); + quickButton.type = 'button'; quickButton.className = 'moment-desktop-button'; quickButton.addEventListener('click', () => window.openQuickMemory()); + document.querySelector('#desktop')?.append(quickButton); + const previousLanguage = window.applyLanguage; + window.applyLanguage = () => { previousLanguage(); quickButton.textContent = `+ ${t('moments.title')}`; }; + const momentStyle = document.createElement('style'); + momentStyle.textContent = `.moment-desktop-button{position:absolute;top:20px;left:150px;z-index:2;border:1px solid var(--line);border-radius:9px;padding:8px 12px;background:var(--panel);color:var(--ink);font-size:14px}.moment-form{width:min(520px,calc(100vw - 28px));max-height:calc(100dvh - 28px);overflow:auto;display:grid;gap:12px}.moment-form h2{font-size:24px;letter-spacing:-.03em}.moment-form label{display:grid;gap:6px;font-size:14px}.moment-form input,.moment-form textarea{width:100%;min-width:0;background:var(--panel2);border:1px solid var(--line);border-radius:9px;padding:10px;font-size:16px}.moment-form textarea{resize:vertical}.moment-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.moment-draft-note{font-size:12px;color:var(--muted);margin:0}.moment-error{color:#eea27d;margin:0;font-size:14px}.moment-day{margin-top:24px;border-top:1px solid var(--line);padding-top:20px}.moment-day header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.moment-day h2{font-size:18px;letter-spacing:0;margin:0}.moment-list{display:grid;gap:8px}.moment-item{text-align:start;display:grid;gap:5px;padding:14px;background:var(--panel2);border:1px solid var(--line);border-radius:10px}.moment-item>span{font-size:12px;color:var(--muted)}.moment-item>strong{font-size:16px;overflow-wrap:anywhere}.moment-item>p{font-size:14px;color:var(--muted);margin:0;white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}@media(max-width:650px){.moment-desktop-button{top:14px;left:140px}.moment-fields{grid-template-columns:1fr}}`; + document.head.append(momentStyle); window.timeline = container => { const all = mems(), tags = [...new Set(all.flatMap(item => item.tags || []))].sort((a,b) => a.localeCompare(b)); const query = window.timelineQuery || '', selectedTag = window.timelineTag || ''; @@ -43,7 +86,7 @@ return (!query || haystack.includes(query.toLocaleLowerCase())) && (!selectedTag || (memory.tags || []).includes(selectedTag)); }); const isSaved = memory => museum().some(item => item.memoryId === memory.id); - container.innerHTML = `
${t('timeline.eyebrow')}

${t('timeline.heading',{count:filtered.length,total:all.length})}

${filtered.length ? `
${filtered.map(memory => { const task = linkedTasks().find(item => item.id === memory.taskId); return `
`; }).join('')}
` : `
${all.length ? t('timeline.noMatches') : `${t('timeline.emptyTitle')}
${t('timeline.emptyBody')}`}
`}`; + container.innerHTML = `
${t('timeline.eyebrow')}

${t('timeline.heading',{count:filtered.length,total:all.length})}

${filtered.length ? `
${filtered.map(memory => { const task = linkedTasks().find(item => item.id === memory.taskId); return `
`; }).join('')}
` : `
${all.length ? t('timeline.noMatches') : `${t('timeline.emptyTitle')}
${t('timeline.emptyBody')}`}
`}`; }; window.museumApp = container => { const saved = museum(), memories = mems(); @@ -54,7 +97,7 @@ window.detail = id => { const memory = mems().find(item => item.id === id); if (!memory) return; const task = linkedTasks().find(item => item.id === memory.taskId), favorite = museum().some(item => item.memoryId === memory.id); - rootModal().innerHTML = ``; + rootModal().innerHTML = ``; }; window.editMemory = id => { const memory = mems().find(item => item.id === id); if (!memory) return; rootModal().innerHTML = ``; }; window.saveMemoryEdit = (event,id) => { event.preventDefault(); const all=mems(), memory=all.find(item=>item.id===id); if(!memory)return; memory.title=document.querySelector('#memory-edit-title').value.trim(); memory.text=document.querySelector('#memory-edit-note').value.trim(); memory.tags=tagList(document.querySelector('#memory-tags').value); memory.location=document.querySelector('#memory-place').value.trim(); memory.taskId=document.querySelector('#memory-task').value||''; memory.updatedAt=new Date().toISOString(); save('lifeos_memories',all); closeModal(); renderAll(); detail(id); }; @@ -86,9 +129,9 @@ const tasksCompleted = tasks.filter(item => item.done && inPeriod(reportEventDate(item.completedAt))).length; const goalsCompleted = goals.filter(item => item.done && inPeriod(reportEventDate(item.completedAt))).length; const weatherCounts = { clear: 0, light: 0, cloudy: 0, rain: 0, storm: 0 }; - records.forEach(item => { if (Object.hasOwn(weatherCounts, item.mood)) weatherCounts[item.mood]++; }); + records.forEach(item => { if (item.contextRecorded !== false && Object.hasOwn(weatherCounts, item.mood)) weatherCounts[item.mood]++; }); const commonWeather = Object.entries(weatherCounts).filter(([, count]) => count).sort((a, b) => b[1] - a[1]).slice(0, 3); - const energies = records.map(item => ({ date: item.date, value: Number(item.energy) })).filter(item => Number.isFinite(item.value) && item.value >= 1 && item.value <= 5); + const energies = records.filter(item => item.contextRecorded !== false).map(item => ({ date: item.date, value: Number(item.energy) })).filter(item => Number.isFinite(item.value) && item.value >= 1 && item.value <= 5); const energyAverage = energies.length ? (energies.reduce((sum, item) => sum + item.value, 0) / energies.length).toFixed(1) : '—'; const favorites = new Set(museum().map(item => item.memoryId)); const hasHighlightTag = item => (Array.isArray(item.tags) ? item.tags : []).some(tag => ['高光', 'highlight'].includes(String(tag).replace(/^#/, '').trim().toLowerCase())); @@ -104,7 +147,7 @@

${t('insights.note')}

`; }; window.profileApp = container => { - const profileData = profile(), all = mems(), common = Object.entries(all.reduce((out, item) => (out[item.mood] = (out[item.mood] || 0) + 1, out), {})).sort((a,b) => b[1] - a[1])[0]?.[0] || '—', average = all.length ? (all.reduce((sum,item) => sum + item.energy,0) / all.length).toFixed(1) : '—', started = Math.max(1, Math.floor((Date.now() - new Date(profileData.startDate)) / 864e5)); + const profileData = profile(), all = mems(), tracked = all.filter(item => item.contextRecorded !== false), common = Object.entries(tracked.reduce((out, item) => (out[item.mood] = (out[item.mood] || 0) + 1, out), {})).sort((a,b) => b[1] - a[1])[0]?.[0] || '—', average = tracked.length ? (tracked.reduce((sum,item) => sum + item.energy,0) / tracked.length).toFixed(1) : '—', started = Math.max(1, Math.floor((Date.now() - new Date(profileData.startDate)) / 864e5)); container.innerHTML = `
${t('profile.eyebrow')}

${profileData.name ? esc(profileData.name) + ' · ' : ''}${t('profile.online')}

${started}${t('profile.daysOnline')}
${all.length}${t('profile.memories')}
${museum().length}${t('profile.museumItems')}
${streak(all)}${t('profile.streak')}
${longest(all)}${t('profile.longest')}
${common === '—' ? common : weather(common)}${t('profile.commonWeather')}
${t('profile.personal')}
${t('profile.average',{value:average})}
`; }; window.saveProfile = () => { save('lifeos_profile', { name: pname.value, birthday: pbday.value, startDate: pstart.value || day(), motto: pmotto.value }); renderAll(); toast(t('profile.saved')); }; @@ -121,8 +164,9 @@ if (Array.isArray(data.desktopLayout?.entries)) localStorage.setItem('lifeos_window_layout_v1', JSON.stringify({ entries: data.desktopLayout.entries })); if (data.widgetLayout && typeof data.widgetLayout === 'object' && !Array.isArray(data.widgetLayout)) localStorage.setItem('lifeos_widget_layout_v1', JSON.stringify(data.widgetLayout)); } else { - const memories = mems(), ids = new Set(memories.map(item => item.id)), dates = new Set(memories.map(item => item.date)); - save('lifeos_memories', [...memories, ...data.memories.filter(item => !ids.has(item.id) && !dates.has(item.date))]); + const memories = mems(), ids = new Set(memories.map(item => item.id)), dates = new Set(memories.filter(item => item.kind !== 'moment').map(item => item.date)); + const additions = data.memories.filter(item => { if (ids.has(item.id) || (item.kind !== 'moment' && dates.has(item.date))) return false; ids.add(item.id); if (item.kind !== 'moment') dates.add(item.date); return true; }); + save('lifeos_memories', [...memories, ...additions].sort((a,b) => b.date.localeCompare(a.date) || String(b.createdAt || '').localeCompare(String(a.createdAt || '')))); const artifacts = museum(), artifactIds = new Set(artifacts.map(item => item.id)); save('lifeos_museum', [...artifacts, ...data.museum.filter(item => !artifactIds.has(item.id))]); const current = sys(), importedBoard = data.system?.tasksBoard; diff --git a/public/index.html b/public/index.html index 91acc30..40e1349 100644 --- a/public/index.html +++ b/public/index.html @@ -25,4 +25,4 @@ function profileApp(c){let p=profile(),a=mems(),common=Object.entries(a.reduce(( function today(c){let m=mems().find(x=>x.date===day());if(todayDraft===null){selectedMood=m?.mood||'cloudy';selectedEnergy=m?.energy||3}let f=m||filmFor(selectedMood,selectedEnergy),text=todayDraft===null?(m?.text||''):todayDraft,cWeek=new Date().toLocaleDateString(LifeI18n.locale(),{weekday:'long'}).toUpperCase();c.innerHTML=`
${cWeek}

${fmtDate(day()).replace(/^[^,]+, /,'')}

${i18n('How was your day?')}

`}function rerenderToday(){let old=document.querySelector('#entry');todayDraft=old?old.value:todayDraft||'';window.today(document.querySelector('#content-today'));let entry=document.querySelector('#entry');entry?.focus();entry?.setSelectionRange(entry.value.length,entry.value.length)} function systemApp(c){let s=settings(),bytes=new Blob([JSON.stringify({mems:mems(),museum:museum(),profile:profile()})]).size;let rec=s.lastBackup&&(Date.now()-new Date(s.lastBackup)>12096e5);c.innerHTML=`
SYSTEM SETTINGS

System, local and yours.

APPEARANCE
${['dark','light','auto'].map(x=>``).join('')}
LANGUAGE
DATA
STORAGE

Local Storage
${mems().length} memories · ${museum().length} museum items · Approx. ${Math.ceil(bytes/1024)} KB

DATA STORAGE

Your data is stored locally in this browser.
Create regular backups to prevent data loss.

${s.lastBackup?'LAST BACKUP · '+fmtDate(s.lastBackup.slice(0,10)):'LAST BACKUP · NEVER'} ${rec?'
BACKUP RECOMMENDED':''}

VERSION

Life OS
Version ${window.LifeOSVersion||'1.18.1'} · Schema v2

`}function theme(x){let s=settings();s.theme=x;save('lifeos_settings',s);init();renderAll()}function exportData(){let data={app:'Life OS',version:window.LifeOSVersion||'1.18.1',schemaVersion:1,exportedAt:new Date().toISOString(),profile:profile(),memories:mems(),museum:museum(),settings:settings()};let a=document.createElement('a');a.href=URL.createObjectURL(new Blob([JSON.stringify(data,null,2)],{type:'application/json'}));a.download='life-os-backup-'+day()+'.json';a.click();let s=settings();s.lastBackup=new Date().toISOString();save('lifeos_settings',s);renderAll();toast('BACKUP CREATED')}function readImport(el){let f=el.files[0];if(!f)return;let r=new FileReader;r.onload=()=>{try{let d=JSON.parse(r.result);if(d.app!=='Life OS'||![1,2,3].includes(d.schemaVersion)||!Array.isArray(d.memories)||!Array.isArray(d.museum))throw 0;importData=d;importPreview()}catch{toast('INVALID BACKUP FILE')}};r.readAsText(f)}function importPreview(){let d=importData;modal.innerHTML=``}function replaceConfirm(){modal.innerHTML=``}function applyImport(mode){let d=importData;if(mode==='replace'){save('lifeos_memories',d.memories);save('lifeos_museum',d.museum);save('lifeos_profile',d.profile||{});save('lifeos_settings',d.settings||{})}else{let a=mems(), ids=new Set(a.map(x=>x.id)),dates=new Set(a.map(x=>x.date));save('lifeos_memories',[...a,...d.memories.filter(x=>!ids.has(x.id)&&!dates.has(x.date))]);let mu=museum(),mi=new Set(mu.map(x=>x.id));save('lifeos_museum',[...mu,...d.museum.filter(x=>!mi.has(x.id))])}modal.innerHTML='';toast('RESTORING SYSTEM...');setTimeout(()=>{renderAll();toast('SYSTEM RESTORED')},500)}function resetConfirm(){modal.innerHTML=``}function toast(t){let x=document.createElement('div');x.className='toast';x.textContent=t;document.body.append(x);setTimeout(()=>x.remove(),2000)} window.renderIcons=renderIcons;window.renderAll=renderAll;window.toast=toast; - + diff --git a/public/locales/ar.json b/public/locales/ar.json index a859bd2..4c942de 100644 --- a/public/locales/ar.json +++ b/public/locales/ar.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "لحظات", + "title": "ملاحظة سريعة", + "hint": "احفظ لحظة دون استبدال ملخص يومك.", + "placeholder": "فكرة أو اكتشاف صغير أو شيء يستحق التذكر…", + "draft": "تبقى المسودة غير المحفوظة على هذا الجهاز.", + "save": "حفظ اللحظة", + "saved": "تم حفظ اللحظة", + "invalid": "اكتب عنواناً أو ملاحظة واختر تاريخاً صالحاً.", + "count": "{count} لحظات", + "empty": "لا توجد لحظات بعد. يُحفظ ملخص اليوم بشكل منفصل." + }, "app": { "today": "اليوم", "timeline": "الخط الزمني", diff --git a/public/locales/en.json b/public/locales/en.json index 2d245a9..a51f1d7 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "MOMENTS", + "title": "Quick memory", + "hint": "Keep a moment without replacing your daily summary.", + "placeholder": "A thought, a small discovery, something worth keeping…", + "draft": "Draft stays on this device until saved.", + "save": "SAVE MOMENT", + "saved": "Moment saved", + "invalid": "Write a title or note and choose a valid date.", + "count": "{count} moments", + "empty": "No moments yet. Your daily summary stays separate." + }, "app": { "today": "TODAY", "timeline": "TIMELINE", diff --git a/public/locales/es.json b/public/locales/es.json index d69d83b..03d3de3 100644 --- a/public/locales/es.json +++ b/public/locales/es.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "MOMENTOS", + "title": "Nota rápida", + "hint": "Guarda un momento sin reemplazar tu resumen diario.", + "placeholder": "Una idea, un descubrimiento, algo que recordar…", + "draft": "El borrador permanece en este dispositivo.", + "save": "GUARDAR", + "saved": "Momento guardado", + "invalid": "Escribe un título o una nota y elige una fecha válida.", + "count": "{count} momentos", + "empty": "No hay momentos. El resumen diario se guarda aparte." + }, "app": { "today": "HOY", "timeline": "CRONOLOGÍA", diff --git a/public/locales/fr.json b/public/locales/fr.json index 8380dc3..08fad7b 100644 --- a/public/locales/fr.json +++ b/public/locales/fr.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "INSTANTS", + "title": "Note rapide", + "hint": "Gardez un instant sans remplacer votre résumé quotidien.", + "placeholder": "Une pensée, une découverte, un détail à garder…", + "draft": "Le brouillon reste sur cet appareil.", + "save": "ENREGISTRER", + "saved": "Instant enregistré", + "invalid": "Saisissez un titre ou une note et une date valide.", + "count": "{count} instants", + "empty": "Aucun instant. Le résumé quotidien reste séparé." + }, "app": { "today": "AUJOURD’HUI", "timeline": "CHRONOLOGIE", diff --git a/public/locales/ja.json b/public/locales/ja.json index d8495f2..c517207 100644 --- a/public/locales/ja.json +++ b/public/locales/ja.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "瞬間の記録", + "title": "クイックメモ", + "hint": "日々のまとめを上書きせず、ひとつの瞬間を残します。", + "placeholder": "思いつき、小さな発見、覚えておきたいこと…", + "draft": "未保存の下書きはこの端末に残ります。", + "save": "保存", + "saved": "保存しました", + "invalid": "タイトルか本文を入力し、有効な日付を選んでください。", + "count": "{count} 件の記録", + "empty": "記録はまだありません。日々のまとめとは別に保存されます。" + }, "app": { "today": "今日", "timeline": "タイムライン", diff --git a/public/locales/ru.json b/public/locales/ru.json index 308e55c..d4f5c4b 100644 --- a/public/locales/ru.json +++ b/public/locales/ru.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "МОМЕНТЫ", + "title": "Быстрая запись", + "hint": "Сохраните момент, не заменяя итог дня.", + "placeholder": "Мысль, открытие, небольшое событие…", + "draft": "Черновик остаётся на этом устройстве.", + "save": "СОХРАНИТЬ", + "saved": "Момент сохранён", + "invalid": "Введите заголовок или текст и выберите верную дату.", + "count": "{count} моментов", + "empty": "Моментов пока нет. Итог дня хранится отдельно." + }, "app": { "today": "СЕГОДНЯ", "timeline": "ХРОНОЛОГИЯ", diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index fd5c38a..e540cb8 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "瞬间记录", + "title": "快速记录", + "hint": "随手保存一个瞬间,不会覆盖每日总结。", + "placeholder": "一个想法、一点发现、一件想记住的小事……", + "draft": "未保存的草稿会保留在本设备。", + "save": "保存瞬间", + "saved": "瞬间已保存", + "invalid": "请填写标题或正文,并选择有效日期。", + "count": "{count} 条瞬间记录", + "empty": "还没有瞬间记录;每日总结独立保存。" + }, "app": { "today": "今日", "timeline": "时间线", diff --git a/public/locales/zh-HK.json b/public/locales/zh-HK.json index 051207a..f4f519d 100644 --- a/public/locales/zh-HK.json +++ b/public/locales/zh-HK.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "瞬間記錄", + "title": "快速記錄", + "hint": "隨手保存一個瞬間,不會覆蓋每日總結。", + "placeholder": "一個想法、一點發現、一件想記住的小事……", + "draft": "未保存的草稿會保留在本機。", + "save": "保存瞬間", + "saved": "瞬間已保存", + "invalid": "請填寫標題或正文,並選擇有效日期。", + "count": "{count} 條瞬間記錄", + "empty": "尚無瞬間記錄;每日總結獨立保存。" + }, "app": { "today": "今日", "timeline": "時間線", diff --git a/public/locales/zh-MO.json b/public/locales/zh-MO.json index 737e69d..dc032a1 100644 --- a/public/locales/zh-MO.json +++ b/public/locales/zh-MO.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "瞬間記錄", + "title": "快速記錄", + "hint": "隨手保存一個瞬間,不會覆蓋每日總結。", + "placeholder": "一個想法、一點發現、一件想記住的小事……", + "draft": "未保存的草稿會保留在本機。", + "save": "保存瞬間", + "saved": "瞬間已保存", + "invalid": "請填寫標題或正文,並選擇有效日期。", + "count": "{count} 條瞬間記錄", + "empty": "尚無瞬間記錄;每日總結獨立保存。" + }, "app": { "today": "今日", "timeline": "時間線", diff --git a/public/locales/zh-TW.json b/public/locales/zh-TW.json index 1a78ce9..ee2a881 100644 --- a/public/locales/zh-TW.json +++ b/public/locales/zh-TW.json @@ -1,4 +1,16 @@ { + "moments": { + "label": "瞬間記錄", + "title": "快速記錄", + "hint": "隨手儲存一個瞬間,不會覆蓋每日總結。", + "placeholder": "一個想法、一點發現、一件想記住的小事……", + "draft": "未儲存的草稿會保留在本機。", + "save": "儲存瞬間", + "saved": "瞬間已儲存", + "invalid": "請填寫標題或正文,並選擇有效日期。", + "count": "{count} 條瞬間記錄", + "empty": "尚無瞬間記錄;每日總結獨立儲存。" + }, "app": { "today": "今日", "timeline": "時間線", diff --git a/public/notifications.js b/public/notifications.js index 2c42edd..d878fbf 100644 --- a/public/notifications.js +++ b/public/notifications.js @@ -43,7 +43,7 @@ function content(kind, date) { if (kind === 'memory') { - if (mems().some(memory => memory.date === date)) return null; + if (mems().some(memory => memory.date === date && memory.kind !== 'moment')) return null; return { title: t('memory.title'), body: t('memory.body'), app: 'today' }; } const board = sys().tasksBoard || {}; diff --git a/public/service-worker.js b/public/service-worker.js index 8ea7f0c..f5c39c8 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -1,4 +1,4 @@ -const CACHE = 'life-os-shell-v1.22.1'; +const CACHE = 'life-os-shell-v1.23.0'; const SHELL = [ '/', '/index.html', '/manifest.webmanifest', '/life-os-icon.svg', '/local-db-worker.js', '/sqlite3.mjs', '/sqlite3.wasm' diff --git a/public/system-navigation.js b/public/system-navigation.js index 862ed8f..40e41b3 100644 --- a/public/system-navigation.js +++ b/public/system-navigation.js @@ -27,7 +27,7 @@ shell.innerHTML = `
${t('settings')}

${t(active)}

${active === 'home' ? `

${t('homeHint')}

` : ''}
`; const view = shell.querySelector('.system-settings-view'); if (active === 'home') { - view.innerHTML = `
${t('device')}

${t('deviceHint')}

${t('version', { version: window.LifeOSVersion || '1.22.1' })}
${t('quickSettings')}
${['appearance', 'notifications', 'language', 'data'].map(id => `
${navigationButton(id, true)}

${t(`${id}Hint`)}

`).join('')}
`; + view.innerHTML = `
${t('device')}

${t('deviceHint')}

${t('version', { version: window.LifeOSVersion || '1.23.0' })}
${t('quickSettings')}
${['appearance', 'notifications', 'language', 'data'].map(id => `
${navigationButton(id, true)}

${t(`${id}Hint`)}

`).join('')}
`; } else { const group = document.createElement('div'); group.className = 'settings system-settings-group'; diff --git a/public/terminal-app.js b/public/terminal-app.js index 2885700..04f3581 100644 --- a/public/terminal-app.js +++ b/public/terminal-app.js @@ -126,7 +126,7 @@ if (field === 'date') { const selected = date(value) || draft.date || localDate(0); if (!validDay(selected)) throw new Error('invalidDate'); - if (mems().some(item => item.date === selected)) throw new Error('memoryExists'); + if (mems().some(item => item.date === selected && item.kind !== 'moment')) throw new Error('memoryExists'); draft.date = selected; } if (field === 'tags' && value) draft.tags = value === '-' ? [] : [...new Set(value.split(/[,,]/).map(tag => tag.trim()).filter(Boolean))].slice(0, 12); @@ -150,7 +150,7 @@ return { message: new Intl.DateTimeFormat(LifeI18n.locale(), options).format(new Date()) }; } if (kind === 'uptime') { if (verb) throw new Error('usage'); const seconds = Math.floor((Date.now() - startedAt) / 1000); return { message: t('uptime', { minutes: Math.floor(seconds / 60), seconds: seconds % 60 }) }; } - if (kind === 'version') { if (verb) throw new Error('usage'); return { message: `Life OS v${window.LifeOSVersion || '1.22.1'}` }; } + if (kind === 'version') { if (verb) throw new Error('usage'); return { message: `Life OS v${window.LifeOSVersion || '1.23.0'}` }; } if (kind === 'status') { if (verb) throw new Error('usage'); const data = board(); return { message: t('status', { memories: mems().length, goals: data.goals.length, tasks: data.tasks.length }) }; } if (kind === 'apps') { if (verb) throw new Error('usage'); return { message: Object.keys(APPS).map(id => `${id} — ${LifeI18n.t(`app.${id}`)}`).join('\n') }; } if (kind === 'history') { if (verb) throw new Error('usage'); return { message: history.slice(-20).map((entry,index) => `${index + 1}. ${entry}`).join('\n') || t('empty') }; } @@ -164,7 +164,7 @@ const { flags, values } = options(rest, ['date','tag','energy','weather','place','task','text']), title = values.join(' ').trim(); const draft = { title, date: date(flags.date) || localDate(0), tags: flags.tag || [], energy: flags.energy === undefined ? 3 : Number(flags.energy), mood: flags.weather || 'cloudy', location: flags.place || '', taskId: resolve(board().tasks, flags.task), text: flags.text || '' }; if (!validDay(draft.date)) throw new Error('invalidDate'); - if (mems().some(item => item.date === draft.date) && (flags.date || flags.text !== undefined)) throw new Error('memoryExists'); + if (mems().some(item => item.date === draft.date && item.kind !== 'moment') && (flags.date || flags.text !== undefined)) throw new Error('memoryExists'); if (!Number.isInteger(draft.energy) || draft.energy < 1 || draft.energy > 5 || !['clear','light','cloudy','rain','storm'].includes(draft.mood)) throw new Error('invalidValue'); if (flags.text === undefined) { wizard = { draft, step: 0, seeded: new Set([...(title ? ['title'] : []), ...Object.keys(flags).map(key => ({ tag: 'tags', weather: 'mood', place: 'location', task: 'taskId' }[key] || key))]) }; @@ -235,7 +235,7 @@ }; window.terminalApp = node => { if (node.querySelector('.terminal-shell') && node.dataset.terminalLocale === lang()) { output(node); return; } - if (!welcomed) { lines.unshift({ value: t('welcome', { version: window.LifeOSVersion || '1.22.1' }), kind: 'system' }); welcomed = true; } + if (!welcomed) { lines.unshift({ value: t('welcome', { version: window.LifeOSVersion || '1.23.0' }), kind: 'system' }); welcomed = true; } node.dataset.terminalLocale = lang(); node.innerHTML = `
Life OS / ${t('title')}${t('hint')}
`; output(node); composer(node, Boolean(compose)); diff --git a/scripts/build.mjs b/scripts/build.mjs index bc930aa..51d0b65 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -13,7 +13,7 @@ const [rawIndexHtml, addonsJs, backupJs, bootGuardJs, localDbJs, localDbWorkerJs readFile(new URL("../node_modules/@sqlite.org/sqlite-wasm/dist/sqlite3.wasm", import.meta.url)), text("i18n.js"), text("tasks.js"), text("calendar.js"), text("notifications.js"), text("i18n-renderers.js"), text("desktop-personalization.js"), text("desktop-widgets.js"), text("system-navigation.js"), text("browser-app.js"), text("data-actions.js"), text("terminal-app.js"), text("db-admin.js"), text("manifest.webmanifest"), text("service-worker.js"), text("life-os-icon.svg"), readFile(new URL("../public/locales/en.json", import.meta.url), "utf8"), readFile(new URL("../public/locales/zh-CN.json", import.meta.url), "utf8") ]); -const release = "1.22.1"; +const release = "1.23.0"; const localeEnJs = `window.LifeOSLocales=window.LifeOSLocales||{};window.LifeOSLocales.en=${localeEn};`; const localeZhJs = `window.LifeOSLocales=window.LifeOSLocales||{};window.LifeOSLocales['zh-CN']=${localeZh};`; const extraLocaleCodes = ['zh-HK', 'zh-MO', 'zh-TW', 'ar', 'fr', 'ru', 'es', 'ja']; diff --git a/scripts/test-cloud.mjs b/scripts/test-cloud.mjs index b810ae2..8dc84bb 100644 --- a/scripts/test-cloud.mjs +++ b/scripts/test-cloud.mjs @@ -145,4 +145,11 @@ assert.equal((await call("/api/db-admin/tables/tasks/rows", "GET", undefined, au assert.equal((await call("/api/db-admin/login", "POST", { username: "lifeos-admin", password: "local test password with 28 chars", acknowledged: true })).status, 401); assert.equal((await call("/api/db-admin/login", "POST", { username: "lifeos-admin", password: "new secure password 12345", acknowledged: true })).status, 200); assert.equal((await call("/api/db-admin/logout", "POST", {}, { ...headers, "x-lifeos-admin-session": rotated.body.token })).status, 200); -console.log("Life OS record migration, sync conflict, tags, and user isolation valid"); +for (const [id, kind] of [['daily-same-date','daily'],['moment-one','moment'],['moment-two','moment']]) { + const saved = await call('/api/lifeos-sync','POST',{kind:'memories',id,baseVersion:0,value:{id,kind,date:'2026-10-13',text:id}}); + assert.equal(saved.status,200,'cloud accepts independent records on the same date'); +} +const sameDate=(await call('/api/lifeos-state')).body.state.memories.filter(item=>item.date==='2026-10-13'); +assert.equal(sameDate.length,3); +assert.equal(sameDate.filter(item=>item.kind==='moment').length,2); +console.log("Life OS record migration, sync conflict, tags, same-day moments and user isolation valid"); diff --git a/scripts/test-moments.mjs b/scripts/test-moments.mjs new file mode 100644 index 0000000..bd3644e --- /dev/null +++ b/scripts/test-moments.mjs @@ -0,0 +1,39 @@ +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import vm from 'node:vm'; +let records = [{ id:'legacy',date:'2026-10-13',text:'Original daily summary',mood:'clear',energy:5 }]; +const context = vm.createContext({ + sys:()=>({tasksBoard:{tasks:[],goals:[]}}), mems:()=>structuredClone(records), museum:()=>[], + save:(key,value)=>{if(key==='lifeos_memories') records=structuredClone(value);}, renderAll(){}, + filmFor:()=>({filmTitle:'Prompt',filmSubtitle:'',filmLine:''}), day:()=> '2026-10-13', crypto:globalThis.crypto +}); +context.window=context; +vm.runInContext(readFileSync(new URL('../public/data-actions.js',import.meta.url),'utf8'),context); +const action=context.LifeOSActions; +const first=action.createMemory({kind:'moment',text:'First moment',date:'2026-10-13'}); +const second=action.createMemory({kind:'moment',text:'Second moment',date:'2026-10-13'}); +assert.notEqual(first.id,second.id); +assert.equal(records.length,3); +assert.equal(records.find(item=>item.id==='legacy').text,'Original daily summary'); +assert.equal(first.contextRecorded,false,'quick notes must not invent energy/weather observations'); +const daily=action.createMemory({date:'2026-10-13',text:'Updated daily summary',replace:true}); +assert.equal(daily.id,'legacy'); +assert.equal(records.length,3,'updating summary preserves all same-day moments'); +assert.equal(records.filter(item=>item.kind==='moment').length,2); +assert.throws(()=>action.createMemory({date:'2026-10-13',text:'Duplicate summary'}),/memoryExists/); +assert.throws(()=>action.createMemory({kind:'moment',text:' '}),/invalidTitle/); +assert.throws(()=>action.createMemory({kind:'moment',text:'Note',date:'2026-02-30'}),/invalidDate/); +action.deleteMemory(first.id); +assert.equal(records.length,2); +assert.ok(records.some(item=>item.id===second.id)); +assert.ok(records.some(item=>item.id==='legacy')); +const renderer = readFileSync(new URL('../public/i18n-renderers.js',import.meta.url),'utf8'); +context.importData = { memories:[{id:'imported-moment',kind:'moment',date:'2026-10-13',text:'Imported'}, {id:'duplicate-daily',date:'2026-10-13',text:'Should not replace summary'}], museum:[] }; +context.rootModal = () => ({innerHTML:''}); context.toast=()=>{}; context.setTimeout=()=>0; +vm.runInContext(renderer.slice(renderer.indexOf(' window.applyImport = mode => {'), renderer.indexOf(' window.resetConfirm =')),context); +context.applyImport('merge'); +assert.ok(records.some(item=>item.id==='imported-moment'),'merge preserves another moment on an existing date'); +assert.ok(!records.some(item=>item.id==='duplicate-daily'),'merge does not introduce a second daily summary'); +context.applyImport('merge'); +assert.equal(records.filter(item=>item.id==='imported-moment').length,1,'repeated import is idempotent'); +console.log('Life OS same-day moments, legacy summary compatibility and deletion valid'); diff --git a/scripts/validate.mjs b/scripts/validate.mjs index d5eb227..e6e90e9 100644 --- a/scripts/validate.mjs +++ b/scripts/validate.mjs @@ -284,7 +284,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.22.1'); +assert.equal(command('version').message, 'Life OS v1.23.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'); @@ -604,3 +604,13 @@ holidayContext.setCalendarHolidayCountry('FR'); assert.equal(holidayStore.getItem('lifeos_holiday_country_v1'), 'FR'); assert.match(holidayNode.innerHTML, /