Summary
Editing any .docx opened with the SuperDoc VS Code extension pops a browser "Save File" dialog (default name SuperDoc.docx) roughly once per second of typing. Edits do persist to the underlying file (the postMessage save path works), but the recurring dialog makes real editing unusable.
Environment
superdoc-vscode-ext 2.15.0
- macOS (VS Code custom-editor webview)
Steps to reproduce
- Open any
.docx with the SuperDoc editor.
- Type a few characters and pause.
- ~1s later a "Save File" dialog appears (suggested name
SuperDoc.docx). It recurs on essentially every edit.
Root cause
In dist/webview/main.js, the debounced autosave calls:
const blob = await editor.export({ format: "docx" });
SuperDoc's export() defaults triggerDownload to true:
async export({ exportType = ["docx"], /* ... */, triggerDownload = true, /* ... */ } = {}) {
// ...
if (blobsToZip.length === 1) {
if (triggerDownload) return createDownload(blobsToZip[0], baseFileName, exportType[0]); // <-- showSaveFilePicker
return blobsToZip[0];
}
// ...
}
With triggerDownload left at its default, export() returns createDownload(...), which calls window.showSaveFilePicker inside the webview. Because both the debounced autosave (AUTO_SAVE_DELAY = 1000) and the Cmd/Ctrl+S handler call saveDocument(), the picker fires on virtually every edit.
(Minor: format is not a recognized export() option; the intended key is exportType.)
Fix
Pass triggerDownload: false so export() returns the blob without triggering a download:
const blob = await editor.export({ exportType: ["docx"], triggerDownload: false });
Verified locally against 2.15.0: the dialog no longer appears, and the silent autosave-to-disk continues to work (edits persist across tab switches).
Summary
Editing any
.docxopened with the SuperDoc VS Code extension pops a browser "Save File" dialog (default nameSuperDoc.docx) roughly once per second of typing. Edits do persist to the underlying file (thepostMessagesave path works), but the recurring dialog makes real editing unusable.Environment
superdoc-vscode-ext2.15.0Steps to reproduce
.docxwith the SuperDoc editor.SuperDoc.docx). It recurs on essentially every edit.Root cause
In
dist/webview/main.js, the debounced autosave calls:SuperDoc's
export()defaultstriggerDownloadtotrue:With
triggerDownloadleft at its default,export()returnscreateDownload(...), which callswindow.showSaveFilePickerinside the webview. Because both the debounced autosave (AUTO_SAVE_DELAY = 1000) and theCmd/Ctrl+Shandler callsaveDocument(), the picker fires on virtually every edit.(Minor:
formatis not a recognizedexport()option; the intended key isexportType.)Fix
Pass
triggerDownload: falsesoexport()returns the blob without triggering a download:Verified locally against 2.15.0: the dialog no longer appears, and the silent autosave-to-disk continues to work (edits persist across tab switches).