Harden data export, import, backup, and generated-state rebuild flows #86

Closed
opened 2026-05-22 11:34:53 +00:00 by steve · 0 comments
Owner

Improve the app's data safety and recovery flows so users can export, import,
back up, and rebuild generated state without risking canonical notes.

Problem

Lapis is local-first and file-oriented, but browser-local storage such as OPFS
is opaque to many users. A complete notes app needs explicit export, import,
backup, and rebuild flows so users can trust that their notes remain portable
and recoverable.

Goal

Add or harden user-facing data safety flows for browser-local vaults,
Electron-backed vaults, and generated-state rebuild paths across the app.

Scope

  • For browser or PWA vaults, support export and import of a portable vault
    format and show that OPFS storage is browser-local.
  • For Electron vaults, support revealing the backing folder and provide a clear
    export or copy path.
  • For all platforms, distinguish canonical user files from generated app data.
  • Add actions to rebuild metadata, search, and notebook-generated state.
  • Surface progress and errors for import, export, backup, and rebuild flows.
  • Link these flows from release-readiness and data-safety docs.

Non-goals

  • Real-time sync.
  • Cloud backup.
  • Multi-device conflict resolution.
  • End-to-end encrypted remote storage.
  • Git integration.

Acceptance Criteria

  • Browser users can export a vault into a portable format.
  • Browser users can import a previously exported vault.
  • Electron users can reveal or open the underlying vault folder.
  • Users can rebuild metadata and search generated state without deleting notes.
  • Users can clear notebook outputs without deleting notebook source files.
  • Data-safety docs explain what is canonical and what is generated.
  • The app displays a warning or explanation for OPFS or browser-local vaults.
  • Import and export operations surface progress and errors.
  • At least one test covers export, import, or rebuild behavior.
  • The release checklist links to these data-safety flows.

Implementation Notes

  • Prioritize clear, reliable behavior over clever sync semantics.
  • Keep import and export formats simple and inspectable.
  • If browser folder export is harder than zip export, implement zip first.
  • Make rebuild actions idempotent where practical.
  • Ensure the app can recover from missing generated state on startup.

Suggested Files or Specs To Inspect

  • spec/src/20-packages/workspace/
  • spec/src/30-cross-package-contracts/storage-metadata-search.md
  • spec/src/20-packages/notebook/
  • spec/src/40-testing/current-state.md

Validation Commands

  • pnpm check
  • pnpm test:smoke

Follow-up Tasks

  • Split browser-only and Electron-only implementation follow-ups if the main
    issue becomes too broad.

Implementation Summary

Duplicate of completed issue #80; keeping #80 as the canonical data-safety issue.

Improve the app's data safety and recovery flows so users can export, import, back up, and rebuild generated state without risking canonical notes. ## Problem Lapis is local-first and file-oriented, but browser-local storage such as OPFS is opaque to many users. A complete notes app needs explicit export, import, backup, and rebuild flows so users can trust that their notes remain portable and recoverable. ## Goal Add or harden user-facing data safety flows for browser-local vaults, Electron-backed vaults, and generated-state rebuild paths across the app. ## Scope - For browser or PWA vaults, support export and import of a portable vault format and show that OPFS storage is browser-local. - For Electron vaults, support revealing the backing folder and provide a clear export or copy path. - For all platforms, distinguish canonical user files from generated app data. - Add actions to rebuild metadata, search, and notebook-generated state. - Surface progress and errors for import, export, backup, and rebuild flows. - Link these flows from release-readiness and data-safety docs. ## Non-goals - Real-time sync. - Cloud backup. - Multi-device conflict resolution. - End-to-end encrypted remote storage. - Git integration. ## Acceptance Criteria - Browser users can export a vault into a portable format. - Browser users can import a previously exported vault. - Electron users can reveal or open the underlying vault folder. - Users can rebuild metadata and search generated state without deleting notes. - Users can clear notebook outputs without deleting notebook source files. - Data-safety docs explain what is canonical and what is generated. - The app displays a warning or explanation for OPFS or browser-local vaults. - Import and export operations surface progress and errors. - At least one test covers export, import, or rebuild behavior. - The release checklist links to these data-safety flows. ## Implementation Notes - Prioritize clear, reliable behavior over clever sync semantics. - Keep import and export formats simple and inspectable. - If browser folder export is harder than zip export, implement zip first. - Make rebuild actions idempotent where practical. - Ensure the app can recover from missing generated state on startup. ## Suggested Files or Specs To Inspect - `spec/src/20-packages/workspace/` - `spec/src/30-cross-package-contracts/storage-metadata-search.md` - `spec/src/20-packages/notebook/` - `spec/src/40-testing/current-state.md` ## Validation Commands - `pnpm check` - `pnpm test:smoke` ## Follow-up Tasks - Split browser-only and Electron-only implementation follow-ups if the main issue becomes too broad. ## Implementation Summary Duplicate of completed issue #80; keeping #80 as the canonical data-safety issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#86
No description provided.