We currently autosave full graph payloads in localStorage. This is brittle for larger workflows and can silently drop history when writes fail. Session restore is also partial (open tabs, active tab, and file metadata are not reliably recovered).
Based on discussion, this will follow a hybrid storage model:
keep filesystem storage for file/binary artifacts (imports/exports)
move graph/session metadata persistence to IndexedDB
This keeps binaries out of DB, while fixing reliability for autosave + restore.
Scope
- add a versioned IndexedDB storage layer for graph/session metadata
- run one-time migration of existing localStorage metadata on first successful init
- wire autosave/load/session-restore to the new metadata store
- handle corrupted entries by skipping bad records and continuing load
- keep a sane fallback path when IndexedDB is unavailable
- remove silent history-loss behavior during normal saves
- add automated tests for migration, restore, corrupted-record skip, and IndexedDB-unavailable fallback
- add docs for schema, migration flow, fallback behavior, and manual verification steps
Acceptance criteria
- reload restores previously open graphs and active tab
- large workflows save/load reliably without quota-related loss
- existing users are migrated automatically
- one corrupted record does not block full workspace restore