forked from 1b-agent/opencadstudio-upstream
The web build had no autosave: on_autosave was a no-op and the subscription was native-only. Both gates are gone; every savetime tick now serializes each dirty tab (same pre-serialize sync as the web save path, no thumbnail, serialized serially off the critical paint path) into a dedicated opencadstudio-autosave OPFS directory, keyed by drawing name, without touching the dirty flag, downloads, or recents. On boot the web app scans that directory and offers any snapshot newer than the last saved copy in a localized Recover Drawing modal (Restore opens it as "name (recovered).dwg" through the standard open pipeline; Discard removes it; Escape discards). Saving or closing a drawing clears its snapshot; the boot scan also garbage- collects stale entries. run_web now requests navigator.storage.persist so settings and OPFS data survive browser eviction.