Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

slides: Save a copy keeps you on the original; older-copy warning; recovery-off notice (1.2.8) (#713)

nyblnetfafecfd49432
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9a68d495..1950fc2e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2402,6 +2402,19 @@ jobs:
# during a write stays dirty, writes never overlap, the dot goes out
# only when the deck on screen is the one on disk.
run: node scripts/test-slides-save-browser.mjs
+ - name: Recovery-off notice in Chromium
+ # Under a per-document store host that refuses the recovery copy, the
+ # save status says crash recovery is off (approved wording), once, held
+ # long enough to read; the dot stops claiming a backup; a host that
+ # keeps the copy gets no message; never for an encrypted deck.
+ run: node scripts/test-slides-recovery-off-browser.mjs
+ - name: Save a copy and the older-snapshot banner in Chromium
+ # "Save a copy…" says "Copy saved — you are still editing the original",
+ # keeps the chip, title and dot on the original, and the next ⌘S writes
+ # the original with no picker; an older recovery snapshot gets the
+ # warning banner (Keep the file is the default and deletes nothing), a
+ # newer one the plain banner that claims nothing.
+ run: node scripts/test-slides-save-copy-browser.mjs
- name: Ghost Cut in Chromium
# ⇧⌘X fades the selection by CSS (shadowed elements too) and copies it;
# a ghost is never selected and the pointer passes through it; Esc
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7959263a..4eec9d8c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,31 @@ pre-1.0.
## [Unreleased]
+- **You're told when a deck has no crash backup.** Opened through bento/home,
+ a deck's crash-recovery copy is kept by the app; when a deck is too large for
+ it, the editor now says "Crash recovery is off for this deck — it’s too large
+ to keep a backup copy. Save often." once, where the save status shows, and
+ the unsaved-changes dot stops saying your work is kept in this browser.
+ Encrypted decks are never backed up there, so they never show it.
+
+- **Save a copy no longer makes the original forget its file.** After "Save a
+ copy…", the next ⌘S could ask where to save again, or write the copy instead
+ of the file you were working in. It now saves the original, in place, with no
+ picker (#556, #696).
+
+- **Save a copy keeps you on the original.** "Save a copy…" writes the copy and
+ leaves you editing the file you opened: the toast now says "Copy saved — you
+ are still editing the original" instead of "Saved", and the file name, the
+ unsaved-changes dot and live sharing stay with the original until you save it.
+
+- **A recovered copy that looks older says so.** When the crash-recovery copy
+ this browser kept is older than the file you just opened, the banner now
+ warns "This recovered copy looks older than the file you opened. Keep the
+ file unless you know it’s newer.", with "Keep the file" as the default and
+ "Restore anyway" beside it. Keeping the file leaves the recovered copy in
+ place rather than deleting it, because the two times can come from different
+ devices' clocks.
+
- **Count-up leaves versions and addresses alone.** On a text box that counts
up, a run of digits that isn't a number — a version like `1.2.3`, an address
like `192.168.1.1` — used to be animated too and settle rewritten (`1.2.3`
diff --git a/scripts/test-slides-recovery-off-browser.mjs b/scripts/test-slides-recovery-off-browser.mjs
new file mode 100644
index 00000000..c2f9a74f
--- /dev/null
+++ b/scripts/test-slides-recovery-off-browser.mjs
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// When the host refuses a deck's recovery copy, the editor says so — once.
+//
+// npm run build:single --prefix slides && node scripts/test-slides-recovery-off-browser.mjs
+//
+// WHAT THIS PROVES (maintainer-approved wording, 2026-10-15). Under a host with
+// a per-document store (bento/home), crash recovery lives in the host; when it
+// refuses a deck's copy (too large) there is no backstop any more, and the
+// kernel's onRecoveryOff fires. Then, in the packaged editor:
+// 1. the save status shows "Crash recovery is off for this deck — it’s too
+// large to keep a backup copy. Save often." and holds it long enough to
+// read;
+// 2. it says so ONCE per deck: the next refused autosave stays quiet;
+// 3. the unsaved dot's tooltip stops claiming the work is "kept in this
+// browser";
+// 4. a host that keeps the copy gets no such message (the control);
+// 5. never for an encrypted deck (checked at source: an encrypted deck is
+// never snapshotted, and the notice refuses to speak for one).
+// The page plays the host: it announces `store` and answers the editor's
+// postMessage requests, refusing or keeping `recovery` per run.
+import { readFileSync } from 'node:fs'
+const { chromium } = await import(process.env.PLAYWRIGHT_MODULE || 'playwright')
+
+let checks = 0
+let failures = 0
+function ok(cond, msg) {
+ checks++
+ if (!cond) { failures++; console.log(` FAIL ${msg}`) } else console.log(` ok ${msg}`)
+}
+const NOTICE = 'Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.'
+const shell = new URL('../slides/dist-single/Bento_Slides.bento.html', import.meta.url).href
+
+async function run(refuse) {
+ const browser = await chromium.launch({ executablePath: process.env.CHROME_PATH, headless: true })
+ try {
+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } })
+ await ctx.route(/^https?:/, (r) => r.abort())
+ await ctx.addInitScript((refuseRecovery) => {
+ window.__bentoHost = { ops: ['store'] }
+ window.__sets = 0
+ window.__notices = 0
+ const CH = '__bento_tray__'
+ window.addEventListener('message', (ev) => {
+ const d = ev.data
+ if (!d || d[CH] !== true || d.dir !== 'req') return
+ let result = { ok: true }
+ if (d.op === 'store.set' && d.payload?.name === 'recovery') { window.__sets++; result = refuseRecovery ? { ok: false, reason: 'too-large' } : { ok: true } }
+ if (d.op === 'store.get') result = { ok: true, bytes: null }
+ if (d.op === 'store.list') result = { ok: true, names: [] }
+ window.postMessage({ [CH]: true, dir: 'res', id: d.id, result }, '*')
+ })
+ // count every time the save status is set to the notice
+ new MutationObserver(() => {
+ const tag = document.querySelector('.ed-autosaved')
+ if (tag && tag.textContent.startsWith('Crash recovery is off') && tag.dataset.counted !== tag.textContent + tag.className) {
+ if (tag.classList.contains('show')) { window.__notices++; tag.dataset.counted = tag.textContent + tag.className }
+ }
+ }).observe(document, { subtree: true, childList: true, characterData: true, attributes: true, attributeFilter: ['class'] })
+ }, refuse)
+ const p = await ctx.newPage()
+ const errors = []
+ p.on('pageerror', (e) => errors.push(e.message))
+ await p.goto(shell)
+ await p.waitForFunction(() => window.bento?.doc && document.querySelector('.ed-title'))
+ const edit = async (v) => {
+ await p.locator('.ed-title').fill(v)
+ await p.locator('.ed-title').press('Tab')
+ await p.waitForTimeout(3200) // the 2.5s autosave debounce, then the host's answer
+ }
+ await edit('First edit')
+ const first = await p.evaluate(() => {
+ const tag = document.querySelector('.ed-autosaved')
+ return { text: tag?.textContent ?? '', shown: !!tag?.classList.contains('show'), sets: window.__sets, notices: window.__notices, dotTitle: document.querySelector('.ed-dirty')?.title ?? '' }
+ })
+ await p.waitForTimeout(2500) // still up after the normal 1.4s a "Saved" lasts
+ const held = await p.evaluate(() => !!document.querySelector('.ed-autosaved')?.classList.contains('show'))
+ await edit('Second edit')
+ const second = await p.evaluate(() => ({ sets: window.__sets, notices: window.__notices }))
+ return { first, held, second, errors }
+ } finally { await browser.close() }
+}
+
+console.log('\na host that refuses the recovery copy\n')
+{
+ const r = await run(true)
+ ok(r.first.sets >= 1, `the editor asked the host to keep a recovery copy (${r.first.sets})`)
+ ok(r.first.shown && r.first.text === NOTICE, `the save status says recovery is off ("${r.first.text}")`)
+ ok(r.held, 'and holds it long enough to read')
+ ok(!/kept in this browser/.test(r.first.dotTitle), `the unsaved dot no longer claims a backup ("${r.first.dotTitle}")`)
+ // once per deck is the kernel's promise (after a refusal it stops asking the host); the editor keeps its own guard too
+ ok(r.second.notices === 1, `said once: a later autosave stays quiet (${r.second.notices} notice)`)
+ ok(r.errors.length === 0, `no page errors${r.errors.length ? ': ' + r.errors.join('; ') : ''}`)
+}
+
+console.log('\na host that keeps it (the control)\n')
+{
+ const r = await run(false)
+ ok(r.first.sets >= 1 && r.second.notices === 0 && r.first.text !== NOTICE, `no recovery-off message (${r.second.notices})`)
+}
+
+console.log('\nnever for an encrypted deck\n')
+{
+ const src = readFileSync(new URL('../slides/src/editor/editor.ts', import.meta.url), 'utf8')
+ const fn = src.slice(src.indexOf('private noticeRecoveryOff('), src.indexOf('private noticeRecoveryOff(') + 700)
+ ok(/onRecoveryOff\(\(docId\) => this\.noticeRecoveryOff\(docId\)\)/.test(src), 'the editor listens to the kernel\'s onRecoveryOff')
+ ok(/if \(docId !== this\.store\.doc\.docId \|\| isEncryptionActive\(\) \|\| this\.recoveryOffSaid\.has\(docId\)\) return/.test(fn),
+ 'the notice refuses an encrypted deck, another deck, and a second telling')
+}
+
+console.log(`\n${checks - failures}/${checks} checks passed`)
+process.exit(failures ? 1 : 0)
diff --git a/scripts/test-slides-restore-gate.ts b/scripts/test-slides-restore-gate.ts
index 7f328268..0ee6ec37 100644
--- a/scripts/test-slides-restore-gate.ts
+++ b/scripts/test-slides-restore-gate.ts
@@ -116,7 +116,9 @@ console.log('\nevery restore path uses the gate\n')
{
const src = readFileSync(join(root, 'slides/src/editor/editor.ts'), 'utf8')
const check = src.slice(src.indexOf('private async checkRecovery()'), src.indexOf('private async checkRecovery()') + 900)
- const banner = src.slice(src.indexOf('private showRecoveryBanner('), src.indexOf('private showRecoveryBanner(') + 1400)
+ // to the end of the method (its closing brace at class indent), not a fixed byte count that goes stale as the banner grows
+ const bannerAt = src.indexOf('private showRecoveryBanner(')
+ const banner = src.slice(bannerAt, src.indexOf('\n }\n', bannerAt))
const history = src.slice(src.indexOf('private async openVersionHistory()'), src.indexOf('private async openVersionHistory()') + 2400)
ok(/gateRestored\(snap\.json, doc\)/.test(check), 'the recovery check gates before offering')
ok(/gateRestored\(snap\.json, this\.store\.doc\)[\s\S]*replaceDoc\(gated\.doc\)/.test(banner), 'Restore gates against the CURRENT document, then applies the gated one')
diff --git a/scripts/test-slides-save-copy-browser.mjs b/scripts/test-slides-save-copy-browser.mjs
new file mode 100644
index 00000000..00e5dacb
--- /dev/null
+++ b/scripts/test-slides-save-copy-browser.mjs
@@ -0,0 +1,171 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// "Save a copy…" keeps you on the original, and the recovery banner warns when
+// its copy looks older than the file.
+//
+// npm run build:single --prefix slides && node scripts/test-slides-save-copy-browser.mjs
+//
+// WHAT THIS PROVES, in the packaged editor (maintainer rulings 2026-10-15):
+// 1. after ⌘S to one file, an edit, then Save as → Save a copy… to another:
+// the toast is "Copy saved — you are still editing the original" (never
+// "Saved"), the file chip and the window title still name the original,
+// the unsaved dot stays on, and the next ⌘S writes the ORIGINAL file with
+// no picker;
+// 2. a recovery snapshot OLDER than the file's own `modified` time gets the
+// warning banner — "This recovered copy looks older than the file you
+// opened. Keep the file unless you know it’s newer." — with "Keep the
+// file" first and focused, and "Restore anyway"; keeping the file does not
+// delete the snapshot;
+// 3. a snapshot that is NOT older gets the plain banner, which claims
+// nothing about "newer" or "safe".
+import { readFileSync, writeFileSync, mkdtempSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+const { chromium } = await import(process.env.PLAYWRIGHT_MODULE || 'playwright')
+
+let checks = 0
+let failures = 0
+function ok(cond, msg) {
+ checks++
+ if (!cond) { failures++; console.log(` FAIL ${msg}`) } else console.log(` ok ${msg}`)
+}
+const COPY_TOAST = 'Copy saved — you are still editing the original'
+const OLDER = 'This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.'
+const shellPath = new URL('../slides/dist-single/Bento_Slides.bento.html', import.meta.url)
+
+const browser = await chromium.launch({ executablePath: process.env.CHROME_PATH, headless: true })
+try {
+ console.log('\nSave a copy… keeps you on the original\n')
+ {
+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } })
+ await ctx.route(/^https?:/, (r) => r.abort())
+ await ctx.addInitScript(() => {
+ window.__picks = []
+ window.__writes = []
+ const names = ['original.bento.html', 'copy.bento.html']
+ const handleFor = (name) => ({
+ kind: 'file', name,
+ async queryPermission() { return 'granted' },
+ async requestPermission() { return 'granted' },
+ async isSameEntry(o) { return o?.name === name },
+ async createWritable() { return { async write(b) { window.__writes.push(name); void b }, async close() {} } },
+ })
+ window.showSaveFilePicker = async () => { const n = names[Math.min(window.__picks.length, names.length - 1)]; window.__picks.push(n); return handleFor(n) }
+ })
+ const p = await ctx.newPage()
+ const errors = []
+ p.on('pageerror', (e) => errors.push(e.message))
+ p.on('dialog', (d) => d.accept())
+ await p.goto(shellPath.href)
+ await p.waitForFunction(() => window.bento?.doc && document.querySelector('.ed-title'))
+ const toast = () => p.evaluate(() => document.querySelector('.ed-toast')?.textContent ?? '')
+ const state = () => p.evaluate(() => ({
+ chip: document.querySelector('.ed-filechip')?.textContent ?? '',
+ title: document.title,
+ dirty: !!document.querySelector('.ed-dirty.on'),
+ picks: [...window.__picks], writes: [...window.__writes],
+ }))
+ await p.locator('.ed-title').fill('Quarterly review')
+ await p.locator('.ed-title').press('Tab')
+ await p.keyboard.press('ControlOrMeta+s')
+ await p.waitForFunction(() => window.__writes.length >= 1)
+ await p.waitForTimeout(300)
+ const afterSave = await state()
+ ok(afterSave.writes[0] === 'original.bento.html' && !afterSave.dirty, `⌘S wrote original.bento.html and the dot went out (${afterSave.writes})`)
+ // an edit, then Save as → Save a copy…
+ await p.locator('.ed-title').fill('Quarterly review v2')
+ await p.locator('.ed-title').press('Tab')
+ const before = await state()
+ await p.evaluate(() => document.querySelector('.ed-split-caret').click())
+ await p.evaluate(() => [...document.querySelectorAll('.ed-save-menu > .ed-btn')].find((b) => (b.getAttribute('aria-label') ?? b.textContent).startsWith('Save a copy')).click())
+ await p.waitForFunction(() => window.__writes.includes('copy.bento.html'))
+ await p.waitForTimeout(300)
+ const afterCopy = await state()
+ const t = await toast()
+ ok(t === COPY_TOAST, `the toast says the copy is saved and you are on the original ("${t}")`)
+ ok(afterCopy.chip === before.chip && afterCopy.title === before.title, `the file chip and window title still name the original ("${afterCopy.chip}" / "${afterCopy.title}")`)
+ ok(afterCopy.dirty, 'the unsaved dot stays on: the original has not been saved')
+ await p.keyboard.press('ControlOrMeta+s')
+ await p.waitForFunction((n) => window.__writes.length > n, afterCopy.writes.length)
+ await p.waitForTimeout(300)
+ const afterResave = await state()
+ ok(afterResave.writes.at(-1) === 'original.bento.html' && afterResave.picks.length === afterCopy.picks.length,
+ `the next ⌘S writes the original, with no picker (${afterResave.writes.join(' → ')})`)
+ ok(!afterResave.dirty && (await toast()) === 'Saved', 'and that save is a real "Saved" of the original')
+ ok(errors.length === 0, `no page errors${errors.length ? ': ' + errors.join('; ') : ''}`)
+ await ctx.close()
+ }
+
+ // A saved deck with a fixed docId and modified time, spliced into the shell.
+ const shell = readFileSync(shellPath, 'utf8')
+ const open = '<script type="application/bento+json" id="bento-doc">'
+ const i = shell.indexOf(open) + open.length, j = shell.indexOf('</' + 'script>', i)
+ const dir = mkdtempSync(join(tmpdir(), 'bento-recovery-'))
+ const deckFile = join(dir, 'deck.bento.html')
+ const page = await browser.newPage()
+ await page.route(/^https?:/, (r) => r.abort())
+ await page.goto(shellPath.href)
+ await page.waitForFunction(() => window.bento?.doc)
+ const MODIFIED = '2026-10-10T12:00:00.000Z'
+ const doc = await page.evaluate((m) => { const d = JSON.parse(JSON.stringify(window.bento.doc)); d.docId = 'rig-recovery-deck'; d.modified = m; delete d.collab; return d }, MODIFIED)
+ await page.close()
+ writeFileSync(deckFile, shell.slice(0, i) + JSON.stringify(doc).replace(/</g, '\\u003c') + shell.slice(j))
+
+ async function withSnapshot(at) {
+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } })
+ await ctx.route(/^https?:/, (r) => r.abort())
+ const p = await ctx.newPage()
+ await p.goto('file://' + deckFile)
+ await p.waitForFunction(() => window.bento?.doc)
+ await p.evaluate(async ([d, when]) => {
+ // the app's own store (kernel autosave: `${appId}-autosave`), NOT the legacy shared `bento-autosave` it migrates from
+ const db = await new Promise((res, rej) => { const r = indexedDB.open('bento-slides-autosave'); r.onsuccess = () => res(r.result); r.onerror = () => rej(r.error) })
+ const snap = JSON.parse(JSON.stringify(d)); snap.title = 'Recovered edits'
+ await new Promise((res, rej) => { const tx = db.transaction('recovery', 'readwrite'); tx.objectStore('recovery').put({ docId: d.docId, at: when, title: snap.title, json: JSON.stringify(snap) }); tx.oncomplete = res; tx.onerror = () => rej(tx.error) })
+ db.close()
+ }, [doc, at])
+ await p.reload()
+ await p.waitForFunction(() => window.bento?.doc)
+ await p.waitForSelector('.ed-recover', { timeout: 8000 }).catch(() => {})
+ return { ctx, p }
+ }
+
+ console.log('\nan older snapshot: the warning banner\n')
+ {
+ const { ctx, p } = await withSnapshot(Date.parse(MODIFIED) - 86_400_000)
+ const b = await p.evaluate(() => {
+ const bar = document.querySelector('.ed-recover')
+ return bar ? { text: bar.querySelector('span')?.textContent ?? '', buttons: [...bar.querySelectorAll('button')].map((x) => x.textContent), focused: document.activeElement?.textContent ?? '' } : null
+ })
+ ok(!!b && b.text === OLDER, `the banner warns the copy looks older ("${b?.text}")`)
+ ok(!!b && b.buttons[0] === 'Keep the file' && b.buttons[1] === 'Restore anyway', `"Keep the file" first, then "Restore anyway" (${b?.buttons.join(' · ')})`)
+ ok(!!b && b.focused === 'Keep the file', 'keeping the file is the default (focused)')
+ await p.evaluate(() => [...document.querySelectorAll('.ed-recover button')].find((x) => x.textContent === 'Keep the file').click())
+ await p.waitForTimeout(1000) // long enough for an async IndexedDB delete to land, were one issued
+ const kept = await p.evaluate(async () => {
+ const gone = !document.querySelector('.ed-recover')
+ const db = await new Promise((res) => { const r = indexedDB.open('bento-slides-autosave'); r.onsuccess = () => res(r.result) })
+ const snap = await new Promise((res) => { const r = db.transaction('recovery').objectStore('recovery').get('rig-recovery-deck'); r.onsuccess = () => res(r.result) })
+ return { gone, snap: snap ? { at: snap.at, title: snap.title } : null, title: window.bento.doc.title }
+ })
+ ok(kept.gone && kept.title !== 'Recovered edits', 'Keep the file closes the banner and keeps the file')
+ ok(kept.snap?.title === 'Recovered edits' && kept.snap?.at === Date.parse(MODIFIED) - 86_400_000,
+ `without deleting the planted snapshot (a clock-skewed "older" must never cost work) (${JSON.stringify(kept.snap)})`)
+ await ctx.close()
+ }
+
+ console.log('\na snapshot that is not older: the plain banner\n')
+ {
+ const { ctx, p } = await withSnapshot(Date.parse(MODIFIED) + 86_400_000)
+ const b = await p.evaluate(() => {
+ const bar = document.querySelector('.ed-recover')
+ return bar ? { text: bar.textContent ?? '', buttons: [...bar.querySelectorAll('button')].map((x) => x.textContent) } : null
+ })
+ ok(!!b && b.text.startsWith('Unsaved changes from ') && b.buttons.join(',') === 'Restore,Discard', `the plain banner (${b?.buttons.join(' · ')})`)
+ ok(!!b && !/newer|older|safe/i.test(b.text), `and it claims nothing about newer, older or safe ("${b?.text}")`)
+ await ctx.close()
+ }
+} finally { await browser.close() }
+
+console.log(`\n${checks - failures}/${checks} checks passed`)
+process.exit(failures ? 1 : 0)
diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.ts
index 60419c82..7872aad7 100644
--- a/slides/src/editor/editor.ts
+++ b/slides/src/editor/editor.ts
@@ -29,7 +29,7 @@ import { adoptFileHandle, canWriteInPlace, currentFileName, fileBase, hasFileHan
import { createSaveQueue, saveRevision } from '../saving'
import type { SaveQueue } from '../../../kernel/src/savequeue.ts'
import { noteSavedFromWeb } from './returngate'
-import { addVersion, clearRecovery, clearVersions, docContentKey, getRecovery, listVersions, pruneOld, putRecovery, type Snapshot } from '../autosave'
+import { addVersion, clearRecovery, clearVersions, docContentKey, getRecovery, listVersions, onRecoveryOff, pruneOld, putRecovery, recoveryLooksOlder, type Snapshot } from '../autosave'
import { insertElements, insertSlides, parseClip, serializeElements, serializeSlides } from './clipboard'
import { estimatedFrames, fencedElements, splitFences } from './codefence'
import { openSpeakerWindow, speakerIdleBody } from '../screens'
@@ -2640,6 +2640,27 @@ export class Editor {
this.noticeIfCannotWriteInPlace()
this.noticeIfJustUpdated()
this.store.on('doc', () => this.scheduleAutosave())
+ onRecoveryOff((docId) => this.noticeRecoveryOff(docId))
+ }
+
+ /** Decks told, in this page, that their crash recovery is off — once each. */
+ private recoveryOffSaid = new Set<string>()
+
+ /**
+ * A host with a per-document store (bento/home) refused this deck's recovery
+ * copy, so from now on there is NO crash backstop for it. Say so, once, where
+ * the save status shows, and stop the unsaved dot's tooltip claiming the work
+ * is "kept in this browser". Never for an encrypted deck: those are never
+ * snapshotted, so there was no backstop to lose.
+ */
+ private noticeRecoveryOff(docId: string) {
+ if (docId !== this.store.doc.docId || isEncryptionActive() || this.recoveryOffSaid.has(docId)) return
+ this.recoveryOffSaid.add(docId)
+ this.lastBackupAt = 0
+ this.dirtyDot.title = canWriteInPlace()
+ ? t('Unsaved changes — ⌘S saves this file in place')
+ : t('Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)')
+ this.flashSaved(t('Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.'), 8000)
}
private scheduleAutosave() {
@@ -2905,11 +2926,19 @@ export class Editor {
document.querySelector('.ed-recover')?.remove()
const bar = div('ed-recover')
const when = new Date(snap.at).toLocaleString([], { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' })
+ // The kernel's SIGNAL (recoveryLooksOlder): the snapshot is older than the
+ // file now open. It only changes the words and the default — the snapshot is
+ // still offered, and a false "older" (two devices' clocks) must never cost
+ // work, so "Keep the file" dismisses without deleting it. When the signal is
+ // false the banner is the plain one and claims nothing ("newer", "safe").
+ const older = recoveryLooksOlder(snap, this.store.doc)
const msg = document.createElement('span')
- msg.textContent = t('Unsaved changes from {when} were found.', { when })
+ msg.textContent = older
+ ? t('This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.')
+ : t('Unsaved changes from {when} were found.', { when })
const restore = document.createElement('button')
- restore.className = 'ed-btn ed-btn-primary'
- restore.textContent = t('Restore')
+ restore.className = older ? 'ed-btn' : 'ed-btn ed-btn-primary'
+ restore.textContent = older ? t('Restore anyway') : t('Restore')
restore.addEventListener('click', () => {
// gated again against the document as it is NOW: the live session may
// have been joined or rotated since the banner appeared, and the identity
@@ -2922,6 +2951,16 @@ export class Editor {
bar.remove()
this.toast(t('Restored your unsaved changes'))
})
+ if (older) {
+ const keep = document.createElement('button')
+ keep.className = 'ed-btn ed-btn-primary'
+ keep.textContent = t('Keep the file')
+ keep.addEventListener('click', () => bar.remove())
+ bar.append(msg, keep, restore)
+ document.body.appendChild(bar)
+ keep.focus() // keeping the file is the default
+ return
+ }
const dismiss = document.createElement('button')
dismiss.className = 'ed-btn'
dismiss.textContent = t('Discard')
@@ -3082,7 +3121,7 @@ export class Editor {
}
private savedTimer = 0
- private flashSaved(message = t('Saved')) {
+ private flashSaved(message = t('Saved'), holdMs = 1400) {
const title = document.querySelector<HTMLElement>('.ed-topbar .ed-title')
const bar = title?.parentElement
if (!title || !bar) return
@@ -3098,7 +3137,7 @@ export class Editor {
void tag.offsetWidth // paint a frame at opacity 0 so the fade-in runs
tag.classList.add('show')
clearTimeout(this.savedTimer)
- this.savedTimer = window.setTimeout(() => tag!.classList.remove('show'), 1400)
+ this.savedTimer = window.setTimeout(() => tag!.classList.remove('show'), holdMs)
}
async save(forcePicker: boolean) {
@@ -3119,6 +3158,14 @@ export class Editor {
return
}
const result = out.result
+ // "Save a copy…" wrote ANOTHER file and leaves you editing this one (#705):
+ // nothing about the open deck changes — not its title, file chip, ⌘S target
+ // or sharing, and its unsaved dot stays (saving.ts). Saying "Saved" here, or
+ // retitling to the copy, would claim the deck had become the copy.
+ if ((result as string) === 'copied') {
+ this.toast(t('Copy saved — you are still editing the original'))
+ return
+ }
try {
// the file name is knowable from here on — put it in the tab and the chip
this.syncWindowTitle()
diff --git a/slides/src/i18n/de.ts b/slides/src/i18n/de.ts
index e5b53a56..fee309cd 100644
--- a/slides/src/i18n/de.ts
+++ b/slides/src/i18n/de.ts
@@ -46,6 +46,7 @@ export const de: Catalog = {
"Laser pointer (L)": "Laserpointer (L)",
"Toggle laser pointer while presenting": "Laserpointer während der Präsentation ein-/ausschalten",
"Backed up in this browser": "In diesem Browser gesichert",
+ "Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.": "Die Absturzwiederherstellung ist für diese Präsentation deaktiviert – sie ist zu groß für eine Sicherungskopie. Speichern Sie häufig.",
"Unsaved changes — kept in this browser at {when} and offered back if you reopen. ⌘S downloads an updated copy.": "Nicht gespeicherte Änderungen — um {when} in diesem Browser gesichert und beim erneuten Öffnen angeboten. ⌘S lädt eine aktualisierte Kopie herunter.",
"Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)": "Nicht gespeicherte Änderungen — ⌘S lädt eine aktualisierte Kopie herunter (dieser Browser kann die Datei nicht überschreiben)",
"Save — download an updated copy (⌘S). This browser can’t rewrite the open file.": "Speichern — aktualisierte Kopie herunterladen (⌘S). Dieser Browser kann die geöffnete Datei nicht überschreiben.",
@@ -457,6 +458,10 @@ export const de: Catalog = {
"Stop tracking the table; the chart keeps its current data": "Die Tabelle nicht mehr verfolgen; das Diagramm behält seine aktuellen Daten",
"Chart created — it updates live with the table": "Diagramm erstellt — es aktualisiert sich live mit der Tabelle",
"Unsaved changes from {when} were found.": "Nicht gespeicherte Änderungen von {when} gefunden.",
+ "Copy saved — you are still editing the original": "Kopie gespeichert — Sie bearbeiten weiterhin das Original",
+ "This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.": "Diese wiederhergestellte Kopie scheint älter zu sein als die geöffnete Datei. Behalten Sie die Datei, es sei denn, Sie wissen, dass die Kopie neuer ist.",
+ "Keep the file": "Datei behalten",
+ "Restore anyway": "Trotzdem wiederherstellen",
"Restore": "Wiederherstellen",
"Restored your unsaved changes": "Nicht gespeicherte Änderungen wiederhergestellt",
"Discard": "Verwerfen",
diff --git a/slides/src/i18n/es.ts b/slides/src/i18n/es.ts
index 53b09206..f06defa0 100644
--- a/slides/src/i18n/es.ts
+++ b/slides/src/i18n/es.ts
@@ -46,6 +46,7 @@ export const es: Catalog = {
"Laser pointer (L)": "Puntero láser (L)",
"Toggle laser pointer while presenting": "Activar o desactivar el puntero láser durante la presentación",
"Backed up in this browser": "Copia guardada en este navegador",
+ "Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.": "La recuperación tras fallos está desactivada para esta presentación: es demasiado grande para guardar una copia de seguridad. Guarda a menudo.",
"Unsaved changes — kept in this browser at {when} and offered back if you reopen. ⌘S downloads an updated copy.": "Cambios sin guardar — conservados en este navegador a las {when} y se te ofrecerán al reabrir. ⌘S descarga una copia actualizada.",
"Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)": "Cambios sin guardar — ⌘S descarga una copia actualizada (este navegador no puede reescribir el archivo)",
"Save — download an updated copy (⌘S). This browser can’t rewrite the open file.": "Guardar — descargar una copia actualizada (⌘S). Este navegador no puede reescribir el archivo abierto.",
@@ -457,6 +458,10 @@ export const es: Catalog = {
"Stop tracking the table; the chart keeps its current data": "Deja de seguir la tabla; el gráfico conserva sus datos actuales",
"Chart created — it updates live with the table": "Gráfico creado — se actualiza en vivo con la tabla",
"Unsaved changes from {when} were found.": "Se encontraron cambios sin guardar de {when}.",
+ "Copy saved — you are still editing the original": "Copia guardada: sigues editando el original",
+ "This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.": "Esta copia recuperada parece más antigua que el archivo que abriste. Conserva el archivo, salvo que sepas que la copia es más reciente.",
+ "Keep the file": "Conservar el archivo",
+ "Restore anyway": "Restaurar de todos modos",
"Restore": "Restaurar",
"Restored your unsaved changes": "Cambios sin guardar restaurados",
"Discard": "Descartar",
diff --git a/slides/src/i18n/fr.ts b/slides/src/i18n/fr.ts
index 8eaf1134..407fea4d 100644
--- a/slides/src/i18n/fr.ts
+++ b/slides/src/i18n/fr.ts
@@ -46,6 +46,7 @@ export const fr: Catalog = {
"Laser pointer (L)": "Pointeur laser (L)",
"Toggle laser pointer while presenting": "Activer ou désactiver le pointeur laser pendant la présentation",
"Backed up in this browser": "Sauvegardé dans ce navigateur",
+ "Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.": "La récupération après plantage est désactivée pour ce deck : il est trop volumineux pour en garder une copie de secours. Enregistrez souvent.",
"Unsaved changes — kept in this browser at {when} and offered back if you reopen. ⌘S downloads an updated copy.": "Modifications non enregistrées — conservées dans ce navigateur à {when} et proposées à la réouverture. ⌘S télécharge une copie à jour.",
"Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)": "Modifications non enregistrées — ⌘S télécharge une copie à jour (ce navigateur ne peut pas réécrire le fichier)",
"Save — download an updated copy (⌘S). This browser can’t rewrite the open file.": "Enregistrer — télécharger une copie à jour (⌘S). Ce navigateur ne peut pas réécrire le fichier ouvert.",
@@ -457,6 +458,10 @@ export const fr: Catalog = {
"Stop tracking the table; the chart keeps its current data": "Ne plus suivre le tableau ; le graphique conserve ses données actuelles",
"Chart created — it updates live with the table": "Graphique créé — il se met à jour en direct avec le tableau",
"Unsaved changes from {when} were found.": "Modifications non enregistrées du {when} trouvées.",
+ "Copy saved — you are still editing the original": "Copie enregistrée — vous modifiez toujours l'original",
+ "This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.": "Cette copie récupérée semble plus ancienne que le fichier ouvert. Gardez le fichier, sauf si vous savez qu’elle est plus récente.",
+ "Keep the file": "Garder le fichier",
+ "Restore anyway": "Restaurer quand même",
"Restore": "Restaurer",
"Restored your unsaved changes": "Modifications non enregistrées restaurées",
"Discard": "Ignorer",
diff --git a/slides/src/i18n/it.ts b/slides/src/i18n/it.ts
index 52c0d889..2adae19b 100644
--- a/slides/src/i18n/it.ts
+++ b/slides/src/i18n/it.ts
@@ -46,6 +46,7 @@ export const it: Catalog = {
"Laser pointer (L)": "Puntatore laser (L)",
"Toggle laser pointer while presenting": "Attiva/disattiva il puntatore laser durante la presentazione",
"Backed up in this browser": "Salvato in questo browser",
+ "Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.": "Il ripristino dopo un arresto anomalo è disattivato per questa presentazione: è troppo grande per conservarne una copia di backup. Salva spesso.",
"Unsaved changes — kept in this browser at {when} and offered back if you reopen. ⌘S downloads an updated copy.": "Modifiche non salvate — conservate in questo browser alle {when} e riproposte alla riapertura. ⌘S scarica una copia aggiornata.",
"Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)": "Modifiche non salvate — ⌘S scarica una copia aggiornata (questo browser non può riscrivere il file)",
"Save — download an updated copy (⌘S). This browser can’t rewrite the open file.": "Salva — scarica una copia aggiornata (⌘S). Questo browser non può riscrivere il file aperto.",
@@ -457,6 +458,10 @@ export const it: Catalog = {
"Stop tracking the table; the chart keeps its current data": "Smetti di seguire la tabella; il grafico mantiene i suoi dati attuali",
"Chart created — it updates live with the table": "Grafico creato — si aggiorna in tempo reale con la tabella",
"Unsaved changes from {when} were found.": "Trovate modifiche non salvate del {when}.",
+ "Copy saved — you are still editing the original": "Copia salvata: stai ancora modificando l'originale",
+ "This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.": "Questa copia recuperata sembra più vecchia del file che hai aperto. Tieni il file, a meno che tu non sappia che la copia è più recente.",
+ "Keep the file": "Tieni il file",
+ "Restore anyway": "Ripristina comunque",
"Restore": "Ripristina",
"Restored your unsaved changes": "Modifiche non salvate ripristinate",
"Discard": "Ignora",
diff --git a/slides/src/i18n/ja.ts b/slides/src/i18n/ja.ts
index 4a60dc7d..b85253b8 100644
--- a/slides/src/i18n/ja.ts
+++ b/slides/src/i18n/ja.ts
@@ -46,6 +46,7 @@ export const ja: Catalog = {
"Laser pointer (L)": "レーザーポインター (L)",
"Toggle laser pointer while presenting": "プレゼン中にレーザーポインターのオン/オフを切り替え",
"Backed up in this browser": "このブラウザに保存しました",
+ "Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.": "このデッキのクラッシュ復旧はオフです — 大きすぎてバックアップを保存できません。こまめに保存してください。",
"Unsaved changes — kept in this browser at {when} and offered back if you reopen. ⌘S downloads an updated copy.": "未保存の変更 — {when} にこのブラウザへ保存済みで、再度開いたときに復元できます。⌘S は更新されたコピーをダウンロードします。",
"Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)": "未保存の変更 — ⌘S は更新されたコピーをダウンロードします(このブラウザはファイルを上書きできません)",
"Save — download an updated copy (⌘S). This browser can’t rewrite the open file.": "保存 — 更新されたコピーをダウンロード(⌘S)。このブラウザは開いているファイルを上書きできません。",
@@ -457,6 +458,10 @@ export const ja: Catalog = {
"Stop tracking the table; the chart keeps its current data": "表の追跡を停止します。グラフは現在のデータを保持します",
"Chart created — it updates live with the table": "グラフを作成しました — 表と連動して更新されます",
"Unsaved changes from {when} were found.": "{when} の未保存の変更が見つかりました。",
+ "Copy saved — you are still editing the original": "コピーを保存しました — 編集中なのは引き続き元のファイルです",
+ "This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.": "この復元コピーは、開いたファイルより古いようです。新しいと分かっている場合を除き、ファイルをそのまま使ってください。",
+ "Keep the file": "ファイルを使う",
+ "Restore anyway": "それでも復元",
"Restore": "復元",
"Restored your unsaved changes": "未保存の変更を復元しました",
"Discard": "破棄",
diff --git a/slides/src/i18n/packed.ts b/slides/src/i18n/packed.ts
index 48d3d0f1..04bd958e 100644
--- a/slides/src/i18n/packed.ts
+++ b/slides/src/i18n/packed.ts
@@ -57,6 +57,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Laser pointer (L)": ["レーザーポインター (L)","激光笔 (L)","雷射筆 (L)","Puntero láser (L)","Pointeur laser (L)","Laserpointer (L)","Puntatore laser (L)","Apontador laser (L)"],
"Toggle laser pointer while presenting": ["プレゼン中にレーザーポインターのオン/オフを切り替え","演示时开启或关闭激光笔","簡報時開啟或關閉雷射筆","Activar o desactivar el puntero láser durante la presentación","Activer ou désactiver le pointeur laser pendant la présentation","Laserpointer während der Präsentation ein-/ausschalten","Attiva/disattiva il puntatore laser durante la presentazione","Alternar o apontador laser durante a apresentação"],
"Backed up in this browser": ["このブラウザに保存しました","已备份到此浏览器","已備份到此瀏覽器","Copia guardada en este navegador","Sauvegardé dans ce navigateur","In diesem Browser gesichert","Salvato in questo browser","Salvo neste navegador"],
+ "Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.": ["このデッキのクラッシュ復旧はオフです — 大きすぎてバックアップを保存できません。こまめに保存してください。","此演示文稿的崩溃恢复已关闭 — 文件太大,无法保留备份。请经常保存。","此簡報的當機復原已關閉 — 檔案太大,無法保留備份。請經常儲存。","La recuperación tras fallos está desactivada para esta presentación: es demasiado grande para guardar una copia de seguridad. Guarda a menudo.","La récupération après plantage est désactivée pour ce deck : il est trop volumineux pour en garder une copie de secours. Enregistrez souvent.","Die Absturzwiederherstellung ist für diese Präsentation deaktiviert – sie ist zu groß für eine Sicherungskopie. Speichern Sie häufig.","Il ripristino dopo un arresto anomalo è disattivato per questa presentazione: è troppo grande per conservarne una copia di backup. Salva spesso.","A recuperação de falhas está desativada para esta apresentação: ela é grande demais para manter uma cópia de segurança. Salve com frequência."],
"Unsaved changes — kept in this browser at {when} and offered back if you reopen. ⌘S downloads an updated copy.": ["未保存の変更 — {when} にこのブラウザへ保存済みで、再度開いたときに復元できます。⌘S は更新されたコピーをダウンロードします。","未保存的更改 — 已于 {when} 保存在此浏览器中,重新打开时可以恢复。⌘S 将下载更新后的副本。","未儲存的變更 — 已於 {when} 保存在此瀏覽器中,重新開啟時可以還原。⌘S 會下載更新後的副本。","Cambios sin guardar — conservados en este navegador a las {when} y se te ofrecerán al reabrir. ⌘S descarga una copia actualizada.","Modifications non enregistrées — conservées dans ce navigateur à {when} et proposées à la réouverture. ⌘S télécharge une copie à jour.","Nicht gespeicherte Änderungen — um {when} in diesem Browser gesichert und beim erneuten Öffnen angeboten. ⌘S lädt eine aktualisierte Kopie herunter.","Modifiche non salvate — conservate in questo browser alle {when} e riproposte alla riapertura. ⌘S scarica una copia aggiornata.","Alterações não salvas — guardadas neste navegador às {when} e oferecidas de volta se você reabrir. ⌘S baixa uma cópia atualizada."],
"Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)": ["未保存の変更 — ⌘S は更新されたコピーをダウンロードします(このブラウザはファイルを上書きできません)","未保存的更改 — ⌘S 将下载更新后的副本(此浏览器无法改写文件)","未儲存的變更 — ⌘S 會下載更新後的副本(此瀏覽器無法改寫檔案)","Cambios sin guardar — ⌘S descarga una copia actualizada (este navegador no puede reescribir el archivo)","Modifications non enregistrées — ⌘S télécharge une copie à jour (ce navigateur ne peut pas réécrire le fichier)","Nicht gespeicherte Änderungen — ⌘S lädt eine aktualisierte Kopie herunter (dieser Browser kann die Datei nicht überschreiben)","Modifiche non salvate — ⌘S scarica una copia aggiornata (questo browser non può riscrivere il file)","Alterações não salvas — ⌘S baixa uma cópia atualizada (este navegador não consegue regravar o arquivo)"],
"Save — download an updated copy (⌘S). This browser can’t rewrite the open file.": ["保存 — 更新されたコピーをダウンロード(⌘S)。このブラウザは開いているファイルを上書きできません。","保存 — 下载更新后的副本(⌘S)。此浏览器无法改写已打开的文件。","儲存 — 下載更新後的副本(⌘S)。此瀏覽器無法改寫已開啟的檔案。","Guardar — descargar una copia actualizada (⌘S). Este navegador no puede reescribir el archivo abierto.","Enregistrer — télécharger une copie à jour (⌘S). Ce navigateur ne peut pas réécrire le fichier ouvert.","Speichern — aktualisierte Kopie herunterladen (⌘S). Dieser Browser kann die geöffnete Datei nicht überschreiben.","Salva — scarica una copia aggiornata (⌘S). Questo browser non può riscrivere il file aperto.","Salvar — baixar uma cópia atualizada (⌘S). Este navegador não consegue regravar o arquivo aberto."],
@@ -468,6 +469,10 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Stop tracking the table; the chart keeps its current data": ["表の追跡を停止します。グラフは現在のデータを保持します","停止跟踪该表格;图表保留其当前数据","停止追蹤該表格;圖表保留其目前資料","Deja de seguir la tabla; el gráfico conserva sus datos actuales","Ne plus suivre le tableau ; le graphique conserve ses données actuelles","Die Tabelle nicht mehr verfolgen; das Diagramm behält seine aktuellen Daten","Smetti di seguire la tabella; il grafico mantiene i suoi dati attuali","Para de acompanhar a tabela; o gráfico mantém os dados atuais"],
"Chart created — it updates live with the table": ["グラフを作成しました — 表と連動して更新されます","已创建图表 — 它会随表格实时更新","已建立圖表 — 它會隨表格即時更新","Gráfico creado — se actualiza en vivo con la tabla","Graphique créé — il se met à jour en direct avec le tableau","Diagramm erstellt — es aktualisiert sich live mit der Tabelle","Grafico creato — si aggiorna in tempo reale con la tabella","Gráfico criado — ele se atualiza ao vivo com a tabela"],
"Unsaved changes from {when} were found.": ["{when} の未保存の変更が見つかりました。","发现来自 {when} 的未保存更改。","發現來自 {when} 的未儲存變更。","Se encontraron cambios sin guardar de {when}.","Modifications non enregistrées du {when} trouvées.","Nicht gespeicherte Änderungen von {when} gefunden.","Trovate modifiche non salvate del {when}.","Foram encontradas alterações não salvas de {when}."],
+ "Copy saved — you are still editing the original": ["コピーを保存しました — 編集中なのは引き続き元のファイルです","副本已保存 — 你仍在编辑原文件","副本已儲存 — 你仍在編輯原始檔案","Copia guardada: sigues editando el original","Copie enregistrée — vous modifiez toujours l'original","Kopie gespeichert — Sie bearbeiten weiterhin das Original","Copia salvata: stai ancora modificando l'originale","Cópia salva — você continua editando o original"],
+ "This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.": ["この復元コピーは、開いたファイルより古いようです。新しいと分かっている場合を除き、ファイルをそのまま使ってください。","此恢复副本似乎比你打开的文件更旧。除非你确定它更新,否则请保留该文件。","此復原副本似乎比你開啟的檔案更舊。除非你確定它較新,否則請保留該檔案。","Esta copia recuperada parece más antigua que el archivo que abriste. Conserva el archivo, salvo que sepas que la copia es más reciente.","Cette copie récupérée semble plus ancienne que le fichier ouvert. Gardez le fichier, sauf si vous savez qu’elle est plus récente.","Diese wiederhergestellte Kopie scheint älter zu sein als die geöffnete Datei. Behalten Sie die Datei, es sei denn, Sie wissen, dass die Kopie neuer ist.","Questa copia recuperata sembra più vecchia del file che hai aperto. Tieni il file, a meno che tu non sappia che la copia è più recente.","Esta cópia recuperada parece mais antiga do que o arquivo que você abriu. Mantenha o arquivo, a menos que saiba que a cópia é mais recente."],
+ "Keep the file": ["ファイルを使う","保留文件","保留檔案","Conservar el archivo","Garder le fichier","Datei behalten","Tieni il file","Manter o arquivo"],
+ "Restore anyway": ["それでも復元","仍然恢复","仍然還原","Restaurar de todos modos","Restaurer quand même","Trotzdem wiederherstellen","Ripristina comunque","Restaurar mesmo assim"],
"Restore": ["復元","恢复","還原","Restaurar","Restaurer","Wiederherstellen","Ripristina","Restaurar"],
"Restored your unsaved changes": ["未保存の変更を復元しました","已恢复未保存的更改","已還原未儲存的變更","Cambios sin guardar restaurados","Modifications non enregistrées restaurées","Nicht gespeicherte Änderungen wiederhergestellt","Modifiche non salvate ripristinate","Suas alterações não salvas foram restauradas"],
"Discard": ["破棄","放弃","捨棄","Descartar","Ignorer","Verwerfen","Ignora","Descartar"],
diff --git a/slides/src/i18n/pt.ts b/slides/src/i18n/pt.ts
index a286e7a9..98cfbcfb 100644
--- a/slides/src/i18n/pt.ts
+++ b/slides/src/i18n/pt.ts
@@ -449,6 +449,10 @@ export const pt: Catalog = {
"Stop tracking the table; the chart keeps its current data": "Para de acompanhar a tabela; o gráfico mantém os dados atuais",
"Chart created — it updates live with the table": "Gráfico criado — ele se atualiza ao vivo com a tabela",
"Unsaved changes from {when} were found.": "Foram encontradas alterações não salvas de {when}.",
+ "Copy saved — you are still editing the original": "Cópia salva — você continua editando o original",
+ "This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.": "Esta cópia recuperada parece mais antiga do que o arquivo que você abriu. Mantenha o arquivo, a menos que saiba que a cópia é mais recente.",
+ "Keep the file": "Manter o arquivo",
+ "Restore anyway": "Restaurar mesmo assim",
"Restore": "Restaurar",
"Restored your unsaved changes": "Suas alterações não salvas foram restauradas",
"Discard": "Descartar",
@@ -707,6 +711,7 @@ export const pt: Catalog = {
"Set how fast the element moves through that point": "Define a velocidade com que o elemento passa por esse ponto",
"Scroll a point": "Role sobre um ponto",
"Backed up in this browser": "Salvo neste navegador",
+ "Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.": "A recuperação de falhas está desativada para esta apresentação: ela é grande demais para manter uma cópia de segurança. Salve com frequência.",
"Unsaved changes — kept in this browser at {when} and offered back if you reopen. ⌘S downloads an updated copy.": "Alterações não salvas — guardadas neste navegador às {when} e oferecidas de volta se você reabrir. ⌘S baixa uma cópia atualizada.",
"Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)": "Alterações não salvas — ⌘S baixa uma cópia atualizada (este navegador não consegue regravar o arquivo)",
"Save — download an updated copy (⌘S). This browser can’t rewrite the open file.": "Salvar — baixar uma cópia atualizada (⌘S). Este navegador não consegue regravar o arquivo aberto.",
diff --git a/slides/src/i18n/zh-Hans.ts b/slides/src/i18n/zh-Hans.ts
index c0ec78c2..39c91a3b 100644
--- a/slides/src/i18n/zh-Hans.ts
+++ b/slides/src/i18n/zh-Hans.ts
@@ -46,6 +46,7 @@ export const zhHans: Catalog = {
"Laser pointer (L)": "激光笔 (L)",
"Toggle laser pointer while presenting": "演示时开启或关闭激光笔",
"Backed up in this browser": "已备份到此浏览器",
+ "Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.": "此演示文稿的崩溃恢复已关闭 — 文件太大,无法保留备份。请经常保存。",
"Unsaved changes — kept in this browser at {when} and offered back if you reopen. ⌘S downloads an updated copy.": "未保存的更改 — 已于 {when} 保存在此浏览器中,重新打开时可以恢复。⌘S 将下载更新后的副本。",
"Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)": "未保存的更改 — ⌘S 将下载更新后的副本(此浏览器无法改写文件)",
"Save — download an updated copy (⌘S). This browser can’t rewrite the open file.": "保存 — 下载更新后的副本(⌘S)。此浏览器无法改写已打开的文件。",
@@ -457,6 +458,10 @@ export const zhHans: Catalog = {
"Stop tracking the table; the chart keeps its current data": "停止跟踪该表格;图表保留其当前数据",
"Chart created — it updates live with the table": "已创建图表 — 它会随表格实时更新",
"Unsaved changes from {when} were found.": "发现来自 {when} 的未保存更改。",
+ "Copy saved — you are still editing the original": "副本已保存 — 你仍在编辑原文件",
+ "This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.": "此恢复副本似乎比你打开的文件更旧。除非你确定它更新,否则请保留该文件。",
+ "Keep the file": "保留文件",
+ "Restore anyway": "仍然恢复",
"Restore": "恢复",
"Restored your unsaved changes": "已恢复未保存的更改",
"Discard": "放弃",
diff --git a/slides/src/i18n/zh-Hant.ts b/slides/src/i18n/zh-Hant.ts
index 18d24207..c3e393e7 100644
--- a/slides/src/i18n/zh-Hant.ts
+++ b/slides/src/i18n/zh-Hant.ts
@@ -46,6 +46,7 @@ export const zhHant: Catalog = {
"Laser pointer (L)": "雷射筆 (L)",
"Toggle laser pointer while presenting": "簡報時開啟或關閉雷射筆",
"Backed up in this browser": "已備份到此瀏覽器",
+ "Crash recovery is off for this deck — it’s too large to keep a backup copy. Save often.": "此簡報的當機復原已關閉 — 檔案太大,無法保留備份。請經常儲存。",
"Unsaved changes — kept in this browser at {when} and offered back if you reopen. ⌘S downloads an updated copy.": "未儲存的變更 — 已於 {when} 保存在此瀏覽器中,重新開啟時可以還原。⌘S 會下載更新後的副本。",
"Unsaved changes — ⌘S downloads an updated copy (this browser can’t rewrite the file)": "未儲存的變更 — ⌘S 會下載更新後的副本(此瀏覽器無法改寫檔案)",
"Save — download an updated copy (⌘S). This browser can’t rewrite the open file.": "儲存 — 下載更新後的副本(⌘S)。此瀏覽器無法改寫已開啟的檔案。",
@@ -457,6 +458,10 @@ export const zhHant: Catalog = {
"Stop tracking the table; the chart keeps its current data": "停止追蹤該表格;圖表保留其目前資料",
"Chart created — it updates live with the table": "已建立圖表 — 它會隨表格即時更新",
"Unsaved changes from {when} were found.": "發現來自 {when} 的未儲存變更。",
+ "Copy saved — you are still editing the original": "副本已儲存 — 你仍在編輯原始檔案",
+ "This recovered copy looks older than the file you opened. Keep the file unless you know it’s newer.": "此復原副本似乎比你開啟的檔案更舊。除非你確定它較新,否則請保留該檔案。",
+ "Keep the file": "保留檔案",
+ "Restore anyway": "仍然還原",
"Restore": "還原",
"Restored your unsaved changes": "已還原未儲存的變更",
"Discard": "捨棄",