From 450f035b3a2ae000a2f0f2d594112787721b595c Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 21 Oct 2026 23:35:43 +0200 Subject: [PATCH] fix(viewer): say when changes to a mind map are not saved FreeMind and XMind files can be opened and edited, but not saved. The editor hid the save controls and closed without asking, so users lost their edits without being told. Show a notice when such a file opens. Refs #166 Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger (cherry picked from commit d6e3c14adf01cea94731cef17113f1e8df1c0afb) --- src/__tests__/mindmap.spec.js | 1 + src/mindmap.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/__tests__/mindmap.spec.js b/src/__tests__/mindmap.spec.js index 13b1dc91..e0173758 100644 --- a/src/__tests__/mindmap.spec.js +++ b/src/__tests__/mindmap.spec.js @@ -484,6 +484,7 @@ describe('FilesMindMap', () => { await flushPromises() expect(FilesMindMap._file.supportedWrite).toBe(false) + expect(showToast).toHaveBeenCalledWith(expect.stringContaining('are not saved'), expect.anything()) }) it('GETs the public share endpoint with the sharing token on a public share', async () => { diff --git a/src/mindmap.js b/src/mindmap.js index 79289823..65466c55 100644 --- a/src/mindmap.js +++ b/src/mindmap.js @@ -158,6 +158,7 @@ const FilesMindMap = { if (plugin.encode === null) { data.writeable = false data.supportedWrite = false + self.showMessage(t('files_mindmap', 'Changes to {extension} files are not saved.', { extension: plugin.name }), 10000) } self._file.writeable = data.writeable