Skip to content

Fix Save Layout when showSaveFilePicker is unsupported#378

Open
ishyv wants to merge 1 commit intothe-via:mainfrom
ishyv:fix/save-layout-save-picker-fallback
Open

Fix Save Layout when showSaveFilePicker is unsupported#378
ishyv wants to merge 1 commit intothe-via:mainfrom
ishyv:fix/save-layout-save-picker-fallback

Conversation

@ishyv
Copy link
Copy Markdown

@ishyv ishyv commented Mar 16, 2026

Problem

Saving the current layout relied on the File System Access API (window.showSaveFilePicker). In browsers/contexts where that API is unsupported or blocked, the call fails before showing any prompt. The previous implementation caught all errors and logged "user cancelled", which hid the real failure and prevented saving entirely.

Fix

  • Prefer showSaveFilePicker when available
  • Treat AbortError as a real user cancel
  • Fall back to a standard Blob download (<a download>) otherwise

Repro

  1. Open the app in a browser without File System Access API support (e.g. Firefox/Safari)
  2. Go to Configure → Save Current Layout → Save

Before: no prompt + no file saved (misleading "user cancelled" log).
After: layout downloads as a .layout.json file.

Prefer File System Access API when available, but fall back to a Blob download so Save Layout works in unsupported/blocked contexts. Only treat AbortError as a real user cancel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant