From d6e3c14adf01cea94731cef17113f1e8df1c0afb 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 --- 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 dc836d22..99815c17 100644 --- a/src/__tests__/mindmap.spec.js +++ b/src/__tests__/mindmap.spec.js @@ -428,6 +428,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 a3603b71..28306344 100644 --- a/src/mindmap.js +++ b/src/mindmap.js @@ -134,6 +134,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