fix(files): address autosave migration and review regressions

Seed omitted autoSaveEnabled from the hydrated client preference (including
legacy localStorage) instead of resetting everyone to enabled. Restore SVG
non-editable flags, treat clean draft saves as success, and throw again from
disposed content-cache owners while keeping runtime-switch cache invalidation.

Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-07-30 11:29:37 +00:00
co-authored by Serhii Dziupin
parent fc4db0c656
commit be572c1692
7 changed files with 85 additions and 39 deletions
@@ -51,10 +51,10 @@ describe('shouldAllowFileDraftSave', () => {
expect(shouldAllowFileDraftSave(ready)).toBe(true);
});
test('refuses incomplete load, binary, or clean draft', () => {
test('refuses incomplete load or binary; clean draft is a successful no-op', () => {
expect(shouldAllowFileDraftSave({ ...ready, fileLoading: true })).toBe(false);
expect(shouldAllowFileDraftSave({ ...ready, loadedFilePath: null })).toBe(false);
expect(shouldAllowFileDraftSave({ ...ready, isNonEditableBinary: true })).toBe(false);
expect(shouldAllowFileDraftSave({ ...ready, isDirty: false })).toBe(false);
expect(shouldAllowFileDraftSave({ ...ready, isDirty: false })).toBe(true);
});
});