Files
youtube-generator/src
poli0981andClaude Opus 5.5 3912ca5152 feat(data): backup & restore with preview and undo; desktop files by name only
Storage (desktop):
- The webview can no longer name a path. Five commands that read, wrote,
  listed and deleted any path the frontend sent are replaced by name-only
  commands (backups, logs) that resolve under the app data folder, and by
  export/import commands that open the native dialog from Rust, so the only
  file touched is the one the user picked (json/jsonl/txt/csv/md, 20 MB).
  The fs and shell plugins are removed (Rust, npm, capabilities).
- The settings "mirror" file is gone: it was written next to the data
  folder (a missing path separator) and never read back. On first start
  the file becomes a restorable backup — never applied on its own — and
  the stray log folder is merged into the right one.
- Automatic backups on desktop: after library changes (quiet 30 s, at most
  every 10 min, skipped when unchanged or empty), newest ten kept, plus one
  before every restore. Settings lists them with Restore.
- One tray icon, built in code with the app icon (the config entry that
  could add a second, iconless one is removed).

Backup & restore (every platform):
- Format 2 files carry each section's store version; imports run the
  stores' own migrations (now exported functions), then a whitelist
  sanitizer: known fields and values only, editor limits, safe unique ids.
- Reads every earlier export: v0.15-v0.38 envelopes (log exports were
  labelled "history"), pre-v0.15 bare arrays, the old desktop data file.
- Restore dialog: new / already here / different per item, merge (keep the
  newer one, or both) or replace, section and item selection, one step,
  Undo. Newer-version sections are shown, not restored.
- Settings: Back up (choose sections) / Restore / drop a file. Consent and
  panel state are never exported or overwritten.
- History export as CSV (spreadsheet-safe) or JSON; logs export as "logs";
  dated file names; no more 250 ms timer guessing that a picker was
  cancelled.

Library:
- Templates save every editor field; presets save store link types and the
  other per-game fields; profiles save donate, community links and the
  custom graphics preset. Edit forms can update from the current editor,
  start fresh each time they open, and save on Enter. Toasts translated.

Dev: Vite no longer watches src-tauri (cargo's locked .dll crashed
`tauri dev` on Windows).

Verified in `tauri dev` on Windows under a test identifier: legacy file
recovered, old logs merged, auto backup, restore from the legacy backup
with a backup before it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 22:05:12 +07:00
..