Skip to content

fix(window): offer Save as when the open file is read-only (#211) (#212) - #213

Merged
gnacho merged 1 commit into
masterfrom
fix/211-flatpak-readonly-save
Nov 21, 2026
Merged

gnacho merged 1 commit into
masterfrom
fix/211-flatpak-readonly-save

Conversation

@gnacho

@gnacho gnacho commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Closes #211
Closes #212

What

A file opened through the Flatpak document portal can be exported read-only (for example from the GNOME overview search), and a plain 0444 file cannot be written either. In both cases the first Ctrl+S failed with Permission denied (os error 13) and nothing was saved.

The save action now opens the file for writing first. If that fails, it shows a short message and continues through the existing Save as dialog, so the user picks where the copy goes and the document keeps working from there. Nothing is written behind the user's back and the sandbox permissions do not change.

The header subtitle no longer shows the portal mount path (/run/user/<uid>/doc/<id>). That directory is a temporary grant from the portal, it says nothing about where the document lives, and it was the confusing part of #212. The tooltip keeps the real path.

Tests

  • guardado::tests::un_fichero_de_solo_lectura_no_es_escribible (a 0444 file is not writable, an existing writable file and a missing file are).
  • guardado::tests::reconoce_las_rutas_del_portal_de_documentos (portal paths and lookalikes).

make check green: fmt, clippy -D warnings, unit and integration suites, version checks. Both strings are in po/es.po.

A document lent by the Flatpak document portal can be exported read-only, and a plain 0444 file cannot be written either. Both failed with EACCES on the first Ctrl+S. The save action now checks whether the file can be opened for writing and falls back to Save as, reusing the existing dialog and the existing duplicate-path guard.

The header subtitle no longer shows the portal mount path, which says nothing about where the document lives.

Closes #211
Closes #212
@gnacho
gnacho merged commit 3dbe63e into master Nov 21, 2026
3 checks passed
@gnacho
gnacho deleted the fix/211-flatpak-readonly-save branch November 21, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant