Clean up autosave persistence (#3115)

* Set auto save state to false on document rename

* Update open document list on transaction commit and aboard

* Use current network to compute hash

Was using the last element in undo
Before artworks where not auto saved when the had no undo history

* Refactor persistence
This commit is contained in:
Timon
2025-09-02 13:27:38 +00:00
committed by GitHub
parent b5ebe78f5e
commit 083dfa5f49
9 changed files with 93 additions and 83 deletions
@@ -2,7 +2,7 @@
import { getContext } from "svelte";
import type { Editor } from "@graphite/editor";
import type { FrontendDocumentDetails } from "@graphite/messages";
import type { OpenDocument } from "@graphite/messages";
import type { DialogState } from "@graphite/state-providers/dialog";
import type { PortfolioState } from "@graphite/state-providers/portfolio";
@@ -29,7 +29,7 @@
$: documentPanel?.scrollTabIntoView($portfolio.activeDocumentIndex);
$: documentTabLabels = $portfolio.documents.map((doc: FrontendDocumentDetails) => {
$: documentTabLabels = $portfolio.documents.map((doc: OpenDocument) => {
const name = doc.displayName;
if (!editor.handle.inDevelopmentMode()) return { name };