diff --git a/CHANGELOG.md b/CHANGELOG.md
index 378b5dc..eb43d73 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,14 @@
本项目按 `v主版本.次版本.修订版本` 标记应用版本;按需创建 Git tag。下列内容以对应提交和已发布功能为准。
+## v1.24.0 — 2026-10-13
+
+- 每日总结和瞬间删除后先移入回收站,可在系统设置的数据与备份页面查看、恢复或二次确认永久删除。
+- 回收站保留正文、标签、原记录 ID 和收藏关系,不自动清理;恢复时不覆盖同日现有总结。
+- 软删除状态沿用记录级云同步、SQLite 本地状态和 JSON 备份;回收站记录从时间线、搜索、日历、收藏展示和统计隐藏。
+- 编辑、创建、任务关联清理和合并导入均保留既有回收站记录。
+- 增加恢复冲突、收藏恢复、写入隔离和云端回收站状态测试。
+
## v1.23.0 — 2026-10-13
- 新增桌面快速记录入口和今日瞬间列表;同一天可保存多条文字瞬间,支持标题、日期、标签、草稿恢复和后续编辑。
diff --git a/README.md b/README.md
index e89be54..24ab987 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
以桌面操作系统为交互方式的个人记录网站。用 App 记录日常、管理目标与待办,并沿时间线回看已经留下的内容。
-在线站点:[Life OS](https://life-os-personal-desktop.biss0.chatgpt.site) · 当前应用版本:**v1.23.0** · [更新日志](CHANGELOG.md)
+在线站点:[Life OS](https://life-os-personal-desktop.biss0.chatgpt.site) · 当前应用版本:**v1.24.0** · [更新日志](CHANGELOG.md)
## 功能
@@ -32,6 +32,8 @@
## 数据与备份
+记忆和瞬间的删除操作会先移入回收站。系统设置 → 数据与备份 → 回收站可预览、恢复或确认永久删除;不会自动清理。恢复保留原记录 ID、标签与收藏关系。如果该日期已有新的每日总结,会阻止恢复并提示处理,避免覆盖。回收站状态参与云同步和 JSON 备份;永久删除后不能通过回收站恢复,已有独立备份仍保留当时的内容。任务和目标暂不进入回收站。
+
首次使用可选择“仅本地使用”或“登录并云同步”。仅本地模式无需登录,也不会请求云同步接口;数据写入当前设备、当前浏览器、本站专属的 OPFS 私有存储区,逻辑数据库位置为 `OPFS:/lifeos.sqlite`。SQLite 是本地持久层,`localStorage` 作为同步界面缓存和兼容旧版本的数据迁移来源。SQLite Schema v2 会将记忆、目标、待办和收藏投影为独立关系表,用于索引和全局检索;升级时自动从已有状态重建,不需要手动迁移。系统设置会显示当前模式、数据库状态、近似大小和持久存储状态。
云端模式继续使用 ChatGPT 登录标识隔离不同用户的数据,资料通过同源 API 保存到 Sites 的 D1 数据库,本地 SQLite 作为离线副本。首次云端恢复前,本地资料会保留一份迁移前副本。浏览器缓存与 JSON 备份仍使用 `lifeos_system.tasksBoard`;云端将其中的目标和待办拆分为独立记录。用户可随时切回仅本地模式;切换不会自动删除已有云端数据。任务栏同步入口与系统设置中的同步中心会显示联网状态、待同步更改、冲突和上次成功同步时间;写入失败时操作保留在设备队列,恢复联网后自动重试。
diff --git a/package.json b/package.json
index 4f0bf90..48abd45 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "life-os",
- "version": "1.23.0",
+ "version": "1.24.0",
"private": true,
"type": "module",
"scripts": {
diff --git a/public/addons.js b/public/addons.js
index 5dd7837..ae7a81a 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.23.0';
+ const APP_VERSION = '1.24.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 && m.kind !== 'moment');
+ const saved = JSON.parse(localStorage.getItem('lifeos_memories') || '[]').some(m => !m.trashedAt && m.date === today && m.kind !== 'moment');
if (saved) localStorage.removeItem(DRAFT_KEY);
} catch {}
}, 700);
@@ -66,7 +66,8 @@
try {
const indexed = await window.LifeOSLocalDB.search(query, 12);
const current = new Map(found.map(item => [`${item.kind}:${item.id}`, item]));
- indexed.forEach(item => { const key = `${item.kind}:${item.id}`; if (!current.has(key)) current.set(key, item); });
+ const activeIds = new Set(mems().map(item => item.id));
+ indexed.forEach(item => { if (item.kind === 'memory' && !activeIds.has(item.id)) return; const key = `${item.kind}:${item.id}`; if (!current.has(key)) current.set(key, item); });
found = [...current.values()].slice(0, 12);
} catch {}
}
diff --git a/public/backup.js b/public/backup.js
index 3a8b589..03ffee8 100644
--- a/public/backup.js
+++ b/public/backup.js
@@ -22,7 +22,7 @@
const stored = records();
return {
app: 'Life OS',
- version: window.LifeOSVersion || '1.23.0',
+ version: window.LifeOSVersion || '1.24.0',
schemaVersion: BACKUP_SCHEMA,
exportedAt: new Date().toISOString(),
profile: json('lifeos_profile', {}),
diff --git a/public/data-actions.js b/public/data-actions.js
index 46b4166..37f5662 100644
--- a/public/data-actions.js
+++ b/public/data-actions.js
@@ -1,5 +1,10 @@
/* Shared record writes for forms and the Life OS terminal. */
(() => {
+ const readMemories = mems, readFavorites = museum;
+ const allMemories = () => readMemories();
+ const allFavorites = () => readFavorites();
+ window.mems = () => allMemories().filter(item => !item.trashedAt);
+ window.museum = () => { const visible = new Set(window.mems().map(item => item.id)); return allFavorites().filter(item => visible.has(item.memoryId)); };
const board = () => {
const current = sys().tasksBoard;
return current && Array.isArray(current.goals) && Array.isArray(current.tasks) ? current : { goals: [], tasks: [] };
@@ -13,6 +18,7 @@
const persistBoard = data => { const state = sys(); state.tasksBoard = data; save('lifeos_system', state); renderAll(); };
window.LifeOSActions = {
board,
+ allMemories, allFavorites,
createGoal({ title, description = '', targetDate = '', showOnDesktop = false }) {
title = required(title, 100);
if (!validDate(targetDate)) throw new Error('invalidDate');
@@ -61,7 +67,7 @@
const data = board(), task = data.tasks.find(item => item.id === id);
if (!task) throw new Error('notFound');
data.tasks = data.tasks.filter(item => item.id !== id);
- const all = mems();
+ const all = allMemories();
if (all.some(item => item.taskId === id)) save('lifeos_memories', all.map(item => item.taskId === id ? { ...item, taskId: '', updatedAt: new Date().toISOString() } : item));
persistBoard(data); return task;
},
@@ -80,7 +86,7 @@
if (taskId && !board().tasks.some(task => task.id === taskId)) throw new Error('notFound');
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;
+ const all = allMemories(), old = kind === 'daily' ? all.find(item => !item.trashedAt && 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()}`, 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 };
@@ -88,10 +94,24 @@
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);
+ const all = allMemories(), memory = all.find(item => item.id === id && !item.trashedAt);
+ if (!memory) throw new Error('notFound');
+ memory.trashedAt = new Date().toISOString(); memory.updatedAt = memory.trashedAt;
+ save('lifeos_memories', all);
+ renderAll(); return memory;
+ },
+ restoreMemory(id) {
+ const all = allMemories(), memory = all.find(item => item.id === id && item.trashedAt);
+ if (!memory) throw new Error('notFound');
+ if (memory.kind !== 'moment' && all.some(item => !item.trashedAt && item.id !== id && item.kind !== 'moment' && item.date === memory.date)) throw new Error('memoryExists');
+ delete memory.trashedAt; memory.updatedAt = new Date().toISOString();
+ save('lifeos_memories', all); renderAll(); return memory;
+ },
+ purgeMemory(id) {
+ const all = allMemories(), memory = all.find(item => item.id === id && item.trashedAt);
if (!memory) throw new Error('notFound');
save('lifeos_memories', all.filter(item => item.id !== id));
- save('lifeos_museum', museum().filter(item => item.memoryId !== id));
+ save('lifeos_museum', allFavorites().filter(item => item.memoryId !== id));
renderAll(); return memory;
}
};
diff --git a/public/i18n-renderers.js b/public/i18n-renderers.js
index 76c5cd3..8c67190 100644
--- a/public/i18n-renderers.js
+++ b/public/i18n-renderers.js
@@ -100,10 +100,10 @@
rootModal().innerHTML = `
${t('timeline.detail')}
${esc(titleOf(memory))}
${uiDate(memory.date)} · ${memory.kind === 'moment' ? t('moments.label') : `${weather(memory.mood)} · ${t('common.energy')} ${memory.energy}`}
${esc(memory.text || t('timeline.noNote')).replace(/\n/g,'
')}
${memory.location ? `
⌖ ${esc(memory.location)}
` : ''}${task ? `
↗ ${esc(t('memory.relatedTask'))}:
` : ''}${(memory.tags || []).length ? `
${memory.tags.map(tag => `# ${esc(tag)}`).join('')}
` : ''}${memory.kind !== 'moment' ? `
${t('today.film')}: ${esc(localizedFilmField(memory,'filmTitle'))}
${esc(localizedFilmField(memory,'filmSubtitle'))}
` : ''}
`;
};
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); };
- window.preserve = id => { const all = museum(), alreadyPreserved = all.some(item => item.memoryId === id); if (alreadyPreserved) { save('lifeos_museum', all.filter(item => item.memoryId !== id)); toast(t('timeline.unpreserved')); } else { save('lifeos_museum', [...all, { id: `artifact_${crypto.randomUUID()}`, memoryId: id, preservedAt: new Date().toISOString() }]); toast(t('timeline.added')); } closeModal(); renderAll(); };
- window.confirmDelete = id => { rootModal().innerHTML = `${t('timeline.confirmDelete')}
${t('timeline.remove')}
${t('timeline.irreversible')}
`; };
- window.deleteMemory = id => { window.LifeOSActions.deleteMemory(id); rootModal().innerHTML = ''; toast(t('timeline.removed')); };
+ window.saveMemoryEdit = (event,id) => { event.preventDefault(); const all=window.LifeOSActions.allMemories(), 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); };
+ window.preserve = id => { const all = window.LifeOSActions.allFavorites(), alreadyPreserved = all.some(item => item.memoryId === id); if (alreadyPreserved) { save('lifeos_museum', all.filter(item => item.memoryId !== id)); toast(t('timeline.unpreserved')); } else { save('lifeos_museum', [...all, { id: `artifact_${crypto.randomUUID()}`, memoryId: id, preservedAt: new Date().toISOString() }]); toast(t('timeline.added')); } closeModal(); renderAll(); };
+ window.confirmDelete = id => { rootModal().innerHTML = `${t('timeline.confirmDelete')}
${t('timeline.remove')}
${t('trash.moveHint')}
`; };
+ window.deleteMemory = id => { window.LifeOSActions.deleteMemory(id); rootModal().innerHTML = ''; toast(t('trash.moved')); };
let insightView = 'week', insightOffset = 0;
const reportDateKey = value => `${value.getFullYear()}-${String(value.getMonth() + 1).padStart(2, '0')}-${String(value.getDate()).padStart(2, '0')}`;
const reportDayNumber = value => Date.UTC(value.getFullYear(), value.getMonth(), value.getDate()) / 864e5;
@@ -156,6 +156,28 @@
container.innerHTML = `${t('system.eyebrow')}
${t('system.title')}
${t('system.appearance')}
${['dark','light','auto'].map(item => ``).join('')}
${t('system.language')}
${detected}
${LifeI18n.supported.map(code => ``).join('')}
${window.LifeOSNotifications?.markup() || ''}${t('system.storage')}
${t('system.local')}
${t('system.storageSummary',{memories:LifeI18n.number(mems().length),museum:LifeI18n.number(museum().length),tasks:LifeI18n.number(sys().tasksBoard?.tasks?.length||0),size:LifeI18n.number(Math.ceil(bytes/1024))})}
${t('system.dataStorage')}
${t('system.stored')}
${t('system.backups')}
${t('system.lastBackup',{value:state.lastBackup ? short(state.lastBackup.slice(0,10)) : t('common.never')})}${oldBackup ? `
${t('system.recommended')}` : ''}
${t('system.version')}
${t('system.release',{version:window.LifeOSVersion||'1.18.1'})}
`;
};
window.importPreview = () => { const data = importData, board = data.system?.tasksBoard || {}; rootModal().innerHTML = `${t('dialog.backup')}
${t('dialog.ready')}
${t('dialog.exported',{date:short(data.exportedAt.slice(0,10))})}
${t('dialog.memories',{count:data.memories.length})}
${t('dialog.museumItems',{count:data.museum.length})}
${t('dialog.goals',{count:board.goals?.length || 0})}
${t('dialog.tasks',{count:board.tasks?.length || 0})}
`; };
+ const trashItems = () => window.LifeOSActions.allMemories().filter(item => item.trashedAt).sort((a,b) => b.trashedAt.localeCompare(a.trashedAt));
+ const baseSystem = window.systemApp;
+ window.systemApp = container => {
+ baseSystem(container);
+ container.querySelector('.settings')?.insertAdjacentHTML('beforeend', `${t('trash.title')}
${t('trash.hint')}
`);
+ };
+ window.openRecycleBin = () => {
+ const items = trashItems();
+ rootModal().innerHTML = `${t('trash.title')}
${t('trash.hint')}
${items.length ? `
${items.map(item => `
${esc(titleOf(item))}${short(item.date)} · ${item.kind === 'moment' ? t('moments.label') : t('app.today')}${t('memory.note')}
${esc(item.text || '')}
`).join('')}
` : `
${t('trash.empty')}
`}
`;
+ };
+ window.restoreTrashedMemory = id => {
+ try { window.LifeOSActions.restoreMemory(id); window.openRecycleBin(); toast(t('trash.restored')); }
+ catch(error) { const node=document.querySelector('#trash-error'); if(node) node.textContent=t(error.message === 'memoryExists' ? 'trash.dateConflict' : 'trash.unavailable'); }
+ };
+ window.confirmPurgeMemory = id => {
+ const item=trashItems().find(memory=>memory.id===id); if(!item) return;
+ rootModal().innerHTML = `${t('trash.purgeQuestion')}
${esc(titleOf(item))}
${t('trash.purgeHint')}
`;
+ };
+ window.purgeTrashedMemory = id => { try { window.LifeOSActions.purgeMemory(id); window.openRecycleBin(); toast(t('trash.purged')); } catch { window.openRecycleBin(); } };
+ const trashStyle = document.createElement('style');
+ trashStyle.textContent = `.trash-panel{width:min(650px,calc(100vw - 28px));max-height:calc(100dvh - 28px);overflow:auto}.trash-panel h2{font-size:24px;letter-spacing:0}.trash-list{display:grid;gap:12px}.trash-item{border:1px solid var(--line);background:var(--panel2);border-radius:10px;padding:14px;min-width:0}.trash-item>strong{display:block;font-size:16px;overflow-wrap:anywhere}.trash-item>small{display:block;font-size:12px;color:var(--muted);margin:7px 0}.trash-item details{font-size:14px}.trash-item details p{white-space:pre-wrap;overflow-wrap:anywhere;max-height:180px;overflow:auto;line-height:1.6}.trash-item .actions{flex-wrap:wrap}#trash-error{color:#eea27d;font-size:14px}`;
+ document.head.append(trashStyle);
window.replaceConfirm = () => { rootModal().innerHTML = `${t('dialog.final')}
${t('dialog.replaceQuestion')}
${t('dialog.replaceWarning')}
`; };
window.applyImport = mode => {
const data = importData;
@@ -164,10 +186,10 @@
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.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; });
+ const memories = window.LifeOSActions.allMemories(), ids = new Set(memories.map(item => item.id)), dates = new Set(memories.filter(item => !item.trashedAt && item.kind !== 'moment').map(item => item.date));
+ const additions = data.memories.filter(item => { if (ids.has(item.id) || (!item.trashedAt && item.kind !== 'moment' && dates.has(item.date))) return false; ids.add(item.id); if (!item.trashedAt && 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));
+ const artifacts = window.LifeOSActions.allFavorites(), 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;
if (importedBoard && Array.isArray(importedBoard.goals) && Array.isArray(importedBoard.tasks)) {
diff --git a/public/index.html b/public/index.html
index 40e1349..b1e2723 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('')}
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=`LIFE OS BACKUP
Ready to restore
Exported: ${fmtDate(d.exportedAt.slice(0,10))}
Memories: ${d.memories.length}
Museum Items: ${d.museum.length}
`}function replaceConfirm(){modal.innerHTML=`FINAL CONFIRMATION
Replace all Life OS data?
This will replace all current Life OS data.
`}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=`RESET LIFE OS
Reset all local data?
Export a backup first if you want to keep it.
`}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;
-