photocraft/apps
Zuujis 58f855a40f
Save As on Linux: the file type picked sets the extension (#6121, #4328, #4394) (#6151)
* Save As on Linux: the file type picked sets the extension (#6121, #4328, #4394)

The GTK file chooser behind the desktop portal keeps the typed name when
another file type is picked, and rfd 0.17.2 reads only the file name from
the portal's answer, so Untitled-1.psd with PNG picked was written as a
PSD. On Linux, Save As now asks the portal's FileChooser.SaveFile itself
(over the zbus already used for the portal), reads current_filter, and
gives the name that type's extension: an extension PhotoCraft saves is
replaced, none or another is appended. If that names an existing file, the
dialog opens again under the new name so the portal asks before replacing
it. rfd remains the fallback without a portal, and this can go once an rfd
release reads current_filter (PolyMeilex/rfd#341).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Save As on Linux: keep typed extensions, open on the stem, follow the request handle

Review follow-ups, checked on real GNOME 46 and KDE Plasma 6.7.5 sessions
(Wayland and X11):

- An extension the user typed is kept, as in PolyMeilex/rfd#341: only a
  name with none, or still with the extension the dialog opened with, takes
  the picked type's. GTK reports the type even when it is untouched, so
  art.png with the PSD type left alone was saved as art.psd.
- The dialog opens on the stem (test), as on Windows (#4407): with
  test.psd in the name and PNG picked, GTK asked to replace test.psd,
  which the save leaves alone. A name that then exists is asked about
  again under that name; the rule compares against the suggested name, so
  a test.psd GTK completes back still becomes test.png.
- Response 2 (GNOME's dialog closed with Esc) is a cancel: it fell back to
  rfd, which opened a second Save As.
- The answer is awaited on the handle SaveFile returns, which a portal
  older than 0.9 picks itself (the Request documentation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style(automation): format smart filter refresh closure

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: skylar taylor-barrick <hi@skylar.cc>
2026-10-15 22:47:17 -06:00
..
photocraft Save As on Linux: the file type picked sets the extension (#6121, #4328, #4394) (#6151) 2026-10-15 22:47:17 -06:00
photocraft-cli feat(commands): find the Elliptical Marquee by 'ellipse' or 'marquee' (#5140) 2026-10-14 12:45:24 -04:00
photocraft-web Codecs: open Cineon (.cin) film frames read-only (#4691) 2026-10-15 00:23:03 -04:00
photocraft-web-boot CI: fix the tests that keep main red, and ship the wasm as compressed parts (#5926, #5302) (#5941) 2026-10-15 09:21:30 +02:00